annotate fastp_json_to_tabular.py @ 0:091a2fb2e7ad draft default tip

"planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
author public-health-bioinformatics
date Thu, 10 Mar 2022 21:59:56 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
1 #!/usr/bin/env python
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
2
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
3 import argparse
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
4 import json
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
5
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
6 def main(args):
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
7 with open(args.fastp_json, 'r') as f:
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
8 fastp_report = json.load(f)
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
9
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
10 reads_single_paired = fastp_report['summary']['sequencing'].split(' ')[0]
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
11
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
12 if reads_single_paired == 'paired':
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
13 total_read_pairs_before_filtering = str(int(int(fastp_report['summary']['before_filtering']['total_reads']) / 2))
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
14 total_read_pairs_after_filtering = str(int(int(fastp_report['summary']['after_filtering']['total_reads']) / 2))
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
15 read2_mean_length_before_filtering = fastp_report['summary']['before_filtering']['read2_mean_length']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
16 read2_mean_length_after_filtering = fastp_report['summary']['after_filtering']['read2_mean_length']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
17 else:
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
18 total_read_pairs_before_filtering = 'NA'
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
19 total_read_pairs_after_filtering = 'NA'
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
20 read2_mean_length_before_filtering = 'NA'
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
21 read2_mean_length_after_filtering = 'NA'
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
22
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
23 total_reads_before_filtering = fastp_report['summary']['before_filtering']['total_reads']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
24 total_reads_after_filtering = fastp_report['summary']['after_filtering']['total_reads']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
25
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
26 total_bases_before_filtering = fastp_report['summary']['before_filtering']['total_bases']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
27 total_bases_after_filtering = fastp_report['summary']['after_filtering']['total_bases']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
28
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
29 read1_mean_length_before_filtering = fastp_report['summary']['before_filtering']['read1_mean_length']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
30 read1_mean_length_after_filtering = fastp_report['summary']['after_filtering']['read1_mean_length']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
31
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
32 q20_bases_before_filtering = fastp_report['summary']['before_filtering']['q20_bases']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
33 q20_bases_after_filtering = fastp_report['summary']['after_filtering']['q20_bases']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
34
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
35 q20_rate_before_filtering = fastp_report['summary']['before_filtering']['q20_rate']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
36 q20_rate_after_filtering = fastp_report['summary']['after_filtering']['q20_rate']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
37
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
38 q30_bases_before_filtering = fastp_report['summary']['before_filtering']['q30_bases']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
39 q30_bases_after_filtering = fastp_report['summary']['after_filtering']['q30_bases']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
40
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
41 q30_rate_before_filtering = fastp_report['summary']['before_filtering']['q30_rate']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
42 q30_rate_after_filtering = fastp_report['summary']['after_filtering']['q30_rate']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
43
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
44 gc_content_before_filtering = fastp_report['summary']['before_filtering']['gc_content']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
45 gc_content_after_filtering = fastp_report['summary']['after_filtering']['gc_content']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
46 if 'adapter_cutting' in fastp_report:
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
47 adapter_trimmed_reads = fastp_report['adapter_cutting']['adapter_trimmed_reads']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
48 adapter_trimmed_bases = fastp_report['adapter_cutting']['adapter_trimmed_bases']
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
49 else:
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
50 adapter_trimmed_reads = 0
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
51 adapter_trimmed_bases = 0
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
52
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
53 output_fields = [
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
54 'total_reads_before_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
55 'total_read_pairs_before_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
56 'total_reads_after_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
57 'total_read_pairs_after_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
58 'total_bases_before_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
59 'total_bases_after_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
60 'read1_mean_length_before_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
61 'read1_mean_length_after_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
62 'read2_mean_length_before_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
63 'read2_mean_length_after_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
64 'q20_bases_before_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
65 'q20_bases_after_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
66 'q20_rate_before_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
67 'q20_rate_after_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
68 'q30_bases_before_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
69 'q30_bases_after_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
70 'q30_rate_before_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
71 'q30_rate_after_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
72 'gc_content_before_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
73 'gc_content_after_filtering',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
74 'adapter_trimmed_reads',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
75 'adapter_trimmed_bases',
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
76 ]
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
77
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
78 output_data = []
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
79 if args.sample_id:
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
80 output_fields = ['sample_id'] + output_fields
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
81 output_data = [args.sample_id]
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
82
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
83 print(args.delimiter.join(output_fields))
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
84
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
85 output_data = output_data + [
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
86 total_reads_before_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
87 total_read_pairs_before_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
88 total_reads_after_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
89 total_read_pairs_after_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
90 total_bases_before_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
91 total_bases_after_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
92 read1_mean_length_before_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
93 read1_mean_length_after_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
94 read2_mean_length_before_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
95 read2_mean_length_after_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
96 q20_bases_before_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
97 q20_bases_after_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
98 q20_rate_before_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
99 q20_rate_after_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
100 q30_bases_before_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
101 q30_bases_after_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
102 q30_rate_before_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
103 q30_rate_after_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
104 gc_content_before_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
105 gc_content_after_filtering,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
106 adapter_trimmed_reads,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
107 adapter_trimmed_bases,
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
108 ]
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
109 print(args.delimiter.join(map(str, output_data)))
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
110
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
111
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
112 if __name__ == "__main__":
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
113 parser = argparse.ArgumentParser()
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
114 parser.add_argument('fastp_json')
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
115 parser.add_argument('-s', '--sample-id')
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
116 parser.add_argument('-d', '--delimiter', default='\t')
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
117 args = parser.parse_args()
091a2fb2e7ad "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/tree/master/tools/fastp_json_to_tabular commit 888d26702a84c2f8fd1428aff8cd869e94cc0bae"
public-health-bioinformatics
parents:
diff changeset
118 main(args)