Exemple #1
0
 def test_filter_gap_high_entropy_low(self):
     result = filter_positions(self.alignment_with_gaps,
                               self.maximum_gap_frequency_100,
                               self.maximum_position_entropy_10)
     aln = Alignment([BiologicalSequence('A-', id="seq1"),
                      BiologicalSequence('A-', id="seq2"),
                      BiologicalSequence('A-', id="seq3"),
                      BiologicalSequence('A-', id="seq4")])
     self.assertEqual(result, aln)
Exemple #2
0
 def test_filter_gap_high_entropy_low(self):
     result = filter_positions(self.alignment_with_gaps,
                               self.maximum_gap_frequency_100,
                               self.maximum_position_entropy_10)
     aln = Alignment([
         BiologicalSequence('A-', id="seq1"),
         BiologicalSequence('A-', id="seq2"),
         BiologicalSequence('A-', id="seq3"),
         BiologicalSequence('A-', id="seq4")
     ])
     self.assertEqual(result, aln)
    def test_filter_gap_high_entropy_low(self):
        result = filter_positions(self.alignment_with_gaps,
                                  self.maximum_gap_frequency_100,
                                  self.maximum_position_entropy_10)
        aln = TabularMSA([
            DNA('A-', metadata={'id': "seq1"}),
            DNA('A-', metadata={'id': "seq2"}),
            DNA('A-', metadata={'id': "seq3"}),
            DNA('A-', metadata={'id': "seq4"})
        ])

        self.assertEqual(str(result), str(aln))
Exemple #4
0
def filter_alignment_positions(aligned_sequences_file: AlignedDNAFASTAFormat,
                               maximum_gap_frequency: str,
                               maximum_position_entropy: str) -> \
        AlignedDNAFASTAFormat:
    aligned_sequences_fh = aligned_sequences_file.open()

    fasta_file = AlignedDNAFASTAFormat()

    skbio.write(filter_positions(aligned_sequences_fh, maximum_gap_frequency,
                                 maximum_position_entropy),
                into=str(fasta_file),
                format='fasta')

    return fasta_file
Exemple #5
0
    def test_filter_gap_high_entropy_low(self):
        result = filter_positions(
            self.alignment_with_gaps, self.maximum_gap_frequency_100, self.maximum_position_entropy_10
        )
        aln = TabularMSA(
            [
                DNA("A-", metadata={"id": "seq1"}),
                DNA("A-", metadata={"id": "seq2"}),
                DNA("A-", metadata={"id": "seq3"}),
                DNA("A-", metadata={"id": "seq4"}),
            ]
        )

        self.assertEqual(str(result), str(aln))