-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added PSC1 and PPC2. adjusted PMC1 category. adjusted PS1 and BSC1 sc…
…ores. fixed VEP defaults. fixed frequency options.
- Loading branch information
Showing
4 changed files
with
120 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
#!/bin/python | ||
# CharGer - Characterization of Germline variants | ||
# author: Adam D Scott ([email protected]) & Kuan-lin Huang ([email protected]) | ||
# version: v0.2.1 - 2017*05 | ||
# version: v0.3.0 - 2017*09 | ||
|
||
import sys | ||
import getopt | ||
from charger import charger | ||
import time | ||
import argparse | ||
|
||
def parseArgs( argv ): | ||
helpText = "\nCharGer - v0.2.1\n\n" | ||
helpText = "\nCharGer - v0.3.0\n\n" | ||
helpText += "Usage: " | ||
helpText += "charger <input file> [options]\n\n" | ||
helpText += "Accepted input data files:\n" | ||
|
@@ -38,7 +39,10 @@ def parseArgs( argv ): | |
helpText += " -a assumed de novo file, standard .maf\n" | ||
helpText += " -c co-segregation file, standard .maf\n" | ||
helpText += " -H HotSpot3D clusters file, .clusters\n" | ||
helpText += " -r recurrence threshold (default = 2)\n" | ||
helpText += "Thresholds:\n" | ||
helpText += " --recurrence-threshold HotSpot3D recurrence threshold (default = 2)\n" | ||
helpText += " --rare-threshold Allele frequency threshold for rare (default = 0.0005 (0.05%)):\n" | ||
helpText += " --common-threshold Allele frequency threshold for common (default = 0.005 (0.5%)):\n" | ||
helpText += "Local VEP (works with .vcf input only; suppresses ReST too):\n" | ||
helpText += " --vep-script Path to VEP\n" | ||
helpText += " --vep-config config-file for VEP\n" | ||
|
@@ -57,9 +61,9 @@ def parseArgs( argv ): | |
helpText += " --mac-clinvar-tsv ClinVar from MacArthur lab (clinvar_alleles.tsv.gz)\n" | ||
#helpText += " --mac-clinvar-vcf ClinVar from MacArthur lab (clinvar_alleles.vcf.gz)\n" | ||
helpText += "Filters:\n" | ||
helpText += " --rare Allele frequency threshold for rare/common (default = 1, process variant with any frequency):\n" | ||
helpText += " --vcf-any-filter Allow variants that do not pass all filters in .vcf input (flag)\n" | ||
helpText += " --mutation-types Comma delimited list (no spaces) of types to allow\n" | ||
helpText += " --frequency-filter Keep if allele frequency lower (default = 1, process variant with any frequency):\n" | ||
helpText += " --vcf-any-filter Keep variants that do not pass all filters in .vcf input (flag)\n" | ||
helpText += " --mutation-types Keep types, as a comma delimited list (no spaces)\n" | ||
helpText += "ReST batch sizes:\n" | ||
helpText += " -v VEP (#variants, default/max allowed = 150)\n" | ||
helpText += " -b ClinVar summary (#variants, default/max allowed = 500)\n" | ||
|
@@ -76,7 +80,6 @@ def parseArgs( argv ): | |
helpText += " -C codon\n" | ||
helpText += " -p peptide change\n" | ||
helpText += " -L variant classification\n" | ||
helpText += " -F allele frequency\n" | ||
helpText += "\n" | ||
helpText += " -h this message\n" | ||
helpText += "\n" | ||
|
@@ -117,35 +120,38 @@ def parseArgs( argv ): | |
clustersFile = None | ||
pathogenicVariantsFile = None | ||
annotateInput = "" | ||
vepScript = "" | ||
vepConfig = "" | ||
#vepDir = None | ||
vepScript = None | ||
vepConfig = None | ||
vepCache = None | ||
vepOutput = None | ||
ensemblRelease = "" | ||
vepVersion = "" | ||
grch = "" | ||
fork = "" | ||
ensemblRelease = str( 75 ) | ||
vepVersion = str( 87 ) | ||
grch = str( 37 ) | ||
fork = str( 1 ) | ||
referenceFasta = None | ||
exacVCF = None | ||
macClinVarVCF = None | ||
macClinVarTSV = None | ||
doURLTest = True | ||
thresholdAF = 1 | ||
rareAF = 0.0005 #from germline studies | ||
commonAF = 0.05 #from ACMG suggestion | ||
keepAF = 1 | ||
anyFilter = False | ||
mutationTypes = [] | ||
|
||
try: | ||
#haven't used ijquy | ||
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:" | ||
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:" | ||
opts, args = getopt.getopt( argv , charCommands , \ | ||
["maf=" , "vcf=" , "tsv=" , "output=" , "use-tcga" , \ | ||
"run-vep" , "run-clinvar" , "run-exac" , \ | ||
"vepBatchSize=" , "summaryBatchSize=" , "searchBatchSize=" , \ | ||
"peptideChange=" , "codon=" , "alleleFrequency=" , \ | ||
"geneList=" , "diseases=" , "expression=" , \ | ||
"deNovo=" , "assumedDeNovo=" , "coSegregation=" , \ | ||
"recurrence=" , "rare=" , "vcf-any-filter" , "mutation-types=" , \ | ||
"rare-threshold=" , "common-threshold=" , \ | ||
"recurrence-threshold=" , "frequency-filter=" , \ | ||
"vcf-any-filter" , "mutation-types=" , \ | ||
"hotspot3d=" , "pathogenicVariants=" , \ | ||
"vep-script=" , "vep-config=", "vep-dir=" , "vep-cache=" , "vep-output=" , \ | ||
"ensembl-release=" , "vep-version=" , \ | ||
|
@@ -233,10 +239,14 @@ def parseArgs( argv ): | |
asHTML = True | ||
elif opt in ( "-O" , "--override" ): | ||
override = True | ||
elif opt in ( "-r" , "--recurrence" ): | ||
elif opt in ( "-r" , "--recurrence-threshold" ): | ||
recurrenceThreshold = float( arg ) | ||
elif opt in ( "--rare" ): | ||
thresholdAF = float( arg ) | ||
elif opt in ( "--rare-threshold" ): | ||
rareAF = float( arg ) | ||
elif opt in ( "--common-threshold" ): | ||
commonAF = float( arg ) | ||
elif opt in ( "--frequency-filter" ): | ||
keepAF = float( arg ) | ||
elif opt in ( "--mutation-types" ): | ||
mutationTypes = arg.split( "," ) | ||
elif opt in ( "--vcf-any-filter" ): | ||
|
@@ -315,7 +325,9 @@ def parseArgs( argv ): | |
"variantClassificationColumn" : variantClassificationColumn, \ | ||
"alleleFrequencyColumn" : alleleFrequencyColumn, \ | ||
"recurrenceThreshold" : recurrenceThreshold , \ | ||
"thresholdAF" : thresholdAF , \ | ||
"rareAF" : rareAF , \ | ||
"commonAF" : commonAF , \ | ||
"keepAF" : keepAF , \ | ||
"anyFilter" : anyFilter , \ | ||
"mutationTypes" : mutationTypes , \ | ||
"clustersFile" : clustersFile , \ | ||
|
@@ -378,7 +390,9 @@ def main( argv ): | |
asHTML = values["html"] | ||
override = values["override"] | ||
recurrenceThreshold = values["recurrenceThreshold"] | ||
thresholdAF = values["thresholdAF"] | ||
rareAF = values["rareAF"] | ||
commonAF = values["commonAF"] | ||
keepAF = values["keepAF"] | ||
anyFilter = values["anyFilter"] | ||
mutationTypes = values["mutationTypes"] | ||
clustersFile = values["clustersFile"] | ||
|
@@ -452,7 +466,9 @@ def main( argv ): | |
peptideChange=peptideChangeColumn , \ | ||
variantClassification=variantClassificationColumn , \ | ||
alleleFrequency=alleleFrequencyColumn , \ | ||
thresholdAF = thresholdAF , \ | ||
rareAF = rareAF , \ | ||
commonAF = commonAF , \ | ||
keepAF = keepAF , \ | ||
anyFilter = anyFilter , \ | ||
mutationTypes = mutationTypes , \ | ||
) | ||
|
@@ -495,16 +511,16 @@ def main( argv ): | |
exacVCF=exacVCF , \ | ||
macClinVarTSV=macClinVarTSV , \ | ||
macClinVarVCF=macClinVarVCF , \ | ||
thresholdAF = thresholdAF , \ | ||
rareAF = rareAF , \ | ||
commonAF = commonAF , \ | ||
keepAF = keepAF , \ | ||
anyFilter = anyFilter , \ | ||
mutationTypes = mutationTypes , \ | ||
#timeout=(20,20) , \ | ||
) | ||
|
||
t3 = time.time() | ||
|
||
rareThreshold = 0.0005 #from germline studies | ||
commonThreshold = 0.05 #from ACMG suggestion | ||
minimumEvidence = 2 | ||
|
||
CharGer.PVS1( ) | ||
|
@@ -513,7 +529,7 @@ def main( argv ): | |
CharGer.PS3( ) | ||
CharGer.PS4( ) | ||
CharGer.PM1( recurrenceThreshold , hotspot3d=clustersFile ) | ||
CharGer.PM2( rareThreshold ) | ||
CharGer.PM2( rareAF ) | ||
CharGer.PM3( ) | ||
CharGer.PM4( ) | ||
CharGer.PM5( ) | ||
|
@@ -524,7 +540,7 @@ def main( argv ): | |
CharGer.PP4( ) | ||
CharGer.PP5( ) | ||
|
||
CharGer.BA1( commonThreshold ) | ||
CharGer.BA1( commonAF ) | ||
CharGer.BS1( ) | ||
CharGer.BS2( ) | ||
CharGer.BS3( ) | ||
|
@@ -537,10 +553,15 @@ def main( argv ): | |
CharGer.BP6( ) | ||
CharGer.BP7( ) | ||
|
||
CharGer.PSC1( ) | ||
CharGer.PMC1( ) | ||
CharGer.PPC1( ) | ||
CharGer.PPC2( ) | ||
|
||
CharGer.BSC1( ) | ||
CharGer.BMC1( ) | ||
|
||
print( str( rareThreshold ) + " < " + str( commonThreshold ) ) | ||
print( str( rareAF ) + " < " + str( commonAF ) ) | ||
t4 = time.time() | ||
|
||
CharGer.classify( system="ACMG" ) | ||
|
Oops, something went wrong.