balabanmetin / apples

distance based phylogenetic placement
GNU General Public License v3.0
24 stars 5 forks source link

Call to fastme via subprocess.call should be passed as sequence instead of string #1

Closed pierrebarbera closed 5 years ago

pierrebarbera commented 5 years ago

Calling the program fails for me as subprocess.call tries to interpret the full string specified here:

https://github.com/balabanmetin/apples/blob/master/apples.py#L349

as the path to an executable. To increase platform independence (and avoid the crash I experienced) I suggest switching to specifying the executable path and individual args as a list:

s = [fastme_exec, "-c", "-{}J".format(datatype), "-i", aln_fp, "-O", dist_fp, "-Q", placement_set_size]
subprocess.call(s, stdout = nldef, stderr = nldef)

See also this SO thread: https://stackoverflow.com/questions/15109665/subprocess-call-using-string-vs-using-list/15109975#15109975

balabanmetin commented 5 years ago

Changes are applied.