Skip to content

Commit 3b03036

Browse files
authored
Add support for Cellranger 10 (#20)
* Adding support for Cell Ranger 10 * Fix: during final check only store type information if present in file * Fix: changing the order where silhouette output files are saved and handling the scenario when only one cluster is generated * Fix: edit generateSummaryFiles_MULTI.py so that values less than or equal to 1 in decimal form would be reported as percentages * Bump version
1 parent 5d272c5 commit 3b03036

File tree

8 files changed

+23
-19
lines changed

8 files changed

+23
-19
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.0
1+
3.2.0

cell-seek

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,11 @@ def parsed_arguments(name, description):
517517
options: hg38, mm10, hg2024, mm2024.
518518
Example: --genome hg38
519519
{3}{4}Analysis options:{5}
520-
--cellranger {{7.1.0, 7.2.0, 8.0.0, 9.0.0}}
520+
--cellranger {{7.1.0, 7.2.0, 8.0.0, 9.0.0, 10.0.0}}
521521
The version of CellRanger to run. This option specifies
522522
which version of CellRanger to use when running GEX,
523523
CITE, or MULTI. Please select one of the following
524-
options: 7.1.0, 7.2.0, 8.0.0, 9.0.0
524+
options: 7.1.0, 7.2.0, 8.0.0, 9.0.0, 10.0.0
525525
Example: --cellranger 7.1.0
526526
--aggregate {{mapped,none}}
527527
Cell Ranger aggregate. This option defines the
@@ -1047,7 +1047,7 @@ def parsed_arguments(name, description):
10471047
type=str.lower,
10481048
required=False,
10491049
default="",
1050-
choices=["7.1.0", "7.2.0", "8.0.0", "9.0.0"],
1050+
choices=["7.1.0", "7.2.0", "8.0.0", "9.0.0", "10.0.0"],
10511051
help=argparse.SUPPRESS,
10521052
)
10531053

config/modules.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"tools": {
3-
"cellranger": {"7.1.0": "cellranger/7.1.0", "7.2.0": "cellranger/7.2.0", "8.0.0": "cellranger/8.0.0", "9.0.0": "cellranger/9.0.0"},
3+
"cellranger": {"7.1.0": "cellranger/7.1.0", "7.2.0": "cellranger/7.2.0", "8.0.0": "cellranger/8.0.0", "9.0.0": "cellranger/9.0.0", "10.0.0": "cellranger/10.0.0"},
44
"cellranger-atac": "cellranger-atac/2.1.0",
55
"cellranger-arc": "cellranger-arc/2.0.1",
66
"python2": "python/2.7",

docs/usage/run.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ Each of the following arguments are required. Failure to provide a required argu
8484
> ***Example:*** `--genome hg2024`
8585
8686
---
87-
`--cellranger {7.1.0, 7.2.0, 8.0.0, 9.0.0}`
87+
`--cellranger {7.1.0, 7.2.0, 8.0.0, 9.0.0, 10.0.0}`
8888
> **The version of Cell Ranger to run.**
8989
> *type: string*
9090
>
91-
> This option specifies which version of Cell Ranger to use when running GEX, VDJ, CITE, or MULTI pipelines. Please select one of the following options: 7.1.0, 7.2.0, 8.0.0, 9.0.0
91+
> This option specifies which version of Cell Ranger to use when running GEX, VDJ, CITE, or MULTI pipelines. Please select one of the following options: 7.1.0, 7.2.0, 8.0.0, 9.0.0, 10.0.0
9292
>
9393
> ***Example:*** `--cellranger 7.1.0`
9494
@@ -269,11 +269,11 @@ Each of the following arguments are required. Failure to provide a required argu
269269
> ***Example:*** `--genome hg38`
270270
271271
---
272-
`--cellranger {7.1.0, 7.2.0, 8.0.0, 9.0.0}`
272+
`--cellranger {7.1.0, 7.2.0, 8.0.0, 9.0.0, 10.0.0}`
273273
> **The version of Cell Ranger to run.**
274274
> *type: string*
275275
>
276-
> This option specifies which version of Cell Ranger to use when running GEX, VDJ, CITE, or MULTI pipelines. Please select one of the following options: 7.1.0, 7.2.0, 8.0.0, 9.0.0
276+
> This option specifies which version of Cell Ranger to use when running GEX, VDJ, CITE, or MULTI pipelines. Please select one of the following options: 7.1.0, 7.2.0, 8.0.0, 9.0.0, 10.0.0
277277
>
278278
> ***Example:*** `--cellranger 7.1.0`
279279
@@ -355,11 +355,11 @@ Each of the following arguments are required. Failure to provide a required argu
355355
> ***Example:*** `--genome hg38`
356356
357357
---
358-
`--cellranger {7.1.0, 7.2.0, 8.0.0, 9.0.0}`
358+
`--cellranger {7.1.0, 7.2.0, 8.0.0, 9.0.0, 10.0.0}`
359359
> **The version of Cell Ranger to run.**
360360
> *type: string*
361361
>
362-
> This option specifies which version of Cell Ranger to use when running GEX, VDJ, CITE, or MULTI pipelines. Please select one of the following options: 7.1.0, 7.2.0, 8.0.0, 9.0.0
362+
> This option specifies which version of Cell Ranger to use when running GEX, VDJ, CITE, or MULTI pipelines. Please select one of the following options: 7.1.0, 7.2.0, 8.0.0, 9.0.0, 10.0.0
363363
>
364364
> ***Example:*** `--cellranger 7.1.0`
365365
@@ -523,11 +523,11 @@ Each of the following arguments are required. Failure to provide a required argu
523523
> ***Example:*** `--genome hg38`
524524
525525
---
526-
`--cellranger {7.1.0, 7.2.0, 8.0.0, 9.0.0}`
526+
`--cellranger {7.1.0, 7.2.0, 8.0.0, 9.0.0, 10.0.0}`
527527
> **The version of Cell Ranger to run.**
528528
> *type: string*
529529
>
530-
> This option specifies which version of Cell Ranger to use when running GEX, VDJ, CITE, or MULTI pipelines. Please select one of the following options: 7.1.0, 7.2.0, 8.0.0, 9.0.0
530+
> This option specifies which version of Cell Ranger to use when running GEX, VDJ, CITE, or MULTI pipelines. Please select one of the following options: 7.1.0, 7.2.0, 8.0.0, 9.0.0, 10.0.0
531531
>
532532
> ***Example:*** `--cellranger 7.1.0`
533533

src/run.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -828,9 +828,10 @@ def finalcheck(config, flag, delimeter=','):
828828
values = contents.get(i, set())
829829
values.add(linelist[indices[i]])
830830
contents[i] = values
831-
value = name_type.get(linelist[indices['name']], set())
832-
value.add(linelist[indices['type']])
833-
name_type[linelist[indices['name']]] = value
831+
if 'type' in indices:
832+
value = name_type.get(linelist[indices['name']], set())
833+
value.add(linelist[indices['type']])
834+
name_type[linelist[indices['name']]] = value
834835

835836
# Compiles the sample names and fastq paths from the input (config)
836837
samples = set([re.sub("_S[0-9]+_L00[0-9]", "", i) for i in config['samples']])

workflow/scripts/generateSummaryFiles_MULTI.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ def write_sheet(workbook, stats, samples, headers, filter):
128128
if i.count('.') > 1:
129129
worksheet.write(row, col, i.replace(',', ''))
130130
else:
131-
worksheet.write(row, col, float(i.replace(',','')), formatFrac)
131+
if float(i.replace(',','')) <= 1:
132+
worksheet.write(row, col, float(i.replace(',','')), formatPer)
133+
else:
134+
worksheet.write(row, col, float(i.replace(',','')), formatFrac)
132135
elif len(re.findall('\D', ''.join(re.findall('[^,]', i)))) > 0:
133136
worksheet.write(row, col, i)
134137
else:

workflow/scripts/seuratSampleQC.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,11 @@ for(resolution in c(0.1, seq(0.2,1.0,0.2), 1.5, 2.0)){
226226
try({
227227
clusters <- Idents(seur)
228228
sil<-silhouette(as.numeric(clusters), dist=d)
229+
write.csv(sil, paste0('SilhouetteResult_res.', resolution, '.csv'), row.names=F, quote=F)
229230
pdf(paste0("SilhouettePlot_res.",resolution,".pdf"))
230231
print(plot(sil, col=as.factor(clusters[order(clusters, decreasing=FALSE)]), main=paste("Silhouette plot of Seurat clustering - resolution ", resolution, sep=""), lty=2))
231232
print(abline(v=mean(sil[,3]), col="red4", lty=2))
232233
dev.off()
233-
write.csv(sil, paste0('SilhouetteResult_res.', resolution, '.csv'), row.names=F, quote=F)
234234
})
235235
}
236236

workflow/scripts/seuratSampleQCReport.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ sil_files <- Sys.glob(file.path(seuratdir, "SilhouetteResult_res*.csv"))
161161
resolutions <- sapply(files, function(x) (x %>% basename %>% tools::file_path_sans_ext() %>% strsplit(split='res.'))[[1]][2]) %>% str_sort(numeric=T)
162162
sil_mean <- sapply(resolutions, function(resolution) {filename <- grep(paste0('res.', resolution, '.csv'), sil_files, value=T); if(length(filename) > 0) { data <- read.csv(filename); mean(data$sil_width)} else{-Inf}})
163163
164-
if (max(sil_mean) > -Inf) {
164+
if (max(sil_mean, na.rm=T) > -Inf) {
165165
cat("The average silhouette score and a silhouette plot was calculated for each cluster resolution. This was done by calculating the score for each cell using the euclidean distance generated based on the cell's principal components to obtain an independent measure of the clustering results. The silhouette score ranges from -1 to 1, where: \n\n* 1 means that clusters are far apart and data points close to each other are assigned the same cluster label\n\n* 0 means that the distance between clusters are not signifcant and data points are close to more than one cluster\n\n* -1 means that clusters may be incorrectly assigned and data points are closer to other clusters than other data points in its own cluster\n\nThe resolution with the highest detected average silhouette score is resolution", sil_mean %>% which.max %>% names, "\n\n")
166166
}
167167

0 commit comments

Comments
 (0)