/usr/share/pyshared/cogent/parse/cut.py is in python-cogent 1.5.1-2.
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 | #!/usr/bin/env python
"""Parser for the EMBOSS .cut codon usage table.
Currently just reads the codons and their counts into a dict.
"""
__author__ = "Rob Knight"
__copyright__ = "Copyright 2007-2011, The Cogent Project"
__contributors__ = ["Rob Knight"]
__license__ = "GPL"
__version__ = "1.5.1"
__maintainer__ = "Rob Knight"
__email__ = "rob@spot.colorado.edu"
__status__ = "Development"
def cut_parser(lines):
"""cut format parser
Takes lines from a cut file as input.
returns dict of {codon:count}.
"""
result = {}
for line in lines:
if line.startswith('#'):
continue
if not line.strip():
continue
fields = line.split()
result[fields[0]] = float(fields[-1])
return result
|