annotate uniqprimer-0.5.0/uniqprimer_ok.py @ 6:8218425fda1d draft default tip

Uploaded
author dereeper
date Tue, 04 Jan 2022 16:05:55 +0000
parents 3249d78ecfc2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
1 #!/usr/bin/python
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
2
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
3 '''
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
4 Created on Jan 1, 2011
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
5
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
6 @author: John L. Herndon
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
7 @contact: herndon@cs.colostate.edu
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
8 @organization: Colorado State University
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
9 @group: Computer Science Department, Asa Ben-Hur's laboratory
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
10 Mau added the -o primerOutfile -l logfile option
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
11 '''
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
12
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
13 import exceptions
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
14 import sys
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
15 import time
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
16
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
17 import getopt
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
18 from primertools import *
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
19
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
20 version="0.5.0"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
21
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
22
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
23 class UniqPrimerFinder( object ):
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
24
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
25 def __init__( self, includeFiles, excludeFiles, crossValidate, eprimerOptions):
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
26
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
27 utils.logMessage( "UniqPrimerFinder::__init__()", "Initializing UniqPrimerFinder" )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
28 self.includeFiles = includeFiles
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
29 self.includeFileManager = includefilemanager.IncludeFileManager( )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
30
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
31 self.excludeFiles = excludeFiles
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
32 self.excludeFileManager= excludefilemanager.ExcludeFileManager( )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
33
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
34 self.primerManager = primermanager.PrimerManager( eprimerOptions )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
35
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
36 self.crossValidate = crossValidate
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
37
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
38
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
39 utils.logMessage( "UniqPrimerFinder::__init__()", "Initializing UniqPrimerFinder - complete" )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
40
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
41 def writeOutputFile( self, primers, outputFileName, maxresults = 100 ):
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
42 '''
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
43 primers: a list of PrimerSet obs
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
44 '''
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
45 ##outputFileName = uPrimer ##Mau: defined this..
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
46 outputFile = open( outputFileName, 'w' )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
47
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
48 i = 0
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
49 for primer in primers:
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
50 i += 1
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
51
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
52 outputFile.write( "{0}\t{1}\t{2}\t{3}\n".format( i, primer.forwardPrimer, primer.reversePrimer, primer.productSize ) )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
53
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
54 if i > maxresults:
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
55 break
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
56
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
57 utils.logMessage( "UniqPrimerFinder::writeOutputFile()", "output file written." )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
58
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
59
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
60 def findPrimers( self, outputFile = "uPrimer.txt" ):
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
61 outputFile = uPrimer ## Mau adds to overwrite the above value
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
62
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
63 utils.logMessage( "UniqPrimerFinder::findPrimers()", "Finding primers for include files" )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
64 startTime = time.time( )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
65 #generate the combined sequence fasta file for all exclude sequences
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
66 utils.printProgressMessage( "*** Creating Combined Fasta File for Exclude Files ***" )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
67 for excludeFile in self.excludeFiles:
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
68 self.excludeFileManager.addExcludeFile( excludeFile )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
69
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
70 self.excludeFileManager.exportSequences( )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
71
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
72 self.includeFileManager.setExcludeFile( self.excludeFileManager.getOutputFileName( ) )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
73
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
74 utils.printProgressMessage( "*** Finding Sequences Unique to Target Genome ***" )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
75
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
76 #run nucmer program on all include files
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
77 for includeFile in self.includeFiles:
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
78 self.includeFileManager.processIncludeFile( includeFile )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
79
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
80 #get the sequences found in include files, but no the exclude file.
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
81 uniqueSequences = self.includeFileManager.getUniqueSequences( )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
82
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
83 utils.printProgressMessage( "*** Finding Primers ***" )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
84
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
85 primers = self.primerManager.getPrimers( uniqueSequences )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
86
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
87 if self.crossValidate == True:
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
88 utils.printProgressMessage( "*** Cross Validating Primers ***" )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
89 primers = self.primerManager.crossValidatePrimers( primers, self.excludeFileManager.getOutputFileName( ) )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
90
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
91
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
92 utils.logMessage( "UniqPrimerFinder::findPrimers( )", "found {0} unique sequences".format( len( primers ) ) )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
93
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
94 self.writeOutputFile( primers, outputFile )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
95
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
96 utils.logMessage( "UniqPrimerFinder::findPrimers()", "Finished finding primers" )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
97 endTime = time.time()
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
98 elapsedMinutes = int( ( endTime - startTime ) / 60 )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
99 elapsedSeconds = int( ( endTime - startTime ) % 60 )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
100 print "*** Time Elapsed: {0} minutes, {1} seconds ***".format( elapsedMinutes, elapsedSeconds )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
101 print "*** Output Written to {0} ***".format( outputFile )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
102
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
103
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
104 def printUsageAndQuit( ):
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
105 global version
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
106 print "uniqprimer - finds primers unique to a genome"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
107 print "Version: " + str( version )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
108 print "Summary of Options."
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
109 print "Required Arguments:"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
110 print " -i <filename>: use <filename> as an include file. Primers will be identified for this genome"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
111 print " -x <filename>: use <filename> as an exclude file. Primers for this genome will be excluded"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
112 print " -o <filename>: specify the name of the unique primer output file (default is uPrimer.txt)" ## Mau added..
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
113 print " -l <filename>: specify the name of the log output file" ## Mau added..
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
114
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
115 print "\nOptional Arguments:"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
116 print " --productsizerage: set a range for the desired size of PCR product (default=200-250). Example: ./uniqprimer -productsizerage 100-150"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
117 print " --primersize: set the desired primer size (default=20)"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
118 print " --minprimersize: set the minimum primer size (default=27)"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
119 print " --maxprimersize: set the maximum primer size (default=18)"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
120 print " --crossvalidate: force the program to cross validate primers against exclude files for extra certainty"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
121 print " --keeptempfiles: force the program to keep temporary files"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
122
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
123 print "\n\nExample:"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
124 print "uniqprimer -i <includefile1> -i <includefile2> ... -i <includefileN> -x <excludefile1> -x <excludefile2> ... -x <excludefileN> -o primers.txt -l logfile.txt"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
125 utils.shutdownLogging( )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
126 sys.exit( )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
127
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
128
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
129 opts = 'i:x:h:o:l:' # Mau added :o & :l for outfile specification
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
130 longopts=[ "productsizerange=", "primersize=", "minprimersize=", "maxprimersize=", "crossvalidate", "keeptempfiles" ]
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
131
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
132 def parseArgs( args ):
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
133
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
134
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
135 global uPrimer ## Mau added lf, brute force...
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
136 global lf # Mau added lf, brute force...
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
137 #uPrimer = "uPrimer.txt" ##the default value...
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
138
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
139 crossValidate = False
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
140 cleanup = True
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
141 optlist, args = getopt.getopt( args, opts, longopts )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
142
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
143 includeFiles = [ ]
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
144 excludeFiles = [ ]
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
145 eprimerOptions = utils.EPrimerOptions( )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
146
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
147 verbose = False
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
148 for opt in optlist:
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
149 if opt[ 0 ] == '-i':
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
150 includeFiles.append( opt[ 1 ] )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
151 elif opt[ 0 ] == '-x':
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
152 excludeFiles.append( opt[ 1] )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
153 elif opt[ 0 ] == '-v':
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
154 verbose = True
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
155 elif opt[ 0 ] == '-o': ## Mau added, if -o...
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
156 uPrimer = str(opt[1]) ## Mau added, then get filename for outfile after -o
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
157 elif opt[ 0 ] == '-l': ## Mau added, if -l...
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
158 lf = str(opt[1]) ## Mau added, then get filename for logfile after -l
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
159 elif opt[ 0 ] == '--productsizerange':
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
160 eprimerOptions.setProductRange( opt[ 1 ] )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
161 productsizerange = opt[ 1 ]
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
162 elif opt[ 0 ] == '--primersize':
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
163 eprimerOptions.setPrimerSize( opt[1 ] )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
164 elif opt[ 0 ] == '--minprimersize':
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
165 eprimerOptions.setMinPrimerSize( opt[1 ] )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
166 elif opt[ 0 ] == '--maxprimersize':
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
167 eprimerOptions.setMaxPrimerSize( opt[1 ] )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
168 elif opt[ 0 ] == '--crossvalidate':
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
169 crossValidate = True
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
170 elif opt[ 0 ] == '--crossvalidate':
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
171 crossValidate = True
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
172 elif opt[ 0 ] == '--keeptempfiles':
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
173 cleanup = False
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
174 elif opt[ 0 ] == '-h':
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
175 printUsageAndQuit( )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
176 else:
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
177 print "Unknown option: " + str( opt[ 0 ] )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
178 printUsageAndQuit( )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
179 #print "uPrimer: " + uPrimer + " log file name: " + lf + "\n"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
180 if len( includeFiles ) == 0 or len( excludeFiles ) == 0:
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
181
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
182 print "You must specify at least one include file and at least one exclude file"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
183 printUsageAndQuit( )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
184
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
185 return includeFiles, excludeFiles, crossValidate, cleanup, verbose, eprimerOptions, lf , uPrimer #Mau: add lf, uPrime
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
186
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
187 def main( args, debug = False):
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
188 #parse the command line arguments for include and exclude files
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
189
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
190 includeFiles, excludeFiles, crossValidate, cleanup, verbose, eprimerOptions, lf, uPrimer = parseArgs( args ) ##Mau add: lf
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
191
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
192 utils.initialize( True, cleanup, lf) ##Mau: add lf
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
193
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
194 #find primers for the include sequences
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
195
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
196 try:
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
197 utils.logMessage( "uniqprimer::Main( )", "Logging include files: " )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
198 utils.logList( "uniqprimer::Main( )", includeFiles )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
199 utils.logMessage( "uniqprimer::Main( )", "Logging exclude files: " )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
200 utils.logList( "uniqprimer::Main( )", excludeFiles)
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
201 print "*** Finding Primers ***"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
202 uniqPrimer = UniqPrimerFinder( includeFiles, excludeFiles, crossValidate, eprimerOptions)
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
203 uniqPrimer.findPrimers( )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
204 except utils.NoFileFoundException as nfe:
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
205 print "File not found: " + str( nfe.filename )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
206 printUsageAndQuit( )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
207 except utils.ProgramNotFoundException as pnfe:
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
208 print str( pnfe.programName ) + ": program is not installed or is not in your path."
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
209 print str( pnfe.details )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
210 except utils.NoPrimersExistException as npe:
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
211 print "Failure: No unique primers exist for this combination"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
212 except exceptions.BaseException as e:
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
213 print "It appears that an unknown sequence of events has resulted in the internal explosion of this program. Please send the file called \'log_uniqprimer.txt\' to herndon@cs.colostate.edu and tell that bonehead John to fix it!"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
214 print "Details:"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
215 print e
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
216
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
217 utils.shutdown( )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
218
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
219 print "*** Finished ***"
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
220
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
221 if __name__ == '__main__':
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
222
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
223 #temp_args = "-i data/testdata/smallinclude.ffn -x data/testdata/smallexclude.ffn".split( )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
224
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
225 #temp_args = "-i data/XOO_MAI1_scaffolds.fas -x data/KACC.ffn".split( )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
226 if len( sys.argv ) == 1:
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
227 printUsageAndQuit( )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
228 main( sys.argv[ 1: ], debug = True )
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
229
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
230
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
231
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
232
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
233
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
234
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
235
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
236
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
237
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
238
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
239
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
240
3249d78ecfc2 Uploaded
dereeper
parents:
diff changeset
241