Skip to content

Commit

Permalink
simplify tronflow integration + add test for single reads sequencing
Browse files Browse the repository at this point in the history
  • Loading branch information
priesgo committed Jun 7, 2021
1 parent 7956df3 commit 3d4c434
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 19 deletions.
20 changes: 14 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,22 @@ clean:
test:
nextflow main.nf --help
nextflow main.nf -profile test,conda --name ERR4145453 \
--output `pwd`/output \
--output `pwd`/output/test1 \
--fastq1 `pwd`/test_data/ERR4145453_1.fastq.gz \
--fastq2 `pwd`/test_data/ERR4145453_2.fastq.gz
nextflow main.nf -profile test,conda --name ERR4145453 \
--output `pwd`/output/test2 \
--fastq1 `pwd`/test_data/ERR4145453_1.fastq.gz


check:
test -s output/ERR4145453.bam || { echo "Missing BAM output file!"; exit 1; }
test -s output/ERR4145453.preprocessed.bam || { echo "Missing BAM output file!"; exit 1; }
test -s output/ERR4145453.vcf || { echo "Missing BAM output file!"; exit 1; }
test -s output/ERR4145453.normalized.vcf || { echo "Missing BAM output file!"; exit 1; }
test -s output/ERR4145453.annotated.vcf || { echo "Missing BAM output file!"; exit 1; }
test -s output/test1/ERR4145453.bam || { echo "Missing test 1 BAM output file!"; exit 1; }
test -s output/test1/ERR4145453.preprocessed.bam || { echo "Missing test 1 BAM output file!"; exit 1; }
test -s output/test1/ERR4145453.vcf || { echo "Missing test 1 VCF output file!"; exit 1; }
test -s output/test1/ERR4145453.normalized.vcf || { echo "Missing test 1 VCF output file!"; exit 1; }
test -s output/test1/ERR4145453.annotated.vcf || { echo "Missing test 1 VCF output file!"; exit 1; }
test -s output/test2/ERR4145453.bam || { echo "Missing test 2 BAM output file!"; exit 1; }
test -s output/test2/ERR4145453.preprocessed.bam || { echo "Missing test 2 BAM output file!"; exit 1; }
test -s output/test2/ERR4145453.vcf || { echo "Missing test 2 VCF output file!"; exit 1; }
test -s output/test2/ERR4145453.normalized.vcf || { echo "Missing test 2 VCF output file!"; exit 1; }
test -s output/test2/ERR4145453.annotated.vcf || { echo "Missing test 2 VCF output file!"; exit 1; }
23 changes: 13 additions & 10 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ process alignment {
file "${name}.bam"

"""
echo "${name}\t${fastq1}\t${fastq2}" > bwa_input_files.txt
# --input_files needs to be forced, otherwise it is inherited from profile in tests
nextflow run tron-bioinformatics/tronflow-bwa -r ${params.tronflow_bwa_version} \
--input_files bwa_input_files.txt \
--input_name ${name} \
--input_fastq1 ${fastq1} \
--input_fastq2 ${fastq2} \
--input_files false \
--algorithm mem \
--library ${library} \
--output . \
Expand All @@ -90,13 +92,14 @@ process bamPreprocessing {
file "${name}.preprocessed.bai"

"""
echo "${name}\tnormal\t${bam}" > bam_preprocessing_input_files.txt
# --input_files, --known_indels1 and --known_indels2 needs to be forced, otherwise it is inherited from test profile
nextflow run tron-bioinformatics/tronflow-bam-preprocessing -r ${params.tronflow_bam_preprocessing_version} \
--input_files bam_preprocessing_input_files.txt \
--input_bam ${bam} \
--input_files false \
--output . \
--reference ${params.reference} \
--skip_bqsr --skip_realignment --skip_metrics \
--skip_bqsr --skip_metrics \
--known_indels1 false --known_indels2 false \
--prepare_bam_cpus ${params.cpus} --prepare_bam_memory ${params.memory} \
--mark_duplicates_cpus ${params.cpus} --mark_duplicates_memory ${params.memory} \
-profile ${workflow.profile} \
Expand Down Expand Up @@ -139,10 +142,10 @@ process variantNormalization {
file "${name}.normalized.vcf"

"""
echo "${name}\t${vcf}" > vcf_normalization_input_files.txt
# --input_files needs to be forced, otherwise it is inherited from profile in tests
nextflow run tron-bioinformatics/tronflow-variant-normalization -r ${params.tronflow_variant_normalization_version} \
--input_files vcf_normalization_input_files.txt \
--input_vcf ${vcf} \
--input_files false \
--output . \
--reference ${params.reference} \
-profile ${workflow.profile} \
Expand Down
6 changes: 3 additions & 3 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* -------------------------------------------------
*/

params.tronflow_bwa_version = "v1.2.0"
params.tronflow_bam_preprocessing_version = "v1.4.0"
params.tronflow_variant_normalization_version = "v1.0.1"
params.tronflow_bwa_version = "v1.3.0"
params.tronflow_bam_preprocessing_version = "v1.5.0"
params.tronflow_variant_normalization_version = "v1.1.0"

params.reference = "$baseDir/test_data/Sars_cov_2.ASM985889v3.dna.toplevel.fa"
params.gff = "$baseDir/test_data/Sars_cov_2.ASM985889v3.101.gff3"
Expand Down

0 comments on commit 3d4c434

Please sign in to comment.