annotate customConfigManta.py @ 7:555971edd46e draft default tip

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 569d2234f8a576d5c4fdae120a32418c50436ac2
author artbio
date Tue, 20 Feb 2024 08:31:27 +0000
parents f55d45b0c6d1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
1 import argparse
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
2
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
3
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
4 def Parser():
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
5 the_parser = argparse.ArgumentParser()
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
6 the_parser.add_argument(
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
7 '--minCandidateVariantSize', type=int, default=8,
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
8 help="Run Manta reporting for all SVs/indels at or above this size")
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
9 the_parser.add_argument(
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
10 '--rnaMinCandidateVariantSize', type=int, default=1000,
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
11 help="Separate option (to provide different default) used for \
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
12 runs in RNA-mode")
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
13 the_parser.add_argument(
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
14 '--minEdgeObservations', type=int, default=3,
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
15 help="Remove all edges from the graph unless they're supported \
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
16 by this many 'observations'")
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
17 the_parser.add_argument(
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
18 '--graphNodeMaxEdgeCount', type=int, default=10,
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
19 help="If both nodes of an edge have an edge count higher than this, \
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
20 then skip evaluation of the edge")
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
21 the_parser.add_argument(
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
22 '--minCandidateSpanningCount', type=int, default=3,
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
23 help="Run discovery and candidate reporting for all SVs/indels with \
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
24 at least this many spanning support observations")
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
25 the_parser.add_argument(
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
26 '--minScoredVariantSize', type=int, default=50,
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
27 help="After candidate identification, only score and report \
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
28 SVs/indels at or above this size")
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
29 the_parser.add_argument(
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
30 '--minDiploidVariantScore', type=int, default=10,
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
31 help="minimum VCF QUAL score for a variant to be included in \
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
32 the diploid vcf")
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
33 the_parser.add_argument(
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
34 '--minPassDiploidVariantScore', type=int, default=20,
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
35 help="VCF QUAL score below which a variant is marked as \
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
36 filtered in the diploid vcf")
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
37 the_parser.add_argument(
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
38 '--minPassDiploidGTScore', type=int, default=15,
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
39 help="minimum genotype quality score below which single samples \
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
40 are filtered for a variant in the diploid vcf")
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
41 the_parser.add_argument(
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
42 '--minSomaticScore', type=int, default=10,
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
43 help="minimum VCF QUAL score for a variant to be included in the \
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
44 diploid vcf")
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
45 the_parser.add_argument(
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
46 '--minPassSomaticScore', type=int, default=30,
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
47 help="somatic quality scores below this level are filtered in the \
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
48 somatic vcf")
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
49 the_parser.add_argument(
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
50 '--enableRemoteReadRetrievalForInsertionsInGermlineCallingModes',
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
51 type=int, default=1,
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
52 help="includes tumor-normal subtraction and tumor-only calling")
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
53 the_parser.add_argument(
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
54 '--enableRemoteReadRetrievalForInsertionsInCancerCallingModes',
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
55 type=int, default=0,
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
56 help="GermlineCallingModes includes all other calling modes")
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
57 the_parser.add_argument(
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
58 '--useOverlapPairEvidence', type=int, default=0,
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
59 help="Set 1 if an overlapping read pair will be considered as \
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
60 evidence. Set to 0 to skip overlapping read pairs")
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
61 args = the_parser.parse_args()
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
62 return args
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
63
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
64
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
65 if __name__ == "__main__":
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
66 args = Parser()
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
67 # recover arguments as a dictionary with keys = argument name and values
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
68 # are argument values
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
69 argsDict = args.__dict__
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
70 ini_lines = []
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
71 # implement first, hard-coded ini lines
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
72 ini_lines.append('[manta]')
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
73 ini_lines.append('referenceFasta = /dummy/path/to/genome.fa')
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
74 # implement the rest of the ini lines for the argsDict
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
75 for argument in argsDict:
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
76 ini_lines.append("%s = %s" % (argument, str(argsDict[argument])))
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
77 # print ini_lines in configManta.py.ini
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
78 handler = open('configManta.py.ini', 'w')
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
79 for line in ini_lines:
f55d45b0c6d1 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/manta commit 86427647db100383faa432008b58e768b56ac416"
artbio
parents:
diff changeset
80 handler.write("%s\n" % line)