Exemple #1
0
def main(args):

    logging.info(" ========> filter_fastafile.py")

    logging.info("ARGS %s" % args)

    ff = FastaFile(args.fastafile)
    filterstr = args.str
    seqs = []

    seq = ff.nextSeq()

    while seq is not None:
        seqs.append(seq)
        seq = ff.nextSeq()

    newseqs = FastaFilter.filterById(seqs, args.str)

    print FastaFile.toString(newseqs)
Exemple #2
0
import re
import os
import sys
import unittest

from datamodel.factory.FastaFile import FastaFile

import importlib

ff = FastaFile(sys.argv[1])
id = sys.argv[2]

seq = ff.nextSeq()

while seq is not None:
    if seq['id'] == id:
        str = FastaFile.toString([seq])
        print str
        exit()
    seq = ff.nextSeq()