Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#!/usr/bin/env python3
# -----------------------------------------------------------------------------
# Author : Maria Katsantoni, Maciek Bak
# Company: Mihaela Zavolan, Biozentrum, Basel
# This script is part of the Zavolan lab Rhea pipeline.
# In this script the config file used by multiqc
# (https://multiqc.info) is created.
# -----------------------------------------------------------------------------
import sys
from argparse import ArgumentParser, RawTextHelpFormatter
import os
def main():
""" Create config file for multiqc"""
__doc__ = "Create config file for multiqc"
parser = ArgumentParser(description=__doc__,
formatter_class=RawTextHelpFormatter)
parser.add_argument("--config",
help="Output file destination for config",
required=True,
metavar="FILE",)
parser.add_argument("--intro-text",
dest="intro_text",
help="short description at the top of report",
metavar="STR")
parser.add_argument("--custom-logo",
dest="custom_logo",
default='None',
help="Logo path",
metavar="FILE")
parser.add_argument("--url",
help="Url of the lab",
metavar="STR")
parser.add_argument("--author-name",
dest="author_name",
default='None',
help="Name of person running this analysis",
metavar="STR")
parser.add_argument("--author-email",
dest="author_email",
default='None',
help="email of person running this analysis",
metavar="STR")
try:
options = parser.parse_args()
except(Exception):
parser.print_help()
if len(sys.argv) == 1:
parser.print_help()
sys.exit(1)
title = "Rhea"
subtitle = "RNA-Seq processing pipeline developed by Zavolan Lab"
logo_title = 'Rhea'
project_type = "Snakemake workflow"
analysis_type = "RNA-seq"
intro_text = options.intro_text
custom_logo = options.custom_logo
url = options.url
author_name = options.author_name
author_email = options.author_email
config_string = f"""---
title: "{title}"
subtitle: "{subtitle}"
intro_text: "{intro_text}"
custom_logo: "{custom_logo}"
custom_logo_url: "{url}"
custom_logo_title: "{logo_title}"
report_header_info:
- Project Type: "{project_type}"
- Analysis Type: "{analysis_type}"
- Analysis Author: "{author_name}"
- Contact E-mail: "{author_email}"
top_modules:
- fastqc:
path_filters:
- "*/*/fastqc/*/*"
- cutadapt:
name: "Cutadapt: adapter removal"
path_filters:
- "*/*/remove_adapters_cutadapt*.stdout.log"
- cutadapt:
name: "Cutadapt: polyA tails removal"
path_filters:
- "*/*/remove_polya_cutadapt*.stdout.log"
- star:
path_filters:
- "*/*/map_genome/*"
- alfa:
name: "ALFA"
anchor: "ALFA"
path_filters:
- "*/ALFA_plots.concat_mqc.png"
- TIN_scores:
name: "TIN_scores"
anchor: "TIN_scores"
path_filters:
- "*/TIN_scores_boxplot_mqc.png"
- salmon:
path_filters:
- "*/*/*.salmon.*/*"
- kallisto:
path_filters:
- "*/*/genome_quantification_kallisto*.stderr.log"
fn_clean_exts:
- '.fq1'
- '.gz'
- '.stdout'
- '.log'
- '.stderr'
- '.fastq'
- '.bam'
- '.bai'
- '.pe'
- '.se'
- '.pseudo'
- '.salmon'
- '.sam'
- 'mqc'
- '.png'
..."""
with open(options.config, "w") as config:
config.write(config_string)
return
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
sys.stderr.write("User interrupt!")
sys.exit(1)