Skip to content

Commit

Permalink
account for chr prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
maxozo committed Oct 10, 2023
1 parent d2db5da commit 7c96d19
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/nf-core/modules/genotypes/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,15 @@ process GT_MATCH_POOL_AGAINST_PANEL
panel_filnam = "${ref_gt_vcf}" - (~/\.[bv]cf(\.gz)?$/)
gt_check_output_txt = "${pool_id}_gtcheck_${panel_filnam}.txt"
"""
STR=\$(bcftools index -s ${ref_gt_vcf} | cut -f1 | head -n1)
SUB='chr'
if [[ "\$STR" == *"\$SUB"* ]]; then
echo -e "1 chr1\\n2 chr2\\n3 chr3\\n4 chr4\\n5 chr5\\n6 chr6\\n7 chr7\\n8 chr8\\n9 chr9\\n10 chr10\\n11 chr11\\n12 chr12\\n13 chr13\\n14 chr14\\n15 chr15\\n16 chr16\\n17 chr17\\n18 chr18\\n19 chr19\\n20 chr20\\n21 chr21\\n22 chr22\\n23 chr23" >> chr_name2_conv.txt
bcftools annotate --rename-chrs chr_name2_conv.txt ${vireo_gt_vcf} -Oz -o renamed.vcf.gz
else
ls -s ${vireo_gt_vcf} renamed.vcf.gz
fi
bcftools gtcheck --no-HWE-prob -g ${ref_gt_vcf} ${vireo_gt_vcf} > ${gt_check_output_txt}
"""
}
Expand Down
1 change: 1 addition & 0 deletions modules/nf-core/modules/subset_genotype/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ workflow SUBSET_WORKF{
// all_GT_pannels_and_pools.subscribe {println "all_GT_pannels_and_pools:= ${it}\n"}
// If nothing is provided then there are no genotypes emmited, hence nothing is passed down to the chromosome merge.
combined_pool_subset.groupTuple(by: 0).set{grouped_chrs_poolComps}
grouped_chrs_poolComps.subscribe {println "grouped_chrs_poolComps:= ${it}\n"}
if (!params.genotype_input.subset_vireo_genotypes && mode=='AllExpectedGT'){
// Here we have joned the shards of the same cohort together without subsetting down to the individuals since we want to use all the genotypes as an input file in the vcf.
// While this will work, if the same cohort is used multiple times its better to provide already merged genotype, to avoid all the shard processing every time.
Expand Down

0 comments on commit 7c96d19

Please sign in to comment.