diff --git a/bin/donor_match.R b/bin/donor_match.R index 0680d5f..99a68eb 100755 --- a/bin/donor_match.R +++ b/bin/donor_match.R @@ -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)] diff --git a/modules/gene_demultiplexing.nf b/modules/gene_demultiplexing.nf index dbf5c2a..938eba7 100644 --- a/modules/gene_demultiplexing.nf +++ b/modules/gene_demultiplexing.nf @@ -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"){ @@ -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 """ } @@ -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) diff --git a/modules/hash_demultiplexing.nf b/modules/hash_demultiplexing.nf index 9ae2a9e..ba215d4 100644 --- a/modules/hash_demultiplexing.nf +++ b/modules/hash_demultiplexing.nf @@ -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)