Newer
Older
#!/usr/bin/env python3
# -----------------------------------------------------------------------------
# Author : Maria Katsantoni, Maciek Bak
# Company: Mihaela Zavolan, Biozentrum, Basel
# This script is part of the Zavolan lab ZARP pipeline.
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
# 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)
subtitle = "RNA-Seq processing pipeline developed by Zavolan Lab"
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}"
- 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/*/*ALFA_feature_counts.tsv"
- "*/*/TIN/TIN_score.tsv"
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
- 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'
..."""
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)