diff --git a/snakemake/Snakefile b/snakemake/Snakefile index 84f043be83ec0654dcaea9725c3dea446eab7c3c..e9eee45e1e7030d43f6a01083459fa43a31da2d1 100644 --- a/snakemake/Snakefile +++ b/snakemake/Snakefile @@ -204,16 +204,52 @@ rule run_alfa_bg_stranded: -o {output} """ +rule star_rpm_unstranded: + ''' Create unstranded bedgraph coverage with STARs RPM normalisation ''' + input: + bam = "/scicore/home/zavolan/burri0000/test_alfa/sample/chr21.bam" + output: + "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/star_rpm/STAR_Signal.UniqueMultiple.str1.out.bg" + params: + out_dir = "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/star_rpm/", + filenameprefix = "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/star_rpm/STAR_" + singularity: + "docker://zavolab/star:2.6.0a" + threads: 4 + log: "logs/star_rpm.log" + shell: + """ + (mkdir -p {params.out_dir}; \ + chmod -R 777 {params.out_dir}; \ + STAR \ + --runMode inputAlignmentsFromBAM \ + --runThreadN {threads} \ + --inputBAMfile {input.bam} \ + --outWigType "bedGraph" \ + --outWigStrand "Unstranded" \ + --outWigNorm "RPM" \ + --outFileNamePrefix {params.filenameprefix}) &> {log} + """ + rule run_alfa_bg_unstranded: ''' Run ALFA from unstranded bedgraph files ''' input: - "/scicore/home/zavolan/burri0000/test_alfa/sample/star_rpm/STAR_Signal.UniqueMultiple.str1.out.bg", - "/scicore/home/zavolan/burri0000/test_alfa/sample/star_rpm/STAR_Signal.UniqueMultiple.str2.out.bg" + "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/star_rpm/STAR_Signal.UniqueMultiple.str1.out.bg" output: + "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/star_rpm/ALFA_plots.Biotypes.pdf", + "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/star_rpm/ALFA_plots.Categories.pdf" params: - genome_index = "sorted_genes" + out_dir = "star_rpm", + in_file = "STAR_Signal.UniqueMultiple.str1.out.bg", + genome_index = "/scicore/home/zavolan/burri0000/rnaseqpipeline/snakemake/alfa_index/sorted_genes", + name = "test_chr21" + singularity: + "docker://zavolab/alfa:1.1.1" + log: "../logs/alfa_bg_unstranded.log" shell: """ + cd {params.out_dir}; \ alfa -g {params.genome_index} \ - -bedgraph {input} \ + --bedgraph {params.in_file} {params.name} \ + &> {log} """ \ No newline at end of file