Example #1
0
def extract_sequences(file):
    scanner = NCBIStandalone._Scanner()
    consumer = SequencesExtractor()

    file_to_parse = open(file, 'r')

    
    scanner.feed(file_to_parse, consumer)

    file_to_parse.close()

    return consumer.sequences_list
Example #2
0
        handle = func("/somewhere/blast", "blastz", "nr",
                      "/tmp/example.fasta", \
                      nprocessors=4,
                      expectation="0.001",
                      filter= "F > /etc/passwd'")
        assert False, "Attempted output redirection not caught!"
    except ValueError, e:
        assert str(e) == "Rejecting suspicious argument for filter"
        #Good


### _Scanner

print "Running tests on _Scanner"

scanner = NCBIStandalone._Scanner()
for test in all_tests:
    print "*" * 50, "TESTING %s" % test
    datafile = os.path.join("Blast", test)
    scanner.feed(open(datafile), ParserSupport.AbstractConsumer())

for test in detailed_tests:
    print "*" * 50, "TESTING %s" % test
    datafile = os.path.join("Blast", test)
    scanner.feed(open(datafile), ParserSupport.TaggingConsumer())

### BlastParser

print "Running tests on BlastParser"

parser = NCBIStandalone.BlastParser()