Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated VCF output file renaming in kSNP3 task #207

Merged
merged 3 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions tasks/phylogenetic_inference/task_ksnp3.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ task ksnp3 {
-in ksnp3_input.tsv \
-outdir ksnp3 \
-k ~{kmer_size} \
-core -vcf \
-core \
-vcf \
~{'-SNPs_all ' + previous_ksnp3_snps} \
~{ksnp3_args}

Expand All @@ -71,7 +72,13 @@ task ksnp3 {
echo "The core SNP matrix could not be produced" | tee SKIP_SNP_DIST # otherwise, skip
fi

mv -v ksnp3/VCF.*.vcf ksnp3/~{cluster_name}_core.vcf
# capture sample name of genome used as reference
ls ksnp3/*.vcf | cut -d '.' -f 2 | tee KSNP3_VCF_REF_SAMPLENAME.txt

# rename the 2 vcf files by appending ~{cluster_name} and removing the ref genome name to make final filenames predictable
mv -v ksnp3/VCF.*.vcf ksnp3/~{cluster_name}_VCF.reference_genome.vcf
mv -v ksnp3/VCF.SNPsNotinRef.* ksnp3/~{cluster_name}_VCF_.SNPsNotinRef.tsv

mv -v ksnp3/SNPs_all_matrix.fasta ksnp3/~{cluster_name}_pan_SNPs_matrix.fasta
mv -v ksnp3/tree.parsimony.tre ksnp3/~{cluster_name}_pan_parsimony.nwk

Expand All @@ -84,9 +91,11 @@ task ksnp3 {

>>>
output {
File ksnp3_core_matrix = "ksnp3/${cluster_name}_core_SNPs_matrix.fasta"
File ksnp3_core_tree = "ksnp3/${cluster_name}_core.nwk"
File ksnp3_core_vcf = "ksnp3/${cluster_name}_core.vcf"
File ksnp3_core_matrix = "ksnp3/~{cluster_name}_core_SNPs_matrix.fasta"
File ksnp3_core_tree = "ksnp3/~{cluster_name}_core.nwk"
File ksnp3_vcf_ref_genome = "ksnp3/~{cluster_name}_VCF.reference_genome.vcf"
File ksnp3_vcf_snps_not_in_ref = "ksnp3/~{cluster_name}_VCF_.SNPsNotinRef.tsv"
String ksnp3_vcf_ref_samplename = read_string("KSNP3_VCF_REF_SAMPLENAME.txt")
File ksnp3_pan_matrix = "ksnp3/~{cluster_name}_pan_SNPs_matrix.fasta"
File ksnp3_pan_parsimony_tree = "ksnp3/~{cluster_name}_pan_parsimony.nwk"
File? ksnp3_ml_tree = "ksnp3/~{cluster_name}_ML.nwk"
Expand Down
4 changes: 3 additions & 1 deletion workflows/phylogenetics/wf_ksnp3.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ workflow ksnp3_workflow {
String ksnp3_docker = ksnp3_task.ksnp3_docker_image
# ksnp3_outputs
String ksnp3_snp_dists_version = pan_snp_dists.snp_dists_version
File ksnp3_core_vcf = ksnp3_task.ksnp3_core_vcf
File ksnp3_vcf_ref_genome = ksnp3_task.ksnp3_vcf_ref_genome
File ksnp3_vcf_snps_not_in_ref = ksnp3_task.ksnp3_vcf_snps_not_in_ref
String ksnp3_vcf_ref_samplename = ksnp3_task.ksnp3_vcf_ref_samplename
String ksnp3_core_snp_matrix_status = ksnp3_task.skip_core_snp_dists
File ksnp3_snps = ksnp3_task.ksnp3_snps_all
# ordered matrixes and reordered trees
Expand Down