Skip to content
Snippets Groups Projects
Commit d01c71cf authored by Ariane Delrocq's avatar Ariane Delrocq
Browse files

Start testing multiple alignment function, uncompleted

parent 5badb668
No related branches found
No related tags found
No related merge requests found
......@@ -54,6 +54,17 @@ class AlignmentSeqTestCase(unittest.TestCase):
seq2 = next(records)
yield seq1, seq2, filename
def get_dataset_records(self):
"""Generator function to iterate over the record generator of each
unaligned fasta file.
"""
dataset_dir = os.path.join(self.balibase_path, "RV11.unaligned")
for filename in os.listdir(dataset_dir):
records = Bio.SeqIO.parse(
os.path.join(dataset_dir, filename),
"fasta")
yield records, filename
def assertSameResidues(self, str1, str2):
"""Strip strings of their '-' before comparing them
"""
......@@ -167,6 +178,31 @@ class AlignmentSeqTestCase(unittest.TestCase):
print(ex_r2)
raise
# =============================================================================
# def test_multiple_align(self):
# """Tests the multiple_align function (using blosum and gap extension)."""
# #from alignementseq import multiple_align
# from Bio.Align.Applications import ClustalwCommandline
# from Bio import AlignIO
# import pip
#
# if not os.path.isfile("clustalo.py"):
# print("Fetching clustalo.py from Github...")
# urllib.request.urlretrieve(
# "https://raw.githubusercontent.com/ebi-wp/webservice-clients/master/python/clustalo.py",
# "clustalo.py")
# pip.main(["install --upgrade", "xmltramp2"])
# #pip("install --upgrade xmltramp2")
# print("Done")
# import clustalo
# # How to use: python clustalo.py --email <your@email.com> --sequence sp:wap_rat,sp:wap_mouse,sp:wap_pig
#
# for records, filename in self.get_dataset_records():
# clustalo("ariane.delrocq@polytechnique.edu", *list(records))
#
# print("Fine", filename)
# =============================================================================
class PerformanceTestCase(AlignmentSeqTestCase):
"""Performance tests, slow.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment