Commit 576f63d8 authored by Molemaker, Maureen's avatar Molemaker, Maureen
Browse files

added docstring and index_bam rule, also added -e to the stringtie command

parent 50ec6ea4
#ftp.sra.ebi.ac.uk/vol1/run/ERR462/ERR4627(061)/201806(13.A-10R1)_R1.fastq.gz
#, "20180613.A-10R2"
SAMPLES = ["20180613.A-10R1", "20180613.A-10R2"]
"""
Author: Maureen Molemaker, studentnumber 1018248
Author: Liset Eendebak, studentnumber 1014355
script to map the fastq reads onto the reference genome
and to annotate the transcripts
Usage: snakemake -s mapping -c <no. of cores>
"""
SAMPLES = ["20180613.A-13R1", "20180613.A-13R2", "20180613.A-13R3",
"20180613.A-13R4","20180613.A-13R5","20180605.A-8R1", "20180605.A-8R2",
"20180605.A-8R3","20180605.A-8R4","20180605.A-8R5", "20180605.A-12R1",
"20180605.A-12R2","20180613.A-12R3","20180605.A-12R4","20180605.A-12R5",
"20180613.A-5R1","20180605.A-5R2", "20180613.A-5R3","20180605.A-5R4",
"20180605.A-5R5","20180613.A-6R1","20180605.A-6R2","20180605.A-6R3",
"20180613.A-6R4","20180605.A-6R5", "20180613.A-1R1", "20180605.A-1R2",
"20180613.A-1R3", "20180605.A-1R4", "20180605.A-1R5", "20180605.A-30R1",
"20180605.A-30R2","20180605.A-30R3", "20180605.A-30R4",
"20180605.A-30R5"]
rule all:
input:
expand("{sample}_hisat2.gtf", sample=SAMPLES)
expand("no_red_gtfs/{sample}_hisat2.gtf", sample=SAMPLES)
#leaf 288 R4_2 has a different name
rule mapping:
input:
reads = "../transcriptome/{sample}_R1.fastq.gz",
index = "../Arabidopsis_thaliana/TAIR.1.ht2",
output:
"{sample}_hisat2.sam",
temp("{sample}_hisat2.sam"),
params:
index="../Arabidopsis_thaliana/TAIR",
shell:
"hisat2 -p 1 -x {params.index} -U {input.reads} -S {output}"
rule sort_sam: # works for both bowtie2 and hisat2
input:
"{sample}_hisat2.sam"
output:
"{sample}_hisat2.bam"
"bamfiles/{sample}_hisat2.bam"
shell:
"samtools sort -o {output} {input}"
rule stringtie:
#This rule was used for validating the mapping in IGV
#rule index_bam: # works for both bowtie2 and hisat2
# input:
# "{sample}_hisat2.bam"
# output:
# "{sample}_hisat2.bam.bai"
# shell:
# "samtools index {input}"
rule gene_annotation:
input:
bamfile = "{sample}_hisat2.bam",
bamfile = "bamfiles/{sample}_hisat2.bam",
annotation = "../Arabidopsis_thaliana/genes.gtf",
output:
"{sample}_hisat2.gtf"
"no_red_gtfs/{sample}_hisat2.gtf"
params:
label="{sample}"
shell:
"stringtie -G {input.annotation} -o {output} -l {params.label} {input.bamfile}"
"stringtie -G {input.annotation} -e -o {output} -l {params.label} {input.bamfile}"
Supports Markdown
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