From 5619c3c0cb04333cd820f62a215e60e900c54990 Mon Sep 17 00:00:00 2001 From: Katherine Eaton Date: Wed, 13 May 2020 15:19:27 -0400 Subject: [PATCH] remove rst lint --- .pre-commit-config.yaml | 7 ------- pipeline.nf | 36 ++++++++++++++++++++++++------------ 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ceab1d5b3..a193236e4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,10 +28,3 @@ repos: language: node types: [markdown] minimum_pre_commit_version: 0.15.0 - - - repo: https://github.com/Lucas-C/pre-commit-hooks-markup - rev: v1.0.0 - hooks: - - id: rst-linter - description: "rst-linter" - entry: "rst-linter" diff --git a/pipeline.nf b/pipeline.nf index 4bb9adbf3..d7241b9cc 100644 --- a/pipeline.nf +++ b/pipeline.nf @@ -353,16 +353,15 @@ if (!params.skip_reference_download){ reference_genome_gb_ftp (fasta.gz): The reference genome gbff accessed by url via FTP. Output: - ch_reference_genome_snippy_pairwise (fasta): The compressed reference genome for process snippy_pairwise. ch_reference_detect_repeats (fasta): The reference genome for process detect_repeats. ch_reference_genome_detect_low_complexity (fasta): The reference genome for process detect_low_complexity. - ch_reference_gb_snippy_pairwise (gb): The reference genome for process snippy_pairwise. - ch_reference_gb_snippy_multi (gb): The reference genome for process snippy_multi. - ch_reference_genome_snpeff_build_db (gb): The reference genome for process snpeff_build_db + ch_reference_gb_snippy_pairwise (gbff): The reference genome for process snippy_pairwise. + ch_reference_gb_snippy_multi (gbff): The reference genome for process snippy_multi. + ch_reference_genome_snpeff_build_db (gbff): The reference genome for process snpeff_build_db. Publish: reference_genome_fna_local (fasta): The locally downloaded reference fasta. - reference_genome_gb_local (fasta): The locally downloaded reference annotations. + reference_genome_gb_local (gbff): The locally downloaded reference annotations. */ // Other variables and config @@ -376,7 +375,7 @@ if (!params.skip_reference_download){ file reference_genome_gb_local from file(params.reference_genome_gb_ftp) output: - file "${reference_genome_fna_local.baseName}" into ch_reference_genome_snippy_pairwise, ch_reference_genome_detect_repeats, ch_reference_genome_low_complexity + file "${reference_genome_fna_local.baseName}" into ch_reference_genome_detect_repeats, ch_reference_genome_low_complexity file "${reference_genome_gb_local.baseName}" into ch_reference_gb_snippy_pairwise, ch_reference_gb_snippy_multi, ch_reference_genome_snpeff_build_db // Shell script to execute @@ -398,16 +397,17 @@ if (!params.skip_reference_download){ process snpeff_build_db{ /* - Build a SnpEff database for the reference genome annotations + Build a SnpEff database for the reference genome annotations. Input: - reference_genome_gb (gb): The reference genome gbff from process reference_download. + reference_genome_gb (gbff): The reference genome gbff from process reference_download. Output: - snpEff.config (text): Edited SnpEff configuration file for process snippy_pairwise. + ch_snpeff_config_snippy_pairwise (text): Edited SnpEff configuration file for process snippy_pairwise. Publish: snpEff.config (text): Edited SnpEff configuration file. + snpEffectPredictor.bin (gzip text): SnpEff database. */ // Other variables and config @@ -420,6 +420,7 @@ if (!params.skip_reference_download){ output: file "snpEff.config" into ch_snpeff_config_snippy_pairwise + file "data/${reference_genome_gb.baseName}/snpEffectPredictor.bin" // Shell script to execute script: @@ -428,18 +429,29 @@ if (!params.skip_reference_download){ ref=${reference_genome_gb.baseName} snpeffDir=~/miniconda3/envs/${params.conda_env}/share/snpeff-4.3.1t-3 snpeffData=\$snpeffDir/data; + # Create a new reference data directory mkdir -p \$snpeffData/\$ref; + # Move over the ref genome genbank annotations and rename cp ${outdir}/reference_genome/${reference_genome_gb} \$snpeffData/\$ref/genes.gbk; + # Add the new annotation entry to the snpeff config file configLine="${reference_genome_gb.baseName}.genome : ${reference_genome_gb.baseName}" + # Search for the genome entry in the snpEff config file if [[ -z `grep "\$configLine" \$snpeffDir/snpEff.config` ]]; then echo "\$configLine" >> \$snpeffDir/snpEff.config; fi; - # Copy over snpEff.config just to track it + + # Copy over snpEff.config to become an output channel + snpEff build -v -genbank ${reference_genome_gb.baseName} cp \$snpeffDir/snpEff.config `pwd` + + # Move SnpEff database to the correct path + mkdir -p data/ + mkdir -p data/${reference_genome_gb.baseName}/ + cp \$snpeffData/${reference_genome_gb.baseName}/snpEffectPredictor.bin data/${reference_genome_gb.baseName}/ """ } @@ -557,7 +569,7 @@ if(!params.skip_snippy_pairwise && !params.skip_assembly_download && (params.sql Input: ch_assembly_fna_snippy_pairwise (fasta): The genomic assembly from process assembly_download. - ch_reference_gb_snippy_pairwise (gb): The reference annotations from process reference_download. + ch_reference_gb_snippy_pairwise (gbff): The reference annotations from process reference_download. ch_snpeff_config_snippy_pairwise (text): Edited SnpEff configuration file from process snpeff_build_db. Output: @@ -622,7 +634,7 @@ if(!params.skip_snippy_pairwise && !params.skip_assembly_download && (params.sql # SnpEff csv Stats mv \$snippy_snps_csv \$snippy_snps_rename - snpEff -v -csvStats \$snippy_snps_csv ${params.snpeff_db} \$snippy_snps_filt + snpEff -c ${snpeff_config} -v -csvStats \$snippy_snps_csv ${reference_genome_gb.baseName} \$snippy_snps_filt """ }