dansondergaard / tmhmm.py Goto Github PK
View Code? Open in Web Editor NEWA transmembrane helix finder in Python 3.
License: MIT License
A transmembrane helix finder in Python 3.
License: MIT License
It would be nice to be able to make poster probability plots as the original TMHMM.
When running the program using a FASTA input file with multiple sequences, all of the output was being directed to the first header. It seems that in your load_fasta_file function of your utils.py script, you forgot a line in your else statement redefining the header. For some reason, without defining a new header, the sequences and annotations were all directed to the first header of the FASTA. Putting a line in the else statement to make a new header (as I did here in line 53) seemed to resolve the issue. Thanks for writing this program!
Best,
Jason
Hi,
Thanks for creating this package. However, I am encountering an issue. Running tmhmm -m TMHMM2.0.model -f test.fa
, I get the following error message:
/anaconda3/lib/python3.6/site-packages/tmhmm/init.py:21: RuntimeWarning: divide by zero encountered in log
_, path = viterbi(sequence, *model)
Any insights/help would be greatly appreciated!
Thanks,
Paulina
Maybe just let the user do this, it's pretty easy with joblib.
This previously was working for me, but it is still possible i am doing something wrong.
I am using: annotation,pos_memb=tmhmm.predict(fasta,'TMHMM.model'), as I iterate through a list of FASTA sequences.
I am (now) getting the following error:
"TypeError: predict() missing 1 required positional argument: 'model_or_filelike'"
Any tips would be appreciated.
Traceback (most recent call last):
File "./annotate_with_hmms.py", line 180, in <module>
main()
File "./annotate_with_hmms.py", line 48, in main
annotator.find_tms()
File "./annotate_with_hmms.py", line 121, in find_tms
locations = self.run_tmhmm(gb)
File "./annotate_with_hmms.py", line 125, in run_tmhmm
annotation, posterior = tmhmm.predict(str(gb.seq), 'TMHMM2.0.model')
TypeError: predict() missing 1 required positional argument: 'model_or_filelike'
By the way, str(gb.seq)
is just protein sequence, not a fasta file name.
Hi @dansondergaard ,
I've set up a clean env to install your tool and installing just your package works, but execution results in this error
Traceback (most recent call last):
File "/home/pgsb/daniel.lang/anaconda3/envs/membrane/lib/python3.6/site-packages/pkg_resources/__init__.py", line 581, in _build_master
ws.require(__requires__)
File "/home/pgsb/daniel.lang/anaconda3/envs/membrane/lib/python3.6/site-packages/pkg_resources/__init__.py", line 898, in require
needed = self.resolve(parse_requirements(requirements))
File "/home/pgsb/daniel.lang/anaconda3/envs/membrane/lib/python3.6/site-packages/pkg_resources/__init__.py", line 789, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (numpy 1.15.4 (/home/ibis/daniel.lang/anaconda3/envs/membrane/lib/python3.6/site-packages), Requirement.parse('numpy<1.14.0,>=1.9.2'), {'scikit-bio'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pgsb/daniel.lang/anaconda3/envs/membrane/bin/tmhmm", line 6, in <module>
from pkg_resources import load_entry_point
File "/home/pgsb/daniel.lang/anaconda3/envs/membrane/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3126, in <module>
@_call_aside
File "/home/pgsb/daniel.lang/anaconda3/envs/membrane/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3110, in _call_aside
f(*args, **kwargs)
File "/home/pgsb/daniel.lang/anaconda3/envs/membrane/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3139, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/home/pgsb/daniel.lang/anaconda3/envs/membrane/lib/python3.6/site-packages/pkg_resources/__init__.py", line 583, in _build_master
return cls._build_from_requirements(__requires__)
File "/home/pgsb/daniel.lang/anaconda3/envs/membrane/lib/python3.6/site-packages/pkg_resources/__init__.py", line 596, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/home/pgsb/daniel.lang/anaconda3/envs/membrane/lib/python3.6/site-packages/pkg_resources/__init__.py", line 789, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (numpy 1.15.4 (/home/ibis/daniel.lang/anaconda3/envs/membrane/lib/python3.6/site-packages), Requirement.parse('numpy<1.14.0,>=1.9.2'), {'scikit-bio'})
Forcing downgrading to numpy==1.13.0 solves the problem.
pip install numpy==1.13.0
Easy fix would be to adjust the yml...
Thanks for sharing this nice tool - finally an open-source implementation ๐
Best,
Daniel
Hello, sorry but I have to ask as a beginer:
If trying to use tmhmm.py as a library in Python 3.8.2:
import tmhmm
annotation, posterior = tmhmm.predict(sequence, 'mymodel.model')
I do not know how to use it
I tried TMHMM2.model file getting:
"TypeError: predict() missing 1 required positional argument: "model_or_filelike"
Shall I use "TMHMM1.0.model" or "PDBseqs.fasta"?
Could you give me some advice, please?
Thank you very much.
Petr Adamek
Dear dansondergaard,
first congratulation you developed such a good software,I have installed it.if I used the test.fa,it will work successful ,But If I used a protein with a "U" in sequence,it doesn't work and produce a error.
but if I put this protein with "U" in TMHMM website,it will work and produce a prediction result. can you help how to solve this problem?
Hi,
I am getting this error.
command: tmhmm -f test.fa -m /TMHMM2.0.model
Traceback (most recent call last):
File "/usr/local/bin/tmhmm", line 10, in
sys.exit(cli())
File "/usr/local/lib/python3.7/dist-packages/tmhmm/cli.py", line 77, in cli
for entry in load_fasta_file(args.sequence_file):
File "/usr/local/lib/python3.7/dist-packages/tmhmm/utils.py", line 52, in load_fasta_file
append_entry(header, sequence_parts, entries)
File "/usr/local/lib/python3.7/dist-packages/tmhmm/utils.py", line 38, in append_entry
id, description = header.split(None, 1)
ValueError: not enough values to unpack (expected 2, got 1)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.