/usr/lib/python3/dist-packages/screed/seqparse.py is in python3-screed 1.0-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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | # Copyright (c) 2008, Michigan State University.
"""
seqparse contains custom sequence parsers for extending screed's
functionality to arbitrary sequence formats. An example 'hava'
parser is included for API reference
"""
from __future__ import absolute_import
import os
from .createscreed import create_db
from .openscreed import ScreedDB
from . import openscreed
from . import fastq
from . import fasta
from . import hava
# [AN] these functions look strangely similar
def read_fastq_sequences(filename):
"""
Function to parse text from the given FASTQ file into a screed database
"""
# Will raise an exception if the file doesn't exist
iterfunc = openscreed.Open(filename, parse_description=True)
# Create the screed db
create_db(filename, fastq.FieldTypes, iterfunc)
return ScreedDB(filename)
def read_fasta_sequences(filename):
"""
Function to parse text from the given FASTA file into a screed database
"""
# Will raise an exception if the file doesn't exist
iterfunc = openscreed.Open(filename, parse_description=True)
# Create the screed db
create_db(filename, fasta.FieldTypes, iterfunc)
return ScreedDB(filename)
def read_hava_sequences(filename):
"""
Function to parse text from the given HAVA file into a screed database
"""
# Will raise an exception if the file doesn't exist
theFile = open(filename, "rb")
# Setup the iterator function
iterfunc = hava.hava_iter(theFile)
# Create the screed db
create_db(filename, hava.FieldTypes, iterfunc)
theFile.close()
return ScreedDB(filename)
|