/usr/share/pyshared/cogent/parse/paml.py is in python-cogent 1.5.3-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 30 | #!/usr/bin/env python
__author__ = "Peter Maxwell"
__copyright__ = "Copyright 2007-2012, The Cogent Project"
__credits__ = ["Peter Maxwell", "Gavin Huttley"]
__license__ = "GPL"
__version__ = "1.5.3"
__maintainer__ = "Peter Maxwell"
__email__ = "pm67nz@gmail.com"
__status__ = "Production"
def PamlParser(f):
d = f.readline().split()
numseqs, seqlen = int(d[0]), int(d[1])
for i in range(numseqs):
seqname = f.readline().strip()
if not seqname:
raise ValueError('Sequence name missing')
currseq = []
length = 0
while length < seqlen:
seq_line = f.readline()
if not seq_line:
raise ValueError('Sequence "%s" is short: %s < %s' %
(seqname, length, seqlen))
seq_line = seq_line.strip()
length += len(seq_line)
currseq.append(seq_line)
yield (seqname, ''.join(currseq))
|