Skip to content

Commit

Permalink
added an option to convert a text BWT to our format
Browse files Browse the repository at this point in the history
  • Loading branch information
holtjma committed Mar 22, 2016
1 parent c1eeea0 commit c30b90e
Show file tree
Hide file tree
Showing 4 changed files with 22,063 additions and 0 deletions.
15 changes: 15 additions & 0 deletions MUS/CommandLineInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import MSBWTGen
import util

from MUSCython import CompressToRLE
from MUSCython import GenericMerge
from MUSCython import MSBWTCompGenCython
from MUSCython import MSBWTGenCython
Expand Down Expand Up @@ -92,6 +93,10 @@ def mainRun():
p9.add_argument('srcDir', type=util.existingDirectory, help='the source directory for the BWT to compress')
p9.add_argument('dstDir', type=util.newDirectory, help='the destination directory')

p10 = sp.add_parser('convert', help='convert from a raw text input to RLE')
p10.add_argument('-i', metavar='inputTextFN', dest='inputTextFN', default=None, help='input text filename (default: stdin)')
p10.add_argument('dstDir', type=util.newDirectory, help='the destination directory')

args = p.parse_args()

if args.subparserID == 'cffq':
Expand Down Expand Up @@ -226,6 +231,16 @@ def mainRun():
else:
output.write(kmer+','+str(c)+'\n')
logger.info('Queries complete.')

elif args.subparserID == 'convert':
if args.inputTextFN == None:
logger.info('Input: stdin')
else:
logger.info('Input: '+args.inputTextFN)
logger.info('Output: '+args.dstDir)
logger.info('Beginning conversion...')
CompressToRLE.compressInput(args.inputTextFN, args.dstDir)
logger.info('Finished conversion.')

else:
print args.subparserID+" is currently not implemented, please wait for a future release."
Expand Down
Loading

0 comments on commit c30b90e

Please sign in to comment.