Skip to content
Snippets Groups Projects
Commit 2b1aaec6 authored by BIOPZ-Gypas Foivos's avatar BIOPZ-Gypas Foivos
Browse files

Addition of scripts that couts the number of reads in the CDS in the process data pipeline.

parent fe336e5b
No related branches found
No related tags found
No related merge requests found
snakemake/prepare_annotation/dag.png

24.1 KiB

configfile: "config.yaml" configfile: "config.yaml"
#from snakemake.utils import listfiles #from snakemake.utils import listfiles
localrules: create_output_and_log_directories, remove_multimappers, read_length_histogram, finish localrules: create_output_and_log_directories, remove_multimappers, read_length_histogram, count_reads, sfinish
################################################################################# #################################################################################
### Finish rule ### Finish rule
...@@ -9,7 +9,8 @@ localrules: create_output_and_log_directories, remove_multimappers, read_length_ ...@@ -9,7 +9,8 @@ localrules: create_output_and_log_directories, remove_multimappers, read_length_
rule finish: rule finish:
input: input:
sam = expand(os.path.join(config["output_dir"], "{sample}/read_length/read_length_histogram.pdf"), sample=config["sample"]) pdf = expand(os.path.join(config["output_dir"], "{sample}/read_length/read_length_histogram.pdf"), sample=config["sample"]),
counts = expand(os.path.join(config["output_dir"], "{sample}/counts.tsv"), sample=config["sample"])
################################################################################# #################################################################################
### Create output and log directories ### Create output and log directories
...@@ -246,3 +247,22 @@ rule read_length_histogram: ...@@ -246,3 +247,22 @@ rule read_length_histogram:
"(python scripts/plot_read_lengths.py \ "(python scripts/plot_read_lengths.py \
--sam {input.sam} \ --sam {input.sam} \
--outdir {params.dir}) & > {log}" --outdir {params.dir}) & > {log}"
################################################################################
### Count reads
################################################################################
rule count_reads:
input:
sam = os.path.join(config["output_dir"], "{sample}/transcripts.mapped.unique.sam"),
transcript_id_gene_id_CDS = config["transcript_id_gene_id_CDS"]
output:
counts = os.path.join(config["output_dir"], "{sample}/counts.tsv")
threads: 1
singularity:
"docker://perl:5.24-slim"
shell:
"(perl scripts/xp-count-reads-ribseq.pl \
{input.sam} \
{input.transcript_id_gene_id_CDS} \
> {output.counts})"
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
other_RNAs_index: "../prepare_annotation/results/other_RNAs_sequence.idx" other_RNAs_index: "../prepare_annotation/results/other_RNAs_sequence.idx"
transcripts_sequence: "../prepare_annotation/results/longest_pc_transcript_per_gene.fa" transcripts_sequence: "../prepare_annotation/results/longest_pc_transcript_per_gene.fa"
transcripts_index: "../prepare_annotation/results/longest_pc_transcript_per_gene.idx" transcripts_index: "../prepare_annotation/results/longest_pc_transcript_per_gene.idx"
transcript_id_gene_id_CDS: "../prepare_annotation/results/transcript_id_gene_id_CDS.tsv"
############################################################################## ##############################################################################
### Output and log directory ### Output and log directory
############################################################################## ##############################################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment