/usr/lib/python2.7/dist-packages/pbsuite/utils/readSummary.py is in python-pbsuite-utils 15.8.24+dfsg-2.
This file is owned by root:root, with mode 0o755.
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 | #!/usr/bin/python
import argparse, json
from pbsuite.jelly.Jelly import JellyProtocol
from pbsuite.utils.FileHandlers import FastaFile, FastqFile
from pbsuite.utils.summarizeAssembly import getStats
USAGE = """Get statistics on fasta/fastq sequences recorded in a Protocol.xml"""
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=USAGE, \
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument("xml", metavar="XML", type=str, \
help="Protocol.xml with inputs listed")
args = parser.parse_args()
protocol = JellyProtocol(args.xml)
seqLengths = []
for i in protocol.inputs:
if i.endswith(".fasta"):
f = FastaFile(i)
for j in f.values():
seqLengths.append(len(j))
if i.endswith(".fastq"):
f = FastqFile(i)
for j in f.values():
seqLengths.append(len(j.seq))
print "Read Stats", json.dumps(getStats(seqLengths), indent=4)
|