Skip to content

Commit

Permalink
include inputs when relabelling (geno and sample files are unchanged)
Browse files Browse the repository at this point in the history
  • Loading branch information
nebfield committed Apr 18, 2024
1 parent 6505818 commit 7649fff
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
14 changes: 8 additions & 6 deletions modules/local/plink2_relabelbim.nf
Expand Up @@ -21,9 +21,9 @@ process PLINK2_RELABELBIM {
tuple val(meta), path(geno), path(variants), path(pheno)

output:
tuple val(meta), path("${output}.bed"), emit: geno
tuple val(meta), path("${output}.bim.zst"), emit: variants
tuple val(meta), path("${output}.fam"), emit: pheno
tuple val(meta), path("${output}.bed", includeInputs: true), emit: geno
tuple val(meta), path("${output}.bim.zst", includeInputs: false), emit: variants
tuple val(meta), path("${output}.fam", includeInputs: true), emit: pheno
tuple val(meta), path("${output}.vmiss.gz"), emit: vmiss
path "versions.yml" , emit: versions

Expand Down Expand Up @@ -52,9 +52,11 @@ process PLINK2_RELABELBIM {
--make-just-bim zs \\
--out ${output}
# cross platform (mac, linux) method of preserving symlinks
cp -a $geno ${output}.bed
cp -a $pheno ${output}.fam
# -a: cross platform (mac, linux) method of preserving symlinks
# || true: if file exists, ignore error, will be handled by includeInputs
cp -a $geno ${output}.bed || true
cp -a $pheno ${output}.fam || true
gzip ${output}.vmiss
cat <<-END_VERSIONS > versions.yml
Expand Down
13 changes: 7 additions & 6 deletions modules/local/plink2_relabelpvar.nf
Expand Up @@ -21,9 +21,9 @@ process PLINK2_RELABELPVAR {
tuple val(meta), path(geno), path(pheno), path(variants)

output:
tuple val(meta), path("${output}.pgen"), emit: geno
tuple val(meta), path("${output}.pvar.zst") , emit: variants
tuple val(meta), path("${output}.psam"), emit: pheno
tuple val(meta), path("${output}.pgen", includeInputs: true), emit: geno
tuple val(meta), path("${output}.pvar.zst", includeInputs: false) , emit: variants
tuple val(meta), path("${output}.psam", includeInputs: true), emit: pheno
tuple val(meta), path("${output}.vmiss.gz"), emit: vmiss
path "versions.yml" , emit: versions

Expand Down Expand Up @@ -52,9 +52,10 @@ process PLINK2_RELABELPVAR {
--make-just-pvar zs \\
--out $output
# cross platform (mac, linux) method of preserving symlinks
cp -a $geno ${output}.pgen
cp -a $pheno ${output}.psam
# -a: cross platform (mac, linux) method of preserving symlinks
# || true: if file exists, ignore error, will be handled by includeInputs
cp -a $geno ${output}.pgen || true
cp -a $pheno ${output}.psam || true
gzip ${output}.vmiss
Expand Down

0 comments on commit 7649fff

Please sign in to comment.