Skip to content

Commit

Permalink
fixed bugs with local VEP, perl used & reference fasta used. included…
Browse files Browse the repository at this point in the history
… perl option.
  • Loading branch information
AdamDS committed Sep 22, 2017
1 parent b2dfc9e commit a1ddd17
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
14 changes: 11 additions & 3 deletions bin/charger
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/python
# CharGer - Characterization of Germline variants
# author: Adam D Scott ([email protected]) & Kuan-lin Huang ([email protected])
# version: v0.3.1 - 2017*09
# version: v0.3.2 - 2017*09

import sys
import getopt
Expand All @@ -10,7 +10,7 @@ import time
import argparse

def parseArgs( argv ):
helpText = "\nCharGer - v0.3.1\n\n"
helpText = "\nCharGer - v0.3.2\n\n"
helpText += "Usage: "
helpText += "charger <input file> [options]\n\n"
helpText += "Accepted input data files:\n"
Expand Down Expand Up @@ -44,6 +44,7 @@ def parseArgs( argv ):
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 += " --perl Path to Perl\n"
helpText += " --vep-script Path to VEP\n"
helpText += " --vep-config config-file for VEP\n"
#helpText += " --vep-dir Path to VEP directory\n"
Expand Down Expand Up @@ -120,6 +121,7 @@ def parseArgs( argv ):
clustersFile = None
pathogenicVariantsFile = None
annotateInput = ""
perl = None
vepScript = None
vepConfig = None
vepCache = None
Expand Down Expand Up @@ -154,7 +156,7 @@ def parseArgs( argv ):
"vcf-any-filter" , "mutation-types=" , \
"hotspot3d=" , "pathogenicVariants=" , \
"vep-script=" , "vep-config=", "vep-dir=" , "vep-cache=" , "vep-output=" , \
"ensembl-release=" , "vep-version=" , \
"ensembl-release=" , "vep-version=" , "perl=" , \
"grch=" , "reference-fasta=" , "fork=" , \
"exac-vcf=" , "mac-clinvar-vcf=" , "mac-clinvar-tsv=" , \
"run-url-test" ] )
Expand Down Expand Up @@ -255,6 +257,8 @@ def parseArgs( argv ):
clustersFile = arg
elif opt in ( "-k" , "--annotate" ):
annotateInput = True
elif opt in ( "--perl" ):
perl = arg
elif opt in ( "--vep-script" ):
vepScript = arg
elif opt in ( "--vep-config" ):
Expand Down Expand Up @@ -332,6 +336,7 @@ def parseArgs( argv ):
"mutationTypes" : mutationTypes , \
"clustersFile" : clustersFile , \
"annotate" : annotateInput , \
"perl" : perl , \
"vepScript" : vepScript , \
"vepConfig" : vepConfig , \
#"vepDir" : vepDir , \
Expand Down Expand Up @@ -398,6 +403,7 @@ def main( argv ):
clustersFile = values["clustersFile"]
pathogenicVariantsFile = values["pathogenicVariantsFile"]
annotateInput = values["annotate"]
perl = values["perl"]
vepScript = values["vepScript"]
vepConfig = values["vepConfig"]
#vepDir = values["vepDir"]
Expand Down Expand Up @@ -427,6 +433,7 @@ def main( argv ):
assumedDeNovo = assumedDeNovoFile , \
coSegregation = coSegregationFile , \
diseases = diseasesFile , \
perl = perl , \
vepScript = vepScript , \
vepConfig = vepConfig , \
#vepDir = vepDir , \
Expand Down Expand Up @@ -497,6 +504,7 @@ def main( argv ):
searchBatchSize=clinvarSearchBatchSize , \
allOptions=False , \
maxPost=vepBatchSize , \
perl=perl , \
vepScript=vepScript , \
vepConfig=vepConfig , \
#vepDir=vepDir , \
Expand Down
8 changes: 5 additions & 3 deletions charger/charger.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def testLocalInputs( self , **kwargs ):
self.checkInputExistence( 'macClinVarVCF' , **kwargs )
self.checkInputExistence( 'exacVCF' , **kwargs )

self.checkInputExistence( 'perl' , **kwargs )
self.checkInputExistence( 'vepScript' , **kwargs )
self.checkInputExistence( 'vepConfig' , **kwargs )
#self.checkInputExistence( 'vepDir' , **kwargs )
Expand Down Expand Up @@ -985,6 +986,7 @@ def getVEPviaCMD( self , **kwargs ):
#TODO add config file handling, would make this much more flexible and simple
#TODO check ensemblRelease & grch for compatibility, GRCh37 -> [55,75] & GRCh38 -> [76,87]
#print( kwargs )
perl = kwargs.get( 'perl', "/bin/perl" ) #, defaultVEPScript )
vepScript = kwargs.get( 'vepScript', "" ) #, defaultVEPScript )
vepConfig = kwargs.get( 'vepConfig', "" )
vcfFile = kwargs.get( 'vcf' , "" )
Expand Down Expand Up @@ -1025,7 +1027,7 @@ def getVEPviaCMD( self , **kwargs ):
vep_command = []
#print("AmilaW:outputFile"+str(outputFile))
if vepConfig:
vep_command = [ "/bin/perl" , vepScript , \
vep_command = [ perl , vepScript , \
"--config", vepConfig ]
#print( "AW:inside vep config loop" )
else:
Expand All @@ -1052,14 +1054,14 @@ def getVEPviaCMD( self , **kwargs ):
#vepConfig = kwargs.get( 'vepConfig', "" )
print( defaultFasta )
print( fasta )
vep_command = [ "/bin/perl" , vepScript , \
vep_command = [ perl , vepScript , \
"--species" , "homo_sapiens" , \
"--assembly" , assembly , \
"--input_file" , vcfFile , \
"--output_file" , outputFile , \
"--format" , "vcf" , \
"--fork" , forks , \
"--fasta" , defaultFasta , \
"--fasta" , fasta , \
"--everything" , \
"--vcf" , \
"--cache" , \
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#https://docs.python.org/2/distutils/examples.html
from distutils.core import setup
version = "0.3.1"
version = "0.3.2"
setup( \
name = 'CharGer' ,
version = version ,
Expand Down

0 comments on commit a1ddd17

Please sign in to comment.