Skip to content

Commit

Permalink
Merge pull request #32 from theislab/docs
Browse files Browse the repository at this point in the history
Fix bug when no hto or rna matrix is provided for summary
  • Loading branch information
wxicu authored Nov 27, 2023
2 parents 1d4f0bc + e3c949c commit 94067fd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 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
3 changes: 1 addition & 2 deletions modules/gene_demulti/freemuxlet.nf
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ process freemuxlet {
mkdir freemuxlet_${sampleId}
mkdir freemuxlet_${sampleId}/plp
touch freemuxlet_${sampleId}/params.csv
barcode_num=\$(wc -l < "${group_list}")
echo -e "Argument,Value \n samfile,${sam} \n tag_group,${tag_group} \n tag_UMI,${tag_UMI} \n vcf_file,${vcf} \n sm,${sm} \n sm_list_file,${sm_list_file_name} \n sam_verbose,${sam_verbose} \n vcf_verbose,${vcf_verbose} \n skip_umi,${skip_umi} \n cap_BQ,${cap_BQ} \n min_BQ,${min_BQ} \n min_MQ,${min_MQ} \n min_TD,${min_TD} \n excl_flag,${excl_flag} \n grouplist,${grouplist.name}_\${barcode_num} \n min_total,${min_total} \n min_uniq,${min_uniq} \n min_umi,${min_umi} \n min_snp,${min_snp} \n init_cluster,${init_cluster} \n nsample,${nsample} \n aux_files,${aux_files} \n verbose,${verbose} \n doublet_prior,${doublet_prior} \n bf_thres,${bf_thres} \n frac_init_clust,${frac_init_clust} \n iter_init,${iter_init} \n keep_init_missing,${keep_init_missing}" >> freemuxlet_${sampleId}/params.csv
echo -e "Argument,Value \n samfile,${sam} \n tag_group,${tag_group} \n tag_UMI,${tag_UMI} \n vcf_file,${vcf} \n sm,${sm} \n sm_list_file,${sm_list_file_name} \n sam_verbose,${sam_verbose} \n vcf_verbose,${vcf_verbose} \n skip_umi,${skip_umi} \n cap_BQ,${cap_BQ} \n min_BQ,${min_BQ} \n min_MQ,${min_MQ} \n min_TD,${min_TD} \n excl_flag,${excl_flag} \n grouplist,${group_list} \n min_total,${min_total} \n min_uniq,${min_uniq} \n min_umi,${min_umi} \n min_snp,${min_snp} \n init_cluster,${init_cluster} \n nsample,${nsample} \n aux_files,${aux_files} \n verbose,${verbose} \n doublet_prior,${doublet_prior} \n bf_thres,${bf_thres} \n frac_init_clust,${frac_init_clust} \n iter_init,${iter_init} \n keep_init_missing,${keep_init_missing}" >> freemuxlet_${sampleId}/params.csv
popscle dsc-pileup $samfile ${taggroup} ${tagUMI} $vcffile ${smlist} ${sm_list_file} ${samverbose} ${vcfverbose} \
${skipumi} ${capBQ} ${minBQ} ${minMQ} ${minTD} ${exclflag} ${grouplist} ${mintotal} ${minuniq} ${minsnp} \
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 94067fd

Please sign in to comment.