Skip to content
Snippets Groups Projects
Commit 59cfb869 authored by seehagec01's avatar seehagec01
Browse files

sambam

parent 2b5d39eb
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@ rule map:
threads:4
conda:
"../envs/yourenv.yaml"
wrapper:
wrapper:
"v1.3.2/bio/bowtie2/align"
rule samtool:
rule fastq:
input:
"results/sam/{sample}.sam"
"results/bam/{sample}.bam"
output:
"results/unmapped/{sample}_unmapped.sam"
"results/unmapped_fastq/{sample}_1_unmapped.fastq",
"results/unmapped_fastq/{sample}_2_unmapped.fastq"
log:
"workflow/report/samtools/{sample}.log"
threads:4
conda:
"../envs/yourenv.yaml"
shell:
"samtools view --threads {threads} -f4 {input} > {output}"
rule converts:
input:
"results/unmapped/{sample}_unmapped.sam"
output:
"results/unmapped_converts/{sample}_1_unmapped.fastq",
"results/unmapped_converts/{sample}_2_unmapped.fastq"
log:
"workflow/report/converts/{sample}.log"
"workflow/report/fastq/{sample}.log"
threads:4
conda:
"../envs/yourenv.yaml"
shell:
"""
samtools view -S -b --threads={threads} {input} > {wildcards.sample}_unmapped.bam 2> {log}
samtools view --threads={threads} -b -f4 {input} > {wildcards.sample}_unmapped.bam 2> {log} #extract unmapped reads
samtools sort -n {wildcards.sample}_unmapped.bam -o {wildcards.sample}_sorted.bam 2>> {log}
bedtools bamtofastq -i {wildcards.sample}_sorted.bam -fq {output[0]} -fq2 {output[1]} 2>> {log}
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment