Skip to content
Snippets Groups Projects
Commit 4af9f0b1 authored by Dominik Burri's avatar Dominik Burri
Browse files

ALFA (un)stranded works for chr21.bam #18

parent d59c4f5d
No related branches found
No related tags found
1 merge request!39Alfa qc
Pipeline #10067 passed
...@@ -149,27 +149,31 @@ rule generate_alfa_index: ...@@ -149,27 +149,31 @@ rule generate_alfa_index:
singularity: singularity:
"docker://zavolab/alfa:1.1.1" "docker://zavolab/alfa:1.1.1"
log: log:
"generate_alfa_index.log" "logs/generate_alfa_index.log"
shell: shell:
"alfa -a {input.gtf} \ "alfa -a {input.gtf} \
-g {params.genome_index} \ -g {params.genome_index} \
-p {threads} \ -p {threads} \
-o {params.out_dir} &> {log}" -o {params.out_dir} &> {log}"
# TODO: test with chr21.bam
# add singularity-args to this chr21.bam path
rule star_rpm_stranded: rule star_rpm_stranded:
''' Create stranded bedgraph coverage with STARs RPM normalisation ''' ''' Create stranded bedgraph coverage with STARs RPM normalisation '''
input: input:
"/scicore/home/zavolan/burri0000/test_alfa/sample/chr21.bam" bam = "/scicore/home/zavolan/burri0000/test_alfa/sample/chr21.bam"
output: output:
"/scicore/home/zavolan/burri0000/rnaseqpipeline/star_rpm/STAR_Signal.UniqueMultiple.str1.out.bg", str1 = ("/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_stranded/STAR_Signal.Unique.str1.out.bg",
"/scicore/home/zavolan/burri0000/rnaseqpipeline/star_rpm/STAR_Signal.UniqueMultiple.str2.out.bg" "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_stranded/STAR_Signal.UniqueMultiple.str1.out.bg"),
str2 = ("/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_stranded/STAR_Signal.UniqueMultiple.str2.out.bg",
"/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_stranded/STAR_Signal.UniqueMultiple.str2.out.bg")
params: params:
out_dir = "/scicore/home/zavolan/burri0000/rnaseqpipeline/star_rpm/", out_dir = "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_stranded/",
filenameprefix = "/scicore/home/zavolan/burri0000/rnaseqpipeline/star_rpm/STAR_" filenameprefix = "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_stranded/STAR_"
singularity: singularity:
"docker://zavolab/star:2.6.0a" "docker://zavolab/star:2.6.0a"
threads: 4 threads: 4
log: "logs/star_rpm.log" log: "logs/star_rpm_stranded.log"
shell: shell:
""" """
(mkdir -p {params.out_dir}; \ (mkdir -p {params.out_dir}; \
...@@ -177,31 +181,38 @@ rule star_rpm_stranded: ...@@ -177,31 +181,38 @@ rule star_rpm_stranded:
STAR \ STAR \
--runMode inputAlignmentsFromBAM \ --runMode inputAlignmentsFromBAM \
--runThreadN {threads} \ --runThreadN {threads} \
--inputBAMfile {input} \ --inputBAMfile {input.bam} \
--outWigType "bedGraph" \ --outWigType "bedGraph" \
--outWigStrand "Stranded" \ --outWigStrand "Stranded" \
--outWigNorm "RPM" \ --outWigNorm "RPM" \
--outFileNamePrefix {params.filenameprefix}) &> {log} --outFileNamePrefix {params.filenameprefix}) &> {log}
""" """
# TODO: test with chr21.bam
rule run_alfa_bg_stranded: rule run_alfa_bg_stranded:
''' Run ALFA from stranded bedgraph files ''' ''' Run ALFA from stranded bedgraph files '''
input: input:
str1 = "/scicore/home/zavolan/burri0000/rnaseqpipeline/star_rpm/STAR_Signal.UniqueMultiple.str1.out.bg", str1 = "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_stranded/STAR_Signal.UniqueMultiple.str1.out.bg",
str2 = "/scicore/home/zavolan/burri0000/rnaseqpipeline/star_rpm/STAR_Signal.UniqueMultiple.str2.out.bg" str2 = "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_stranded/STAR_Signal.UniqueMultiple.str2.out.bg"
output: output:
directory("output/") "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_stranded/ALFA_plots.Biotypes.pdf",
"/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_stranded/ALFA_plots.Categories.pdf"
params: params:
genome_index = "sorted_genes" out_dir = "alfa_stranded",
in_file_str1 = "STAR_Signal.UniqueMultiple.str1.out.bg",
in_file_str2 = "STAR_Signal.UniqueMultiple.str2.out.bg",
genome_index = "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_index/sorted_genes",
name_str1 = "test_chr21_str1",
name_str2 = "test_chr21_str2"
singularity:
"docker://zavolab/alfa:1.1.1"
log: "../logs/alfa_bg_stranded.log"
shell: shell:
""" """
cd {params.out_dir}; \
alfa -g {params.genome_index} \ alfa -g {params.genome_index} \
-bedgraph {input} \ --bedgraph {params.in_file_str1} {params.name_str1} {params.in_file_str2} {params.name_str2} \
-s forward; \ &> {log}
alfa -g {params.genome_index} \
-bedgraph {input} \
-s reverse \
-o {output}
""" """
rule star_rpm_unstranded: rule star_rpm_unstranded:
...@@ -209,14 +220,15 @@ rule star_rpm_unstranded: ...@@ -209,14 +220,15 @@ rule star_rpm_unstranded:
input: input:
bam = "/scicore/home/zavolan/burri0000/test_alfa/sample/chr21.bam" bam = "/scicore/home/zavolan/burri0000/test_alfa/sample/chr21.bam"
output: output:
"/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/star_rpm/STAR_Signal.UniqueMultiple.str1.out.bg" "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_unstranded/STAR_Signal.Unique.str1.out.bg",
"/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_unstranded/STAR_Signal.UniqueMultiple.str1.out.bg"
params: params:
out_dir = "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/star_rpm/", out_dir = "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_unstranded/",
filenameprefix = "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/star_rpm/STAR_" filenameprefix = "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_unstranded/STAR_"
singularity: singularity:
"docker://zavolab/star:2.6.0a" "docker://zavolab/star:2.6.0a"
threads: 4 threads: 4
log: "logs/star_rpm.log" log: "logs/star_rpm_unstranded.log"
shell: shell:
""" """
(mkdir -p {params.out_dir}; \ (mkdir -p {params.out_dir}; \
...@@ -234,12 +246,12 @@ rule star_rpm_unstranded: ...@@ -234,12 +246,12 @@ rule star_rpm_unstranded:
rule run_alfa_bg_unstranded: rule run_alfa_bg_unstranded:
''' Run ALFA from unstranded bedgraph files ''' ''' Run ALFA from unstranded bedgraph files '''
input: input:
"/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/star_rpm/STAR_Signal.UniqueMultiple.str1.out.bg" "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_unstranded/STAR_Signal.UniqueMultiple.str1.out.bg"
output: output:
"/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/star_rpm/ALFA_plots.Biotypes.pdf", "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_unstranded/ALFA_plots.Biotypes.pdf",
"/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/star_rpm/ALFA_plots.Categories.pdf" "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_unstranded/ALFA_plots.Categories.pdf"
params: params:
out_dir = "star_rpm", out_dir = "alfa_unstranded",
in_file = "STAR_Signal.UniqueMultiple.str1.out.bg", in_file = "STAR_Signal.UniqueMultiple.str1.out.bg",
genome_index = "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_index/sorted_genes", genome_index = "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_index/sorted_genes",
name = "test_chr21" name = "test_chr21"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment