Skip to content

Commit

Permalink
Adding new rule to get transcript counts
Browse files Browse the repository at this point in the history
  • Loading branch information
skchronicles committed Jan 25, 2023
1 parent 7099bce commit dd49c54
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
4 changes: 4 additions & 0 deletions config/cluster.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,9 @@
"nanostat": {
"threads": "4",
"mem": "16g"
},
"nanocount": {
"threads": "2",
"mem": "16g"
}
}
1 change: 1 addition & 0 deletions config/config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"options": {
"nanocount_em_iter": "100"
}
}
9 changes: 8 additions & 1 deletion workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ rule all:
join(workpath, "{name}", "bams", "{name}.sorted.genome.metrics"),
name=samples
),
# NanoCount to quantify isoform counts
# @imported from `rule nanocount` in rules/quant.smk
expand(
join(workpath, "{name}", "counts", "{name}.nanocount.transcripts.tsv"),
name=samples
),
# MultiQC to aggregate results into a report
# @imported from `rule multiqc` in rules/qc.smk
join(workpath, "reports", "multiqc_report.html"),
Expand All @@ -130,4 +136,5 @@ include: join("rules", "common.smk")
include: join("rules", "download.smk")
include: join("rules", "trim.smk")
include: join("rules", "qc.smk")
include: join("rules", "map.smk")
include: join("rules", "map.smk")
include: join("rules", "quant.smk")
28 changes: 28 additions & 0 deletions workflow/rules/quant.smk
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Quantification rules
rule nanocount:
"""
Quality-control step to gather various statistics from a BAM file.
This tool is supported by MultiQC.
Github: https://github.com/a-slide/NanoCount
@Input:
Sorted Transcriptomic BAM file (scatter)
@Output:
NanoCount metrics file
"""
input:
bam = join(workpath, "{name}", "bams", "{name}.sorted.transcriptome.bam"),
output:
counts = join(workpath, "{name}", "counts", "{name}.nanocount.transcripts.tsv"),
params:
rname = "nanocount",
em_iter = config['options']['nanocount_em_iter'],
conda: depending(join(workpath, config['conda']['modr']), use_conda)
container: depending(config['images']['modr'], use_singularity)
threads: int(allocated("threads", "nanocount", cluster))
shell: """
NanoCount \\
-i {input.bam} \\
--extra_tx_info \\
-e {params.em_iter} \\
-o {output.counts}
"""

0 comments on commit dd49c54

Please sign in to comment.