Commit a0c6f6d1 authored by Midoux Cedric's avatar Midoux Cedric
Browse files

kaiju : small contigs + unmapped

parent 2e801311
rule select_small:
input:
"work/metaSPADES/{reads}/contigs.fasta"
output:
contigs = "work/addon/{reads}.small_contigs.fasta"
params:
min_len = config["CONTIGS_LEN"]
shell:
"conda activate seqkit-0.10.1 "
" ; "
"seqkit "
"seq "
"--max-len {params.min_len} "
"--out-file {output.contigs} "
"{input} "
" ; "
"conda deactivate"
rule kaiju_small:
input:
"work/addon/{sample}.small_contigs.fasta"
output:
"work/addon/{sample}.small_contigs.kaijuNR"
threads:
8
shell:
"kaiju "
"-t /db/outils/kaiju/nr/nodes.dmp "
"-f /db/outils/kaiju/nr/kaiju_db_nr_euk.fmi "
"-i {input} "
"-o {output} "
"-z {threads}"
rule select_unmapped:
input:
"work/bowtie/align-{sample}-{reads}.bam"
output:
bam = temp("work/addon/unmapped-{sample}-{reads}.bam"),
fastq = "work/addon/unmapped-{sample}-{reads}.fastq"
shell:
"samtools "
"view "
"-f 4 "
"-o {output.bam} "
"{input} "
" ; "
"bedtools "
"bamtofastq "
"-i {output.bam} "
"-fq {output.fastq} "
rule kaiju_unmapped:
input:
"work/addon/unmapped-{sample}-{reads}.fastq"
output:
"work/addon/{sample}-{reads}.unmapped.kaijuNR"
threads:
8
shell:
"kaiju "
"-t /db/outils/kaiju/nr/nodes.dmp "
"-f /db/outils/kaiju/nr/kaiju_db_nr_euk.fmi "
"-i {input} "
"-o {output} "
"-z {threads}"
rule kronaNames_addon:
input:
"work/addon/{sample}.{addon}.kaijuNR"
output:
"work/addon/{sample}.{addon}.taxNames.tsv"
shell:
"kaiju-addTaxonNames "
"-t /db/outils/kaiju/nr/nodes.dmp "
"-n /db/outils/kaiju/nr/names.dmp "
"-i {input} "
"-o {output} "
"-r superkingdom,phylum,order,class,family,genus,species"
......@@ -22,6 +22,9 @@ rule all:
expand("report/count-contigs-catalogue-{sample}.tsv", sample=config["SAMPLES"]),
"report/diamond_nr_catalogue.tsv",
"report/contigs_catalogue-taxNames.tsv",
#add-on
expand("work/addon/{sample}.small_contigs.taxNames.tsv", sample=config["SAMPLES"]),
#expand("work/addon/catalogue.{sample}.unmapped.taxNames.tsv", sample=config["SAMPLES"]),
include: "../workflow_metagenomics/quality.smk"
......@@ -31,3 +34,4 @@ include: "../workflow_metagenomics/assembly.smk"
include: "../workflow_metagenomics/annotation.smk"
include: "../workflow_metagenomics/count.smk"
include: "../workflow_metagenomics/catalogue.smk"
include: "../workflow_metagenomics/add-on.smk"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment