From f2dfbb2b312d56901acb95f4dbba5584a4311096 Mon Sep 17 00:00:00 2001 From: Helene Rimbert <helene.rimbert@inra.fr> Date: Wed, 18 Nov 2020 15:09:51 +0100 Subject: [PATCH] reorder query annotation related rules from main Snakefile to rules/preprocessGenomes.smk --- Snakefile | 30 +++++++----------------------- rules/preprocessGenomes.smk | 24 +++++++++++++++++++++++- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/Snakefile b/Snakefile index 9d727b7..5e0fc99 100644 --- a/Snakefile +++ b/Snakefile @@ -15,35 +15,19 @@ rule all: config['finalPrefix']+'_LC.proteins.fasta', config['finalPrefix']+'_gmap_differentChrom.gff3', config['finalPrefix']+'_anchoringSummary.csv', - config['finalPrefix']+'_blatSummary.csv' + config['finalPrefix']+'_blatSummary.csv', + 'report/dag.png', + 'report/rulegraph.png' -rule grepGffFeature: - message: " Collect selected features from GFF file" - input: config['annotationQuery'] - params: config['featureType'] - output: temp(config['results']+"/1.features.bed") - log: config['results']+"/1.grepGffFeature.log" - shell: - """ - bin/gff2bed.sh {params} {input} 1> {output} 2> {log} - """ -rule splitGffPerChrom: - message: "Split Gff Features per chromosome: current is {wildcards.chrom}" - input: config['results']+"/1.features.bed" - output: temp(config['results']+"/1.features/{chrom}.bed") - log: config['results']+"/1.features/{chrom}.fgrep.log" - params: "chr{chrom}" - shell: - """ - fgrep {params} {input} 1> {output} 2> {log} - """ rule createDiagrams: message: "Create dag and rulegraph of the pipeline" + output: dag='report/dag.png', rulegraphe='report/rulegraph.png' shell: """ - snakemake --dag |dot -T png > report/dag.png - snakemake --rulegraph |dot -T png > report/rulegraph.png + snakemake --dag |dot -T png > {output.dag} + snakemake --rulegraph |dot -T png > {output.rulegraph} """ + include: "rules/preprocessISBP.smk" include: "rules/preprocessGenomes.smk" include: "rules/bedtoolsClosest.smk" diff --git a/rules/preprocessGenomes.smk b/rules/preprocessGenomes.smk index b138847..5c67eec 100644 --- a/rules/preprocessGenomes.smk +++ b/rules/preprocessGenomes.smk @@ -1,3 +1,25 @@ +rule grepGffFeature: + message: " Collect selected features from GFF file" + input: config['annotationQuery'] + params: config['featureType'] + output: temp(config['results']+"/1.features.bed") + log: config['results']+"/1.grepGffFeature.log" + shell: + """ + bin/gff2bed.sh {params} {input} 1> {output} 2> {log} + """ + +rule splitGffPerChrom: + message: "Split Gff Features per chromosome: current is {wildcards.chrom}" + input: config['results']+"/1.features.bed" + output: temp(config['results']+"/1.features/{chrom}.bed") + log: config['results']+"/1.features/{chrom}.fgrep.log" + params: "chr{chrom}" + shell: + """ + fgrep {params} {input} 1> {output} 2> {log} + """ + rule indexQuery: message: " Indexing Query fasta file using samtools faidx" input: config['queryFasta'] @@ -16,4 +38,4 @@ rule gmapIndexTarget: output: directory(config['results']+"/target_gmapindex") params: indexname="target_gmapindex", indexPath=config['results'] log: config['results']+"/target_gmapindex.log" - shell: "gmap_build -D {params.indexPath} -d {params.indexname} {input} &> {log}" \ No newline at end of file + shell: "gmap_build -D {params.indexPath} -d {params.indexname} {input} &> {log}" -- GitLab