Skip to content

Commit ed710c1

Browse files
committed
added PSC1 and PPC2. adjusted PMC1 category. adjusted PS1 and BSC1 scores. fixed VEP defaults. fixed frequency options.
1 parent 861f5f1 commit ed710c1

File tree

4 files changed

+120
-92
lines changed

4 files changed

+120
-92
lines changed

bin/charger

Lines changed: 50 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
#!/bin/python
22
# CharGer - Characterization of Germline variants
33
# author: Adam D Scott ([email protected]) & Kuan-lin Huang ([email protected])
4-
# version: v0.2.1 - 2017*05
4+
# version: v0.3.0 - 2017*09
55

66
import sys
77
import getopt
88
from charger import charger
99
import time
10+
import argparse
1011

1112
def parseArgs( argv ):
12-
helpText = "\nCharGer - v0.2.1\n\n"
13+
helpText = "\nCharGer - v0.3.0\n\n"
1314
helpText += "Usage: "
1415
helpText += "charger <input file> [options]\n\n"
1516
helpText += "Accepted input data files:\n"
@@ -38,7 +39,10 @@ def parseArgs( argv ):
3839
helpText += " -a assumed de novo file, standard .maf\n"
3940
helpText += " -c co-segregation file, standard .maf\n"
4041
helpText += " -H HotSpot3D clusters file, .clusters\n"
41-
helpText += " -r recurrence threshold (default = 2)\n"
42+
helpText += "Thresholds:\n"
43+
helpText += " --recurrence-threshold HotSpot3D recurrence threshold (default = 2)\n"
44+
helpText += " --rare-threshold Allele frequency threshold for rare (default = 0.0005 (0.05%)):\n"
45+
helpText += " --common-threshold Allele frequency threshold for common (default = 0.005 (0.5%)):\n"
4246
helpText += "Local VEP (works with .vcf input only; suppresses ReST too):\n"
4347
helpText += " --vep-script Path to VEP\n"
4448
helpText += " --vep-config config-file for VEP\n"
@@ -57,9 +61,9 @@ def parseArgs( argv ):
5761
helpText += " --mac-clinvar-tsv ClinVar from MacArthur lab (clinvar_alleles.tsv.gz)\n"
5862
#helpText += " --mac-clinvar-vcf ClinVar from MacArthur lab (clinvar_alleles.vcf.gz)\n"
5963
helpText += "Filters:\n"
60-
helpText += " --rare Allele frequency threshold for rare/common (default = 1, process variant with any frequency):\n"
61-
helpText += " --vcf-any-filter Allow variants that do not pass all filters in .vcf input (flag)\n"
62-
helpText += " --mutation-types Comma delimited list (no spaces) of types to allow\n"
64+
helpText += " --frequency-filter Keep if allele frequency lower (default = 1, process variant with any frequency):\n"
65+
helpText += " --vcf-any-filter Keep variants that do not pass all filters in .vcf input (flag)\n"
66+
helpText += " --mutation-types Keep types, as a comma delimited list (no spaces)\n"
6367
helpText += "ReST batch sizes:\n"
6468
helpText += " -v VEP (#variants, default/max allowed = 150)\n"
6569
helpText += " -b ClinVar summary (#variants, default/max allowed = 500)\n"
@@ -76,7 +80,6 @@ def parseArgs( argv ):
7680
helpText += " -C codon\n"
7781
helpText += " -p peptide change\n"
7882
helpText += " -L variant classification\n"
79-
helpText += " -F allele frequency\n"
8083
helpText += "\n"
8184
helpText += " -h this message\n"
8285
helpText += "\n"
@@ -117,35 +120,38 @@ def parseArgs( argv ):
117120
clustersFile = None
118121
pathogenicVariantsFile = None
119122
annotateInput = ""
120-
vepScript = ""
121-
vepConfig = ""
122-
#vepDir = None
123+
vepScript = None
124+
vepConfig = None
123125
vepCache = None
124126
vepOutput = None
125-
ensemblRelease = ""
126-
vepVersion = ""
127-
grch = ""
128-
fork = ""
127+
ensemblRelease = str( 75 )
128+
vepVersion = str( 87 )
129+
grch = str( 37 )
130+
fork = str( 1 )
129131
referenceFasta = None
130132
exacVCF = None
131133
macClinVarVCF = None
132134
macClinVarTSV = None
133135
doURLTest = True
134-
thresholdAF = 1
136+
rareAF = 0.0005 #from germline studies
137+
commonAF = 0.05 #from ACMG suggestion
138+
keepAF = 1
135139
anyFilter = False
136140
mutationTypes = []
137141

138142
try:
139143
#haven't used ijquy
140-
charCommands = "DEtlxhwOkX:s:A:R:S:P:M:G:m:f:T:o:v:b:B:p:C:F:g:d:e:n:a:c:r:H:z:L:"
144+
charCommands = "DEtlxhwOkX:s:A:R:S:P:M:G:m:f:T:o:v:b:B:p:C:g:d:e:n:a:c:H:z:L:"
141145
opts, args = getopt.getopt( argv , charCommands , \
142146
["maf=" , "vcf=" , "tsv=" , "output=" , "use-tcga" , \
143147
"run-vep" , "run-clinvar" , "run-exac" , \
144148
"vepBatchSize=" , "summaryBatchSize=" , "searchBatchSize=" , \
145149
"peptideChange=" , "codon=" , "alleleFrequency=" , \
146150
"geneList=" , "diseases=" , "expression=" , \
147151
"deNovo=" , "assumedDeNovo=" , "coSegregation=" , \
148-
"recurrence=" , "rare=" , "vcf-any-filter" , "mutation-types=" , \
152+
"rare-threshold=" , "common-threshold=" , \
153+
"recurrence-threshold=" , "frequency-filter=" , \
154+
"vcf-any-filter" , "mutation-types=" , \
149155
"hotspot3d=" , "pathogenicVariants=" , \
150156
"vep-script=" , "vep-config=", "vep-dir=" , "vep-cache=" , "vep-output=" , \
151157
"ensembl-release=" , "vep-version=" , \
@@ -233,10 +239,14 @@ def parseArgs( argv ):
233239
asHTML = True
234240
elif opt in ( "-O" , "--override" ):
235241
override = True
236-
elif opt in ( "-r" , "--recurrence" ):
242+
elif opt in ( "-r" , "--recurrence-threshold" ):
237243
recurrenceThreshold = float( arg )
238-
elif opt in ( "--rare" ):
239-
thresholdAF = float( arg )
244+
elif opt in ( "--rare-threshold" ):
245+
rareAF = float( arg )
246+
elif opt in ( "--common-threshold" ):
247+
commonAF = float( arg )
248+
elif opt in ( "--frequency-filter" ):
249+
keepAF = float( arg )
240250
elif opt in ( "--mutation-types" ):
241251
mutationTypes = arg.split( "," )
242252
elif opt in ( "--vcf-any-filter" ):
@@ -315,7 +325,9 @@ def parseArgs( argv ):
315325
"variantClassificationColumn" : variantClassificationColumn, \
316326
"alleleFrequencyColumn" : alleleFrequencyColumn, \
317327
"recurrenceThreshold" : recurrenceThreshold , \
318-
"thresholdAF" : thresholdAF , \
328+
"rareAF" : rareAF , \
329+
"commonAF" : commonAF , \
330+
"keepAF" : keepAF , \
319331
"anyFilter" : anyFilter , \
320332
"mutationTypes" : mutationTypes , \
321333
"clustersFile" : clustersFile , \
@@ -378,7 +390,9 @@ def main( argv ):
378390
asHTML = values["html"]
379391
override = values["override"]
380392
recurrenceThreshold = values["recurrenceThreshold"]
381-
thresholdAF = values["thresholdAF"]
393+
rareAF = values["rareAF"]
394+
commonAF = values["commonAF"]
395+
keepAF = values["keepAF"]
382396
anyFilter = values["anyFilter"]
383397
mutationTypes = values["mutationTypes"]
384398
clustersFile = values["clustersFile"]
@@ -452,7 +466,9 @@ def main( argv ):
452466
peptideChange=peptideChangeColumn , \
453467
variantClassification=variantClassificationColumn , \
454468
alleleFrequency=alleleFrequencyColumn , \
455-
thresholdAF = thresholdAF , \
469+
rareAF = rareAF , \
470+
commonAF = commonAF , \
471+
keepAF = keepAF , \
456472
anyFilter = anyFilter , \
457473
mutationTypes = mutationTypes , \
458474
)
@@ -495,16 +511,16 @@ def main( argv ):
495511
exacVCF=exacVCF , \
496512
macClinVarTSV=macClinVarTSV , \
497513
macClinVarVCF=macClinVarVCF , \
498-
thresholdAF = thresholdAF , \
514+
rareAF = rareAF , \
515+
commonAF = commonAF , \
516+
keepAF = keepAF , \
499517
anyFilter = anyFilter , \
500518
mutationTypes = mutationTypes , \
501519
#timeout=(20,20) , \
502520
)
503521

504522
t3 = time.time()
505523

506-
rareThreshold = 0.0005 #from germline studies
507-
commonThreshold = 0.05 #from ACMG suggestion
508524
minimumEvidence = 2
509525

510526
CharGer.PVS1( )
@@ -513,7 +529,7 @@ def main( argv ):
513529
CharGer.PS3( )
514530
CharGer.PS4( )
515531
CharGer.PM1( recurrenceThreshold , hotspot3d=clustersFile )
516-
CharGer.PM2( rareThreshold )
532+
CharGer.PM2( rareAF )
517533
CharGer.PM3( )
518534
CharGer.PM4( )
519535
CharGer.PM5( )
@@ -524,7 +540,7 @@ def main( argv ):
524540
CharGer.PP4( )
525541
CharGer.PP5( )
526542

527-
CharGer.BA1( commonThreshold )
543+
CharGer.BA1( commonAF )
528544
CharGer.BS1( )
529545
CharGer.BS2( )
530546
CharGer.BS3( )
@@ -537,10 +553,15 @@ def main( argv ):
537553
CharGer.BP6( )
538554
CharGer.BP7( )
539555

556+
CharGer.PSC1( )
557+
CharGer.PMC1( )
558+
CharGer.PPC1( )
559+
CharGer.PPC2( )
560+
540561
CharGer.BSC1( )
541562
CharGer.BMC1( )
542563

543-
print( str( rareThreshold ) + " < " + str( commonThreshold ) )
564+
print( str( rareAF ) + " < " + str( commonAF ) )
544565
t4 = time.time()
545566

546567
CharGer.classify( system="ACMG" )

0 commit comments

Comments
 (0)