Пример #1
0
 def test_string_representation(self):
     from tinyfasta import FastaRecord
     fasta_record = FastaRecord(">seq101|testing\n")
     fasta_record.add_sequence_line("atta\n")
     fasta_record.add_sequence_line("TAAT")
     self.assertEqual(str(fasta_record),
         '\n'.join([">seq101|testing", "atta", "TAAT"]))
Пример #2
0
 def test_seqence_contains_function_no_file(self):
     from tinyfasta import FastaRecord
     fasta_record = FastaRecord(">seq101|testing\n")
     fasta_record.add_sequence_line("AAAT")
     fasta_record.add_sequence_line("TAAA")
     self.assertTrue(fasta_record.sequence.contains("ATTA"))
     self.assertFalse(fasta_record.sequence.contains("ACCA"))
Пример #3
0
 def test_string_representation(self):
     from tinyfasta import FastaRecord
     fasta_record = FastaRecord(">seq101|testing\n")
     fasta_record.add_sequence_line("atta\n")
     fasta_record.add_sequence_line("TAAT")
     self.assertEqual(str(fasta_record),
                      '\n'.join([">seq101|testing", "atta", "TAAT"]))
Пример #4
0
 def test_seqence_contains_function_no_file(self):
     from tinyfasta import FastaRecord
     fasta_record = FastaRecord(">seq101|testing\n")
     fasta_record.add_sequence_line("AAAT")
     fasta_record.add_sequence_line("TAAA")
     self.assertTrue(fasta_record.sequence.contains("ATTA"))
     self.assertFalse(fasta_record.sequence.contains("ACCA"))
Пример #5
0
 def test_seqence_contains_function_with_regex_no_file(self):
     import re
     regex_match = re.compile(r"A[T]{2}A")
     regex_no_match = re.compile(r"A[T]{3}A")
     from tinyfasta import FastaRecord
     fasta_record = FastaRecord(">seq101|testing\n")
     fasta_record.add_sequence_line("AAAT")
     fasta_record.add_sequence_line("TAAA")
     self.assertTrue(fasta_record.sequence.contains(regex_match))
     self.assertFalse(fasta_record.sequence.contains(regex_no_match))
Пример #6
0
 def test_seqence_contains_function_with_regex_no_file(self):
     import re
     regex_match = re.compile(r"A[T]{2}A")
     regex_no_match = re.compile(r"A[T]{3}A")
     from tinyfasta import FastaRecord
     fasta_record = FastaRecord(">seq101|testing\n")
     fasta_record.add_sequence_line("AAAT")
     fasta_record.add_sequence_line("TAAA")
     self.assertTrue(fasta_record.sequence.contains(regex_match))
     self.assertFalse(fasta_record.sequence.contains(regex_no_match))
Пример #7
0
 def test_len(self):
     from tinyfasta import FastaRecord
     fasta_record = FastaRecord(">seq101|testing\n")
     fasta_record.add_sequence_line("atta\n")
     fasta_record.add_sequence_line("TAAT")
     self.assertEqual(len(fasta_record), 8)
Пример #8
0
 def test_len(self):
     from tinyfasta import FastaRecord
     fasta_record = FastaRecord(">seq101|testing\n")
     fasta_record.add_sequence_line("atta\n")
     fasta_record.add_sequence_line("TAAT")
     self.assertEqual(len(fasta_record), 8)