Skip to content
Open
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
/*/*/__pycache__
/*/*/*/__pycache__
doc/sphinx/_build
/test/tmp.*
/test/hg38.fa
/test/hg38.fa.fai
14 changes: 13 additions & 1 deletion README → README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
<!-- vim-markdown-toc GFM -->

* [CAVA v1.2.3 README](#cava-v123-readme)
* [1 INTRODUCTION](#1-introduction)
* [2 PUBLICATION](#2-publication)
* [3 DEPENDENCIES](#3-dependencies)
* [4 INSTALLATION ON LINUX OR MAC](#4-installation-on-linux-or-mac)
* [5 RUNNING CAVA](#5-running-cava)
* [6 DOCUMENTATION](#6-documentation)
* [7 LICENCE](#7-licence)

<!-- vim-markdown-toc -->

CAVA v1.2.3 README
==================
Expand All @@ -22,7 +34,7 @@ Márton Münz, Elise Ruark, Anthony Renwick, Emma Ramsay, Matthew Clarke, Shazia
--------------

To install and run CAVA v1.2.3 you will need the following dependencies installed:
- Python 2.7.9 or later (Python2 series)
- Python 3
- GCC and GNU make
- virtualenv

Expand Down
4 changes: 2 additions & 2 deletions bin/CAVA.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!env/bin/python
#!env/bin/python3

from optparse import OptionParser
from cava_ import main
from cava_ import helper

# Version
version = 'v1.2.3'
version = 'v2.0.0'

# Read default configuration file name from the default_config_path file
default_config_file = helper.defaultConfigPath()
Expand Down
4 changes: 2 additions & 2 deletions bin/EnsemblDB.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!env/bin/python
#!env/bin/python3

from optparse import OptionParser
from ensembldb import main

# Version
version = '1.2.3'
version = '2.0.0'

# Command line argument parsing
descr = 'CAVA ensembl_db v' + version
Expand Down
54 changes: 27 additions & 27 deletions bin/dbSNPDB.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!env/bin/python
#!env/bin/python3

import os
import sys
Expand Down Expand Up @@ -54,7 +54,7 @@ def processData(options, datafile, IDs):

sys.stdout.write('\rProcessing SNPs on all chrs ... OK')
sys.stdout.flush()
print ''
print('')
datafile.close()
outfile.close()
return counter
Expand Down Expand Up @@ -83,16 +83,16 @@ def printMetaData(datafile):
line = line.strip()
if line.startswith('#'):
if line.startswith('##dbSNP_BUILD_ID='):
print 'Input file build: '+line[17:]
print('Input file build: '+line[17:])
ret = int(line[17:])
if line.startswith('##reference='): print 'Reference: '+line[12:]+'\n'
if line.startswith('##reference='): print('Reference: '+line[12:]+'\n')
else:
return ret

#######################################################################################################################

# Version
version = '1.2.3'
version = '2.0.0'

descr = 'CAVA dbsnp_db v' + version
epilog = '\nExample usage: CAVA-{}/dbsnp_db -d 00-All.vcf.gz -s 138 -o out\n\n'.format(version)
Expand All @@ -106,39 +106,39 @@ def printMetaData(datafile):

# Check options
if options.release is None:
print '\nError: no dbSNP release specified'
print 'Please use option -s to specify dbSNP release version\n'
print('\nError: no dbSNP release specified')
print('Please use option -s to specify dbSNP release version\n')
quit()
if options.data is None:
print '\nError: no 00-All.vcf.gz data file specified'
print 'Please use option -d to specify path to data file\n'
print('\nError: no 00-All.vcf.gz data file specified')
print('Please use option -d to specify path to data file\n')
quit()
if not os.path.isfile(options.data):
print '\nError: 00-All.vcf.gz file (' + options.data + ') cannot be found.\n'
print('\nError: 00-All.vcf.gz file (' + options.data + ') cannot be found.\n')
quit()

# Print out version information
print "\n---------------------------------------------------------------------------------------"
print 'CAVA ' + version + ' dbSNP database preparation tool (dbsnp_db) is now running.'
print 'Started: ', datetime.datetime.now(), '\n'
print("\n---------------------------------------------------------------------------------------")
print('CAVA ' + version + ' dbSNP database preparation tool (dbsnp_db) is now running.')
print('Started: ', datetime.datetime.now(), '\n')

# Open data fie for reading
datafile = gzip.open(options.data, 'r')
datafile = gzip.open(options.data, 'rt')

# Print out meta data
build = printMetaData(datafile)
datafile.seek(0)
if int(options.release) > build:
print 'Error: requested release must be <=' + str(build) + '\n'
print('Error: requested release must be <=' + str(build) + '\n')
quit()

# Print out info
print 'Requested dbSNP release: ' + str(options.release)
print('Requested dbSNP release: ' + str(options.release))
IDs = []
if options.input is not None:
IDs = readIDs(options.input)
print '\nInput file contains ' + str(len(IDs)) + ' dbSNP IDs to be included in the database'
print ''
print('\nInput file contains ' + str(len(IDs)) + ' dbSNP IDs to be included in the database')
print('')

# Create compressed output file
N = processData(options, datafile, IDs)
Expand All @@ -150,13 +150,13 @@ def printMetaData(datafile):
os.remove(options.output)

# Print out summary information
print '\nA total of ' + str(N) + ' SNPs have been retrieved\n'
print '---------------------'
print 'Output files created:'
print '---------------------'
print options.output + '.gz (SNP database)'
print options.output + '.gz.tbi (index file)'
print ''
print 'CAVA dbsnp_db successfully finished: ', datetime.datetime.now()
print "---------------------------------------------------------------------------------------\n"
print('\nA total of ' + str(N) + ' SNPs have been retrieved\n')
print('---------------------')
print('Output files created:')
print('---------------------')
print(options.output + '.gz (SNP database)')
print(options.output + '.gz.tbi (index file)')
print('')
print('CAVA dbsnp_db successfully finished: ', datetime.datetime.now())
print("---------------------------------------------------------------------------------------\n")

4 changes: 2 additions & 2 deletions cava_/conseq.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3


# CLASS annotation
Expand Down Expand Up @@ -219,4 +219,4 @@ def checkUTR(transcript, variant):
y = variant.pos + len(variant.ref) - 1
if transcript.isPositionOutsideCDS_5prime(x) or transcript.isPositionOutsideCDS_5prime(y): return 'UTR5'
if transcript.isPositionOutsideCDS_3prime(x) or transcript.isPositionOutsideCDS_3prime(y): return 'UTR3'
return ''
return ''
Loading