Exemplo n.º 1
0
def test_fasta2clustal_squizz():
    infile = bioconvert_data("squizz.fasta")
    outfile = bioconvert_data("squizz.clustal")
    with TempFile(suffix=".clustal") as tempfile:
        converter = FASTA2CLUSTAL(infile, tempfile.name)
        converter(method='squizz')

        # Check that the output is correct with a checksum
        assert md5(tempfile.name) == md5(outfile)
Exemplo n.º 2
0
def test_fasta2clustal_goalign():
    infile = bioconvert_data("goalign.fasta")
    outfile = bioconvert_data("goalign.clustal")
    with TempFile(suffix=".clustal") as tempfile:
        converter = FASTA2CLUSTAL(infile, tempfile.name)
        converter(method='goalign')

        ## We remove goalign version from the first line
        out = ""
        with open(tempfile.name) as f:
            lines = f.readlines()
            if len(lines)>0:
                clustal = lines[0].split(" ")
                if len(clustal) > 0:
                    lines[0]=clustal[0]+"\n"
            out = ''.join(lines)

        # Check that the output is correct with a checksum
        assert hashlib.md5(out.encode('utf-8')).hexdigest() == md5(outfile)