Skip to content

Commit

Permalink
Merge pull request #143 from BIMSBbioinfo/issue#140
Browse files Browse the repository at this point in the history
Fix for issue#140
  • Loading branch information
borauyar authored Apr 26, 2024
2 parents 741557c + 08b7604 commit bac3908
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions snakefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,21 @@ def lookup(column, predicate, fields=[]):
BIGWIG_OUTPUT = expand(os.path.join(BIGWIG_DIR, MAPPER, 'megadepth', '{sample}.all.bw'), sample = SAMPLES)
else:
sys.exit("Error with the selected coverage computation method: Allowed options for coverage computation are 'megadepth' or 'bamCoverage'; check the settings file option under coverage->tool.")

COLLATED_DESEQ_MAPPER_OUTPUT = []
COLLATED_SALMON_TRANSCR_OUTPUT = []
COLLATED_SALMON_GENES_OUTPUT = []

if DE_ANALYSIS_LIST:
repmap = expand(os.path.join(OUTPUT_DIR, "report", MAPPER, '{analysis}.deseq.report.html'), analysis = DE_ANALYSIS_LIST.keys())
reptra = expand(os.path.join(OUTPUT_DIR, "report", 'salmon', '{analysis}.salmon.transcripts.deseq.report.html'), analysis = DE_ANALYSIS_LIST.keys())
repgen = expand(os.path.join(OUTPUT_DIR, "report", 'salmon', '{analysis}.salmon.genes.deseq.report.html'), analysis = DE_ANALYSIS_LIST.keys())
colmap = [os.path.join(OUTPUT_DIR, "report", MAPPER, "collated.deseq_results.tsv")]
coltra = [os.path.join(OUTPUT_DIR, "report", 'salmon', "collated.transcripts.deseq_results.tsv")]
colgen = [os.path.join(OUTPUT_DIR, "report", 'salmon', "collated.genes.deseq_results.tsv")]
COLLATED_DESEQ_MAPPER_OUTPUT = repmap + colmap
COLLATED_SALMON_TRANSCR_OUTPUT = reptra + coltra
COLLATED_SALMON_GENES_OUTPUT = repgen + colgen

targets = {
# rule to print all rule descriptions
Expand All @@ -143,38 +158,31 @@ def lookup(column, predicate, fields=[]):
os.path.join(COUNTS_DIR, "normalized", "salmon", "TPM_counts_from_SALMON.genes.tsv"),
os.path.join(COUNTS_DIR, "raw_counts", MAPPER, "counts.tsv"),
os.path.join(COUNTS_DIR, "normalized", MAPPER, "deseq_normalized_counts.tsv"),
os.path.join(COUNTS_DIR, "normalized", MAPPER, "deseq_size_factors.txt"),
os.path.join(OUTPUT_DIR, "report", MAPPER, "collated.deseq_results.tsv"),
os.path.join(OUTPUT_DIR, "report", 'salmon', "collated.transcripts.deseq_results.tsv"),
os.path.join(OUTPUT_DIR, "report", 'salmon', "collated.genes.deseq_results.tsv")] +
os.path.join(COUNTS_DIR, "normalized", MAPPER, "deseq_size_factors.txt")] +
BIGWIG_OUTPUT +
expand(os.path.join(OUTPUT_DIR, "report", MAPPER, '{analysis}.deseq.report.html'), analysis = DE_ANALYSIS_LIST.keys()) +
expand(os.path.join(OUTPUT_DIR, "report", 'salmon', '{analysis}.salmon.transcripts.deseq.report.html'), analysis = DE_ANALYSIS_LIST.keys()) +
expand(os.path.join(OUTPUT_DIR, "report", 'salmon', '{analysis}.salmon.genes.deseq.report.html'), analysis = DE_ANALYSIS_LIST.keys())
COLLATED_DESEQ_MAPPER_OUTPUT +
COLLATED_SALMON_TRANSCR_OUTPUT +
COLLATED_SALMON_GENES_OUTPUT
},
'deseq_report_star': {
'description': "Produce one HTML report for each analysis based on STAR results.",
'files':
expand(os.path.join(OUTPUT_DIR, "report", 'star', '{analysis}.deseq.report.html'), analysis = DE_ANALYSIS_LIST.keys()) +
[os.path.join(OUTPUT_DIR, "report", 'star', "collated.deseq_results.tsv")]
COLLATED_DESEQ_MAPPER_OUTPUT
},
'deseq_report_hisat2': {
'description': "Produce one HTML report for each analysis based on Hisat2 results.",
'files':
expand(os.path.join(OUTPUT_DIR, "report", 'hisat2', '{analysis}.deseq.report.html'), analysis = DE_ANALYSIS_LIST.keys()) +
[os.path.join(OUTPUT_DIR, "report", 'hisat2', "collated.deseq_results.tsv")]
COLLATED_DESEQ_MAPPER_OUTPUT
},
'deseq_report_salmon_transcripts': {
'description': "Produce one HTML report for each analysis based on SALMON results at transcript level.",
'files':
expand(os.path.join(OUTPUT_DIR, "report", 'salmon', '{analysis}.salmon.transcripts.deseq.report.html'), analysis = DE_ANALYSIS_LIST.keys()) +
[os.path.join(OUTPUT_DIR, "report", 'salmon', "collated.transcripts.deseq_results.tsv")]
COLLATED_SALMON_TRANSCR_OUTPUT
},
'deseq_report_salmon_genes': {
'description': "Produce one HTML report for each analysis based on SALMON results at gene level.",
'files':
expand(os.path.join(OUTPUT_DIR, "report", "salmon", '{analysis}.salmon.genes.deseq.report.html'), analysis = DE_ANALYSIS_LIST.keys()) +
[os.path.join(OUTPUT_DIR, "report", 'salmon', "collated.genes.deseq_results.tsv")]
COLLATED_SALMON_GENES_OUTPUT
},
'star_map' : {
'description': "Produce a STAR mapping results in BAM file format.",
Expand Down

0 comments on commit bac3908

Please sign in to comment.