I'm trying to run a profile HMM via Python. I've found a Python 2 package (SimpleHMMER: https://pypi.python.org/pypi/SimpleHMMER/0.2.1) that runs HMMER3 and parses the output. However, the package is not able to create HMM profiles. My goal is to create HMM profiles from a continuously updated consensus file, which will require an iterating script. I've only been able to find a command line tool for creating hmm profiles (hmmbuild: http://www.csb.yale.edu/userguides/seq/hmmer/docs/node19.html). I understand you can iterate hmmbuild via command line (https://www.biostars.org/p/117174/). Assuming hmmbuild is unavailable in python, would it be possible to run hmmbuild through command line and call functions within a python file to process the hmm profile? I've got limited experience with command line and have never run a python script via command line. Are there any alternative profile HMM tools that are implemented in Python?
I may not understand what you want to do correctly. But how about using subprocess.run (or call) or Popen https://docs.python.org/3/library/subprocess.html ?
Thanks for the quick response. Looks like that might do the trick. I'll give it a try.