Skip to content

Commit

Permalink
Allow VCF inputs with variable chromosome fields, but filter the vari…
Browse files Browse the repository at this point in the history
…ants to canonical or user-specified chromosomes.
  • Loading branch information
smlmbrt committed Sep 14, 2023
1 parent ba8e03c commit 25c8f4b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/local/plink2_vcf.nf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ process PLINK2_VCF {
def dosage_options = meta.vcf_import_dosage ? 'dosage=DS' : ''
// rewriting genotypes, so use --max-alleles instead of using generic ID
def set_ma_missing = params.keep_multiallelic ? '' : '--max-alleles 2'
def chrom_filter = meta.chrom == "ALL" ? "--chr 1-22, X, Y, XY" : "--chr ${meta.chrom}" // filter to canonical/stated chromosome
newmeta = meta.clone() // copy hashmap for updating...
newmeta.is_pfile = true // now it's converted to a pfile :)

Expand All @@ -45,6 +46,7 @@ process PLINK2_VCF {
--missing vcols=fmissdosage,fmiss \\
$args \\
--vcf $vcf $dosage_options \\
--allow-extra-chr $chrom_filter \\
--make-pgen vzs \\
--out ${params.target_build}_${prefix}${meta.chrom}
Expand Down

0 comments on commit 25c8f4b

Please sign in to comment.