def test_verify_equivalency(self):
     """ verifies identical labels, base counts between qual and fasta """
     
     fasta_data = {'seq1':'AATC', 'seq2':'GGAT'}
     
     qual_data = {'seq1':["40", "36", "35", "18"], 
                  'seq2':["39", "18", "22", "23"]}
     
     # Should not raise any errors
     verify_equivalency(fasta_data, qual_data)
     
     # Make number of sequences unequal, and should raise error.
     fasta_data = {'seq1':'AATC', 'seq2':'GGAT', 'seq3':'ACTG'}
     
     qual_data = {'seq1':["40", "36", "35", "18"], 
                  'seq2':["39", "18", "22", "23"]}
     
     self.assertRaises(ValueError, verify_equivalency, fasta_data, qual_data)
     
     # Should raise error if lens of values different
     fasta_data = {'seq1':'AATC', 'seq2':'GGAT'}
     
     qual_data = {'seq1':["50", "40", "36", "35", "18"], 
                  'seq2':["39", "18", "22", "23"]}
     
     self.assertRaises(ValueError, verify_equivalency, fasta_data, qual_data)
Ejemplo n.º 2
0
    def test_verify_equivalency(self):
        """ verifies identical labels, base counts between qual and fasta """

        fasta_data = {'seq1': 'AATC', 'seq2': 'GGAT'}

        qual_data = {
            'seq1': ["40", "36", "35", "18"],
            'seq2': ["39", "18", "22", "23"]
        }

        # Should not raise any errors
        verify_equivalency(fasta_data, qual_data)

        # Make number of sequences unequal, and should raise error.
        fasta_data = {'seq1': 'AATC', 'seq2': 'GGAT', 'seq3': 'ACTG'}

        qual_data = {
            'seq1': ["40", "36", "35", "18"],
            'seq2': ["39", "18", "22", "23"]
        }

        self.assertRaises(ValueError, verify_equivalency, fasta_data,
                          qual_data)

        # Should raise error if lens of values different
        fasta_data = {'seq1': 'AATC', 'seq2': 'GGAT'}

        qual_data = {
            'seq1': ["50", "40", "36", "35", "18"],
            'seq2': ["39", "18", "22", "23"]
        }

        self.assertRaises(ValueError, verify_equivalency, fasta_data,
                          qual_data)