@@ -197,11 +197,20 @@ def print_alias_file_exit(alias_file):
197
197
198
198
sys .exit (0 )
199
199
200
+ def get_version (programs ):
201
+ for program in programs :
202
+ cmd = [f"{ program } --version" ]
203
+ output = subprocess .run (cmd , shell = True , check = True ,
204
+ stdout = subprocess .PIPE , encoding = 'utf-8' )
205
+ version = output .stdout .strip ().split ()[- 1 ].strip ('()v' )
206
+ print (f"{ program .split ()[0 ]} { version } " )
207
+
200
208
def print_conda_version (pkg_list ):
201
209
for pkg in pkg_list :
202
210
try :
203
211
result = subprocess .run (['conda' , 'list' , pkg ],
204
212
stdout = subprocess .PIPE , stderr = subprocess .PIPE , check = True )
213
+
205
214
except subprocess .CalledProcessError as e :
206
215
stderr = e .stderr .decode ('utf-8' )
207
216
sys .stderr .write (cyan (f"Error: { e } :\n { stderr } \n " ))
@@ -223,7 +232,8 @@ def print_versions_exit(config):
223
232
if config [KEY_PANGOLIN_ASSIGNMENT_VERSION ] is not None :
224
233
print (f"pangolin-assignment: { config [KEY_PANGOLIN_ASSIGNMENT_VERSION ]} " )
225
234
# Print versions of other important tools used by pangolin
226
- print_conda_version (['usher' , 'ucsc-fatovcf' , 'gofasta' , 'minimap2' ])
235
+ get_version (['usher' , 'gofasta' , 'minimap2' ])
236
+ # print_conda_version(['usher', 'ucsc-fatovcf', 'gofasta', 'minimap2'])
227
237
sys .exit (0 )
228
238
229
239
def set_up_verbosity (config ):
0 commit comments