Skip to content

Commit

Permalink
added different handling for single- and paired-end
Browse files Browse the repository at this point in the history
  • Loading branch information
riasc committed Mar 13, 2024
1 parent 3f7ba61 commit c5b8c89
Showing 1 changed file with 49 additions and 23 deletions.
72 changes: 49 additions & 23 deletions workflow/rules/quantification.smk
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,35 @@ rule countfeatures_dnaseq:
conda:
"../envs/subread.yml"
params:
mapq=f"""{config['mapq']}"""

mapq=f"""{config['mapq']}""",
readtype=f"""{config["data"]["dnaseq_readtype"]}"""
shell:
"""
featureCounts \
-F GTF \
-a {input.annotation_file} \
-t gene \
-g gene_id \
--fracOverlap 0.2 \
-Q {params.mapq} \
-T {threads} \
-o {output} {input.sample} > {log} 2>&1
if [ "{params.readtype}" == "PE" ]; then
featureCounts \
-p \
-F GTF \
-a {input.annotation_file} \
-t gene \
-g gene_id \
--fracOverlap 0.2 \
-Q {params.mapq} \
-T {threads} \
-o {output} {input.sample} > {log} 2>&1
elif [ "{params.readtype}" == "SE" ]; then
featureCounts \
-F GTF \
-a {input.annotation_file} \
-t gene \
-g gene_id \
--fracOverlap 0.2 \
-Q {params.mapq} \
-T {threads} \
-o {output} {input.sample} > {log} 2>&1
fi
"""


# TODO: add support for PE reads (BWA stores reads as single-end?)

rule countfeatures_rnaseq:
Expand All @@ -42,20 +56,32 @@ rule countfeatures_rnaseq:
conda:
"../envs/subread.yml"
params:
readtype=f"""{config["data"]["rnaseq_readtype"]}""",
mapq=f"""{config['mapq']}"""
mapq=f"""{config['mapq']}""",
readtype=f"""{config["data"]["rnaseq_readtype"]}"""
shell:
"""
featureCounts \
-p \
-F GTF \
-a {input.annotation_file} \
-t gene \
-g gene_id \
--fracOverlap 0.2 \
-Q {params.mapq} \
-T {threads} \
-o {output.table} {input.sample} > {log} 2>&1
if [ "{params.readtype}" == "PE" ]; then
featureCounts \
-p \
-F GTF \
-a {input.annotation_file} \
-t gene \
-g gene_id \
--fracOverlap 0.2 \
-Q {params.mapq} \
-T {threads} \
-o {output} {input.sample} > {log} 2>&1
elif [ "{params.readtype}" == "SE" ]; then
featureCounts \
-F GTF \
-a {input.annotation_file} \
-t gene \
-g gene_id \
--fracOverlap 0.2 \
-Q {params.mapq} \
-T {threads} \
-o {output} {input.sample} > {log} 2>&1
fi
"""

# merges the count tables from all samples into single table (calculates TPM)
Expand Down

0 comments on commit c5b8c89

Please sign in to comment.