/usr/lib/python2.7/dist-packages/cogent/parse/hmmscan.py is in python-cogent 1.9-9.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #!/usr/bin/env python
"""Parse output from hmmer3"""
__author__ = "Daniel McDonald"
__copyright__ = "Copyright 2007-2016, The Cogent Project"
__credits__ = ["Daniel McDonald"]
__license__ = "GPL"
__version__ = "1.9"
__maintainer__ = "Daniel McDonald"
__email__ = "mcdonadt@colorado.edu"
__status__ = "Development"
def MinimalTbloutParser(lines):
"""Parse the .tblout output from hmmer3"""
for line in lines:
if line.startswith('#'):
continue
else:
# lines are whitespace delimited, and there are 18 fields
yield line.strip().split(None, 18)
headers_and_types = [
("target name", str),
("target accession", str), # renamed from accession due to ambiguity
("query name",str),
("query accession",str), # renamed from accession due to ambiguity
("full seq E-value",float), # renamed from E-value due to ambiguity
("full seq score",float), # renamed from score due to ambiguity
("full seq bias",float), # renamed from bias due to ambiguity
("best 1 domain E-value",float), # renamed from E-value due to ambiguity
("best 1 domain score",float), # renamed from score due to ambiguity
("best 1 domain bias",float), # renamed from bias due to ambiguity
("exp",float),
("reg",int),
("clu",int),
("ov",int),
("env",int),
("dom",int),
("rep",int),
("inc",int),
("description of target", str)]
def RichTbloutParser(lines):
"""Parse the .tblout output from hmmer3, return dicts per record"""
for rec in MinimalTbloutParser(lines):
yield dict([(h,t(r)) for (h,t),r in zip(headers_and_types, rec)])
|