Example #1
0
def test_get_exon_ranges_03():
    "get_exon_ranges() test."

    genbank_txt = utilslib.read_file('genbank/lysozyme-3-bos-taurus.gbff')
    res = e2.get_exon_ranges(genbank_txt)
    ref = [(1, 144), (144, 309), (309, 385), (385, 950)]

    assert res == ref
Example #2
0
def test_get_exon_ranges_02():
    "get_exon_ranges() test."

    genbank_txt = utilslib.read_file('genbank/lysozyme-1-mus-musculus.gbff')
    res = e2.get_exon_ranges(genbank_txt)
    ref = [(0, 166), (166, 331), (331, 410), (410, 1265)]

    assert res == ref
Example #3
0
def test_get_exon_ranges_01():
    "get_exon_ranges() test: exon keyword outside of FEATUES TRAP."

    genbank_txt = utilslib.read_file('genbank/lysozyme-3-bos-taurus-trap.gbff')
    res = e2.get_exon_ranges(genbank_txt)
    ref = [(1, 144), (144, 309), (309, 385), (385, 950)]

    assert res == ref
Example #4
0
def test_get_exon_ranges_04():
    "get_exon_ranges() test."

    genbank_txt = utilslib.read_file(
        'genbank/lysozyme-p-drosophila-melanogaster.gbff')
    res = e2.get_exon_ranges(genbank_txt)
    ref = []

    assert res == ref
Example #5
0
def test_get_dna_seq_04():
    "get_dna_seq() test."

    filename = 'lysozyme-p-drosophila-melanogaster'

    genbank_txt = utilslib.read_file(f'genbank/{filename}.gbff')
    res = e1.get_dna_seq(genbank_txt)
    ref = utilslib.read_fasta(f'fasta/{filename}.fasta')[0]

    assert res == ref
Example #6
0
def test_get_dna_seq_03():
    "get_dna_seq() test."

    filename = 'lysozyme-3-bos-taurus'

    genbank_txt = utilslib.read_file(f'genbank/{filename}.gbff')
    res = e1.get_dna_seq(genbank_txt)
    ref = utilslib.read_fasta(f'fasta/{filename}.fasta')[0]

    assert res == ref
Example #7
0
def test_get_dna_seq_01():
    "get_dna_seq() test."

    filename = 'insulin-h**o-sapiens'

    genbank_txt = utilslib.read_file(f'genbank/{filename}.gbff')
    res = e1.get_dna_seq(genbank_txt)
    ref = utilslib.read_fasta(f'fasta/{filename}.fasta')[0]

    assert res == ref
Example #8
0
def main(genbank_filename_in: str, fasta_filename_out):
    """Reads genbank_filename_in and writes its exons into fasta_filename_in.
    - Each exon starts with a comment line like this: >exon
    - Each exon is separated by a blank line from other exons.
    - The last exon does not have any whitespace nor newlines at the end.
    """

    genbank_txt = utilslib.read_file(genbank_filename_in)
    exons = get_exons(genbank_txt)
    fasta_str = make_exons_fasta_str(exons)
    utilslib.write_file(fasta_str, fasta_filename_out)