PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/genetrack/genetrack_peak_prediction.py

https://bitbucket.org/cistrome/cistrome-harvard/
Python | 40 lines | 21 code | 11 blank | 8 comment | 6 complexity | 76fdd8351c92a2c63d27041d52c31b92 MD5 | raw file
 1#!/usr/bin/env python
 2
 3"""
 4Wraps genetrack.scripts.peakpred so the tool can be executed from Galaxy.
 5
 6usage: %prog input output level sigma mode exclusion strand
 7"""
 8
 9import sys
10from galaxy import eggs
11import pkg_resources
12pkg_resources.require( "GeneTrack" )
13
14from genetrack.scripts import peakpred
15from genetrack import logger
16
17if __name__ == "__main__":
18
19    parser = peakpred.option_parser()
20
21    options, args = parser.parse_args()
22
23    logger.disable(options.verbosity)
24
25    from genetrack import conf
26
27    # trigger test mode
28    if options.test:
29        options.inpname = conf.testdata('test-hdflib-input.gtrack')
30        options.outname = conf.testdata('predictions.bed')
31
32    # missing input file name
33    if not options.inpname and not options.outname:
34        parser.print_help()
35    else:
36        print 'Sigma = %s' % options.sigma
37        print 'Minimum peak = %s' % options.level
38        print 'Peak-to-peak = %s' % options.exclude
39
40        peakpred.predict(options.inpname, options.outname, options)