@@ -23,9 +23,10 @@ def has_outfile(mode="", previous_mode = "", hashes={}, previous_hashes={}, debu
23
23
for f in outfile_check_dict [mode ]:
24
24
f = f .replace ("HASH" , hashes [mode ]["global" ]).replace ("PREVIOUS" ,previous_hashes [previous_mode ]["global" ])
25
25
if not os .path .isfile (f ):
26
- print (" File not found :" , f )
26
+ print (" This final output file for this step is missing :" , f )
27
27
return False
28
28
return True
29
+
29
30
def check_is_running (mode = "" , previous_mode = "" , hashes = {}, previous_hashes = {}, debug = False , verbose = False ):
30
31
#print(hashes[mode])
31
32
#print(" ")
@@ -128,7 +129,7 @@ def check_is_running(mode="", previous_mode="", hashes={}, previous_hashes={}, d
128
129
129
130
for bs in hashes [mode ]["per" ].keys ():
130
131
print (" Bootstrap-cutoff:" , bs )
131
- if not os .path .isdir ("results/phylogeny-" + bs + "/quicktree" ):
132
+ if not os .path .isdir ("results/phylogeny/bootstrap-cutoff -" + bs + "/quicktree" ):
132
133
print ("\t Analysis for boostrap-cutoff " + bs + " not yet started." )
133
134
continue
134
135
missing = []
@@ -137,7 +138,7 @@ def check_is_running(mode="", previous_mode="", hashes={}, previous_hashes={}, d
137
138
alitrim = aligner + "-" + trimmer + "." + previous_hashes [previous_mode ]["per" ]["iqtree" ][trimmer ][aligner ]
138
139
genes_to_check = [gene .split ("/" )[- 1 ].split ("_" )[0 ] for gene in glob .glob ("results/alignments/filtered/" + alitrim + "/*.fas" )]
139
140
njtree = aligner + "-" + trimmer + "." + hashes [mode ]["per" ][bs ]["quicktree" ]["iqtree" ][trimmer ][aligner ]
140
- if os .path .isfile ("results/phylogeny- " + bs + "/quicktree /" + njtree + "/njtree.tre" ):
141
+ if os .path .isfile ("results/phylogeny/quicktree/bootstrap-cutoff- " + bs + "/" + njtree + "/njtree.tre" ):
141
142
if verbose :
142
143
print ("\t njtree for" , njtree , "done." )
143
144
else :
@@ -149,53 +150,53 @@ def check_is_running(mode="", previous_mode="", hashes={}, previous_hashes={}, d
149
150
if mode == "mltree" :
150
151
for bs in hashes [mode ]["per" ].keys ():
151
152
print (" Bootstrap-cutoff:" , bs )
152
- if not os .path .isdir ("results/phylogeny-" + bs + "/astral" ):
153
- print ("\t Analysis for boostrap-cutoff " + bs + " not yet started." )
154
- continue
155
153
missing = []
156
154
if "iqtree" in hashes [mode ]["per" ][bs ].keys (): # this can be made more efficient!
157
- for trimmer in hashes [mode ]["per" ][bs ]["iqtree" ]["iqtree" ].keys (): #not sure why iqtree is in this
158
- for aligner in hashes [mode ]["per" ][bs ]["iqtree" ]["iqtree" ][trimmer ].keys (): #not sure why iqtree is in this
159
- alitrim = aligner + "-" + trimmer + "." + previous_hashes [previous_mode ]["per" ]["iqtree" ][trimmer ][aligner ]
160
- genes_to_check = [gene .split ("/" )[- 1 ].split ("_" )[0 ] for gene in glob .glob ("results/modeltest/" + alitrim + "/*.treefile" )]
161
- mltree = aligner + "-" + trimmer + "." + hashes [mode ]["per" ][bs ]["iqtree" ]["iqtree" ][trimmer ][aligner ]
162
- if os .path .isfile ("results/phylogeny-" + bs + "/iqtree/" + mltree + "/concat.contree" ):
163
- if verbose :
164
- print ("\t IQ-Tree for" , mltree , "done." )
165
- else :
166
- missing .append (mltree )
167
- if verbose :
168
- print ("\t Missing IQ-Tree for" , mltree )
169
- if len (missing ) > 0 :
170
- print ("\t Total number of missing IQ-Tree trees:" , len (missing ))
155
+ if not os .path .isdir ("results/phylogeny/iqtree/bootstrap-cutoff-" + bs ):
156
+ print ("\t IQ-Tree analysis for boostrap-cutoff " + bs + " not yet started." )
171
157
else :
172
- print ("\t All IQ-Tree trees finished." )
158
+ for trimmer in hashes [mode ]["per" ][bs ]["iqtree" ]["iqtree" ].keys (): #not sure why iqtree is in this
159
+ for aligner in hashes [mode ]["per" ][bs ]["iqtree" ]["iqtree" ][trimmer ].keys (): #not sure why iqtree is in this
160
+ alitrim = aligner + "-" + trimmer + "." + previous_hashes [previous_mode ]["per" ]["iqtree" ][trimmer ][aligner ]
161
+ genes_to_check = [gene .split ("/" )[- 1 ].split ("_" )[0 ] for gene in glob .glob ("results/modeltest/" + alitrim + "/*.treefile" )]
162
+ mltree = aligner + "-" + trimmer + "." + hashes [mode ]["per" ][bs ]["iqtree" ]["iqtree" ][trimmer ][aligner ]
163
+ if os .path .isfile ("results/phylogeny/iqtree/bootstrap-cutoff-" + bs + "/" + mltree + "/concat.contree" ):
164
+ if verbose :
165
+ print ("\t IQ-Tree for" , mltree , "done." )
166
+ else :
167
+ missing .append (mltree )
168
+ if verbose :
169
+ print ("\t Missing IQ-Tree for" , mltree )
170
+ if len (missing ) > 0 :
171
+ print ("\t Total number of missing IQ-Tree trees:" , len (missing ))
172
+ else :
173
+ print ("\t All IQ-Tree trees finished." )
173
174
print ()
174
- if not os .path .isdir ("results/phylogeny-" + bs + "/astral" ):
175
- print ("\t Analysis for boostrap-cutoff " + bs + " not yet started." )
176
- continue
177
175
missing = []
178
176
if "raxml" in hashes [mode ]["per" ][bs ].keys (): # this can be made more efficient!
179
- for trimmer in hashes [mode ]["per" ][bs ]["raxml" ]["iqtree" ].keys (): #not sure why iqtree is in this
180
- for aligner in hashes [mode ]["per" ][bs ]["raxml" ]["iqtree" ][trimmer ].keys (): #not sure why iqtree is in this
181
- alitrim = aligner + "-" + trimmer + "." + previous_hashes [previous_mode ]["per" ]["iqtree" ][trimmer ][aligner ]
182
- genes_to_check = [gene .split ("/" )[- 1 ].split ("_" )[0 ] for gene in glob .glob ("results/modeltest/" + alitrim + "/*.treefile" )]
183
- mltree = aligner + "-" + trimmer + "." + hashes [mode ]["per" ][bs ]["raxml" ]["iqtree" ][trimmer ][aligner ]
184
- if os .path .isfile ("results/phylogeny-" + bs + "/raxml/" + mltree + "/raxmlng.raxml.bestTree" ):
185
- if verbose :
186
- print ("\t RAxML-NG for" , mltree , "done." )
187
- else :
188
- missing .append (mltree )
189
- if verbose :
190
- print ("\t Missing RAxML-NG for" , mltree )
191
- if len (missing ) > 0 :
192
- print ("\t Total number of missing RAxML-NG trees:" , len (missing ))
177
+ if not os .path .isdir ("results/phylogeny/raxml/bootstrap-cutoff-" + bs ):
178
+ print ("\t RAxML analysis for boostrap-cutoff-" + bs + " not yet started." )
193
179
else :
194
- print ("\t All RAxML-NG trees finished." )
180
+ for trimmer in hashes [mode ]["per" ][bs ]["raxml" ]["iqtree" ].keys (): #not sure why iqtree is in this
181
+ for aligner in hashes [mode ]["per" ][bs ]["raxml" ]["iqtree" ][trimmer ].keys (): #not sure why iqtree is in this
182
+ alitrim = aligner + "-" + trimmer + "." + previous_hashes [previous_mode ]["per" ]["iqtree" ][trimmer ][aligner ]
183
+ genes_to_check = [gene .split ("/" )[- 1 ].split ("_" )[0 ] for gene in glob .glob ("results/modeltest/" + alitrim + "/*.treefile" )]
184
+ mltree = aligner + "-" + trimmer + "." + hashes [mode ]["per" ][bs ]["raxml" ]["iqtree" ][trimmer ][aligner ]
185
+ if os .path .isfile ("results/phylogeny/raxml/bootstrap-cutoff-" + bs + "/" + mltree + "/raxmlng.raxml.bestTree" ):
186
+ if verbose :
187
+ print ("\t RAxML-NG for" , mltree , "done." )
188
+ else :
189
+ missing .append (mltree )
190
+ if verbose :
191
+ print ("\t Missing RAxML-NG for" , mltree )
192
+ if len (missing ) > 0 :
193
+ print ("\t Total number of missing RAxML-NG trees:" , len (missing ))
194
+ else :
195
+ print ("\t All RAxML-NG trees finished." )
195
196
if mode == "speciestree" :
196
197
for bs in hashes [mode ]["per" ].keys ():
197
198
print (" Bootstrap-cutoff:" , bs )
198
- if not os .path .isdir ("results/phylogeny- " + bs + "/astral" ):
199
+ if not os .path .isdir ("results/phylogeny/bootstrap-cutoff- " + bs ):
199
200
print ("\t Analysis for boostrap-cutoff " + bs + " not yet started." )
200
201
continue
201
202
missing = []
@@ -204,7 +205,7 @@ def check_is_running(mode="", previous_mode="", hashes={}, previous_hashes={}, d
204
205
alitrim = aligner + "-" + trimmer + "." + previous_hashes [previous_mode ]["per" ]["iqtree" ][trimmer ][aligner ]
205
206
genes_to_check = [gene .split ("/" )[- 1 ].split ("_" )[0 ] for gene in glob .glob ("results/modeltest/" + alitrim + "/*.treefile" )]
206
207
sptree = aligner + "-" + trimmer + "." + hashes [mode ]["per" ][bs ]["astral" ]["iqtree" ][trimmer ][aligner ]
207
- if os .path .isfile ("results/phylogeny- " + bs + "/astral /" + sptree + "/species_tree.tre" ):
208
+ if os .path .isfile ("results/phylogeny/astral/bootstrap-cutoff- " + bs + "/" + sptree + "/species_tree.tre" ):
208
209
if verbose :
209
210
print ("\t Speciestree for" , sptree , "done." )
210
211
else :
0 commit comments