Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for errors from calling DIAMOND #108

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions checkm2/diamond.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def check_for_diamond(self):
# else returns something non-zero

try:
subprocess.call(['diamond', 'help'], stdout=open(os.devnull, 'w'), stderr=subprocess.STDOUT)
subprocess.check_call(['diamond', 'help'], stdout=open(os.devnull, 'w'), stderr=subprocess.STDOUT)
except:
logging.error("Make sure diamond is on your system path.")
sys.exit(1)
Expand Down Expand Up @@ -98,7 +98,7 @@ def __call_diamond(self, seq_object, diamond_output):
diamond_working_dir.name)

logging.debug(cmd)
subprocess.call(cmd, shell=True)
subprocess.check_call(cmd, shell=True)
logging.debug('Finished Running DIAMOND')
except Exception as e:
logging.error('An error occured while running DIAMOND: {}'.format(e))
Expand Down
4 changes: 1 addition & 3 deletions checkm2/prodigal.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,8 @@ def areORFsCalled(self, bNucORFs):
def checkForProdigal(self):
"""Check to see if Prodigal is on the system before we try to run it."""

# Assume that a successful prodigal -h returns 0 and anything
# else returns something non-zero
try:
subprocess.call(['prodigal', '-h'], stdout=open(os.devnull, 'w'), stderr=subprocess.STDOUT)
subprocess.check_call(['prodigal', '-h'], stdout=open(os.devnull, 'w'), stderr=subprocess.STDOUT)
except:
logging.error("Make sure prodigal is on your system path.")
sys.exit(1)
Expand Down