def test_iterate_genbank_with_dict_return():
    """iterate_genbank with default options"""
    # first, from text
    for entry in iterate_genbank(TEN_DLOOPS_TEXT):
        assert isinstance(entry, dict)
    # next, from file
    for entry in iterate_genbank(TEN_DLOOPS_FILEPATH):
        assert isinstance(entry, dict)
def test_iterate_genbank_with_raw_return():
    """iterate_genbank with raw option"""
    # first, from text
    for entry in iterate_genbank(TEN_DLOOPS_TEXT, raw=True):
        assert isinstance(entry, str)
    # next, from file
    for entry in iterate_genbank(TEN_DLOOPS_FILEPATH, raw=True):
        assert isinstance(entry, str)
Beispiel #3
0
    OUTPUT: list of 2 ints (changed)
    """
    five_prime = 50
    three_prime = 92
    new_positions = [pos_list[0]-five_prime, \
    pos_list[1]+three_prime]
    return new_positions


if __name__ == '__main__':
    hn_sequences = []
    all_accessions = []
    hn_accessions = []
    hn_translations = []

    for entry in iterate_genbank(INPUTFILE):
        hn = False
        accession = entry['accession']
        all_accessions.append(accession)
        features = entry['features']
        if features:
            source = features[0]
            for element in features:
                if element[0] == 'CDS':
                    cds = element
                    cds_content = cds[1]
                    position = make_integers(cds_content.pop(0).split('..'))
                    product = dict(cds_content).get('product')
                    translation = Seq(
                        dict(cds_content).get('translation').strip('"'))
                    for words in KEYWORDS: