Skip to content

Commit

Permalink
dynamic snp adding switch
Browse files Browse the repository at this point in the history
  • Loading branch information
Matiss Ozols committed Jan 19, 2024
1 parent f22c691 commit 1d465f8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
8 changes: 8 additions & 0 deletions bin/dynamic_donor_exclusive_snp_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,14 @@ def donor_exclusive_sites(exclusive_don_variants2):
help='cellsnp'
)

# parser.add_argument(
# '-dny', '--add_dynamic_sites_or_not_to_panel',
# action='store',
# dest='add_dynamic_sites_or_not_to_panel',
# required=True,
# help='cellsnp'
# )

options = parser.parse_args()
vcf = options.vcf
cellsnp = options.cellsnp
Expand Down
3 changes: 2 additions & 1 deletion conf/base.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ params{
profile='normal_run'
citeseq=false
estimate_and_provide_informative_snps_for_deconvolution=false

filter_outliers = true
//# These are default parameters that can be overwriten to run in a different mode.
//# Here we have listed the default parameters when running without any extrainput.
Expand All @@ -23,6 +23,7 @@ params{
provide_within_pool_donor_specific_sites_for_pilup=true
hard_filters_file = "no_file__file_sample_qc" //# This may point to the sample_qc.yml input which will apply hard filters to the merged cells.
hard_filters_drop = false //#This indicates whether we want to drop the cells that fail hard filters of just flag them
add_snps_to_pile_up_based_on_genotypes_provided = false // #whether we want to add informative snp to pile up in bam to enhance deconvolutions.
drop_cell_passes_qc_from_clustering = false //#This filter if set to true will drop the cells that dont pass the adaptive qc criteria before clustering.
encrypt = false
write_h5=false
Expand Down
9 changes: 8 additions & 1 deletion modules/nf-core/modules/cellsnp/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,24 @@ process DYNAMIC_DONOR_EXCLUSIVE_SNP_SELECTION{
mode: "${params.copy_mode}",
overwrite: "true"
input:
val(add_dynamic_sites_or_not_to_panel)
tuple val(samplename), path(vcf_file),path(csi),path(cellsnp_primary_file)
output:
tuple val(samplename), path("cellsnp_panel_${samplename}.vcf.gz"),emit:cellsnp_pool_panel
tuple val(samplename), path("set2_informative_sites_${samplename}.tsv"), path("set1_uninformative_sites_${samplename}.tsv"),path("variants_description.tsv"),emit:informative_uninformative_sites
script:
if (params.add_dynamic_sites_or_not_to_panel){
cmd1="ln -s ${vcf_file} dynamic_snps.vcf.gz"
}else{
cmd1="bcftools view -R ${cellsnp_primary_file} ${vcf_file} -Oz -o dynamic_snps.vcf.gz"
}

"""
echo ${samplename}
echo ${vcf_file}
echo ${cellsnp_primary_file}
#// bcftools view -i 'MAF > 0.0001 & R2>=1.00' -Oz -o dynamic_snps.vcf.gz ${vcf_file}
ln -s ${vcf_file} dynamic_snps.vcf.gz
${cmd1}
dynamic_donor_exclusive_snp_selection.py -cpus ${task.cpus} -vcf dynamic_snps.vcf.gz -cellsnp ${cellsnp_primary_file}
echo test > output.csv
bcftools view -h ${cellsnp_primary_file} > cellsnp_panel_${samplename}.vcf
Expand Down
3 changes: 2 additions & 1 deletion subworkflows/main_deconvolution.nf
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ workflow main_deconvolution {
// merged_expected_genotypes2.subscribe { println "merged_expected_genotypes2: $it" }
GT_MATCH_POOL_IBD(SUBSET_WORKF.out.samplename_subsetvcf_ibd,'Withing_expected','Expected')

DYNAMIC_DONOR_EXCLUSIVE_SNP_SELECTION(merged_expected_genotypes2)

DYNAMIC_DONOR_EXCLUSIVE_SNP_SELECTION(params.add_snps_to_pile_up_based_on_genotypes_provided,merged_expected_genotypes2)
cellsnp_panels = DYNAMIC_DONOR_EXCLUSIVE_SNP_SELECTION.out.cellsnp_pool_panel

informative_uninformative_sites = DYNAMIC_DONOR_EXCLUSIVE_SNP_SELECTION.out.informative_uninformative_sites
Expand Down

0 comments on commit 1d465f8

Please sign in to comment.