Package bpm :: Package cmdargs :: Module funcassociateinfo
[hide private]
[frames] | no frames]

Source Code for Module bpm.cmdargs.funcassociateinfo

 1  ''' 
 2  'funcassociateinfo.py' sets up the command line arguments for the  
 3  'genecentric-fainfo' program. 
 4  ''' 
 5  import sys 
 6   
 7  import bpm 
 8   
 9  import argparse 
10   
11  parser = argparse.ArgumentParser( 
12      description='Query Funcassociate for information to use with \'go-enrich\'', 
13      formatter_class=argparse.ArgumentDefaultsHelpFormatter) 
14  aa = parser.add_argument 
15  aa('command', type=str, choices=['species', 'namespaces'], 
16     metavar='QUERY_COMMAND', 
17     help='The \'species\' command will ask Funcassociate for a list of ' 
18          'available species to perform GO enrichment with. The \'namespaces\' ' 
19          'command, with a corresponding species name, will ask Funcassociate ' 
20          'for a list of available namespaces to use with the species ' 
21          'specified.') 
22  aa('species', type=str, nargs='?', default=None, metavar='QUERY_SPECIES', 
23     help='The species to be used when querying for available namespaces. ' 
24          'This should not be used with the \'species\' command.') 
25   
26  aa('-v', '--verbose', dest='verbose', action='store_true', 
27     help='If set, more output will be shown.') 
28   
29  conf = parser.parse_args() 
30   
31  if conf.command == 'namespaces' and conf.species is None: 
32      print >> sys.stderr, \ 
33               'You must provide a species when using the \'namespace\' command.' 
34      sys.exit(1) 
35   
36  # Set the global conf variable 
37  bpm.conf = conf 
38