Skip to content

Commit

Permalink
checks making hdf5 files
Browse files Browse the repository at this point in the history
  • Loading branch information
rbpisupati committed Oct 23, 2017
1 parent 6ee84e5 commit 83abc9e
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions snpmatch/core/makedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from pygwas.core import genotype
import sys
import os
import os.path
import json
import gzip
from subprocess import Popen, PIPE
Expand Down Expand Up @@ -79,8 +80,16 @@ def makeHDF5s(csvFile, outFile):
logging.info("done!")

def makedb_from_vcf(args):
log.info("converting VCF to CSV")
getCSV(args['inFile'], args['db_id'] + '.csv', args['bcfpath'])
log.info("converting CSV to hdf5!")
makeHDF5s(args['db_id'] + '.csv', args['db_id'])
log.info('done!')
_,inType = os.path.splitext(args['inFile'])
if inType == '.vcf':
log.info("converting VCF to CSV")
getCSV(args['inFile'], args['db_id'] + '.csv', args['bcfpath'])
log.info("converting CSV to hdf5!")
makeHDF5s(args['db_id'] + '.csv', args['db_id'])
log.info('done!')
elif inType == '.csv':
log.info("converting CSV to hdf5!")
makeHDF5s(args['db_id'] + '.csv', args['db_id'])
log.info('done!')
else:
die("please provide either a VCF file or a CSV!")

0 comments on commit 83abc9e

Please sign in to comment.