Skip to content

Commit

Permalink
fix bug when no hto or rna matrix is provided for summary
Browse files Browse the repository at this point in the history
  • Loading branch information
wxicu committed Nov 27, 2023
1 parent 66319ab commit 2e240ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions bin/donor_match.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ if (!is.null(args$barcode)) {

colname_with_singlet <- colnames(result_csv %>% select_if(~ any(. != "negative" & . != "doublet")))
colname_with_singlet <- colname_with_singlet[colname_with_singlet != "Barcode"]
if (length(colname_with_singlet) < 2){
stop("Please choose more methods to run donor matching!")
}

if (!is.null(args$method1) && !is.null(args$method2)) {
method1_all <- colname_with_singlet[startsWith(colnames(result_csv), args$method1)]
method2_all <- colname_with_singlet[startsWith(colnames(result_csv), args$method2)]
Expand Down
8 changes: 4 additions & 4 deletions modules/gene_demultiplexing.nf
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ process summary{
if(rna_matrix.name == "None"){
error "Error: RNA count matrix is not given."
}
generate_adata = "--generate_anndata --read_rna_mtx $rna_matrix"
generate_adata = "--generate_anndata --read_rna_mtx rna_data"
}
if (generate_mudata == "True"){
if(rna_matrix.name == "None"){
Expand All @@ -71,10 +71,10 @@ process summary{
if(hto_matrix.name == "None"){
error "Error: HTO count matrix is not given."
}
generate_mdata = "--generate_mudata --read_rna_mtx $rna_matrix --read_hto_mtx $hto_matrix"
generate_mdata = "--generate_mudata --read_rna_mtx rna_data --read_hto_mtx hto_data"
}
"""
summary_gene.py $demuxlet_files $vireo_files $souporcell_files $scsplit_files $freemuxlet_files $generate_adata $generate_mdata --sampleId $sampleId
summary_gene.py $demuxlet_files $vireo_files $souporcell_files $scsplit_files $freemuxlet_files $generate_adata $generate_mdata
"""
}

Expand Down Expand Up @@ -250,7 +250,7 @@ workflow gene_demultiplexing {

Channel.fromPath(params.multi_input) \
| splitCsv(header:true) \
| map { row-> tuple(row.sampleId, row.hto_matrix_filtered, row.rna_matrix_filtered)}
| map { row-> tuple(row.sampleId, file(row.hto_matrix_filtered), file(row.rna_matrix_filtered))}
| set {input_list_summary}
summary(input_list_summary, demuxlet_out, freemuxlet_out, vireo_out, souporcell_out, scSplit_out,
params.generate_anndata, params.generate_mudata)
Expand Down
2 changes: 1 addition & 1 deletion modules/hash_demultiplexing.nf
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ workflow hash_demultiplexing{

Channel.fromPath(params.multi_input) \
| splitCsv(header:true) \
| map { row-> tuple(row.sampleId, row.hto_matrix_filtered, row.rna_matrix_filtered)}
| map { row-> tuple(row.sampleId, file(row.hto_matrix_filtered), file(row.rna_matrix_filtered))}
| set {input_list_summary}
summary(input_list_summary, demuxem_out, hashsolo_out, htodemux_out, multiseq_out, hashedDrops_out,demuxmix_out,bff_out,gmmDemux_out, params.generate_anndata, params.generate_mudata)

Expand Down

0 comments on commit 2e240ad

Please sign in to comment.