def testLengthOne(self): """ A FASTA list with just one item gets de-duped to the same one item. """ reads = Reads() reads.add(Read('id', 'GGG')) self.assertEqual(list(dedupFasta(reads)), [Read('id', 'GGG')])
def testLengthOne(self): """ A FASTA list with just one item gets de-duped to the same one item. """ seq = '>hey\nagtcagtcagtc' s1 = SeqIO.read(StringIO(seq), 'fasta') self.assertEqual(list(dedupFasta([s1])), [s1])
def testRemovalOfIdenticalSequences(self): """ A list with 2 copies of the same seq is de-duped to have 1 copy. """ reads = Reads() reads.add(Read('id', 'GGG')) reads.add(Read('id', 'GGG')) self.assertEqual(list(dedupFasta(reads)), [Read('id', 'GGG')])
def testRemovalOfIdenticalSequencesWithDifferingIds(self): """ A list with 2 copies of the same seq is de-duped to have 1 copy, including when the read ids differ. """ reads = Reads() reads.add(Read('id1', 'GGG')) reads.add(Read('id2', 'GGG')) self.assertEqual(list(dedupFasta(reads)), [Read('id1', 'GGG')])
def testRemovalOfIdenticalSequences(self): """A list with 2 copies of the same seq is de-duped to have 1 copy.""" seq = '>hey\nagtcagtcagtc' s1 = SeqIO.read(StringIO(seq), 'fasta') s2 = SeqIO.read(StringIO(seq), 'fasta') self.assertEqual(list(dedupFasta([s1, s2])), [s1])
def testEmpty(self): """An empty FASTA list gets de-duped to an empty list.""" self.assertEqual(list(dedupFasta([])), [])
def testEmpty(self): """ An empty FASTA list gets de-duped to an empty list. """ self.assertEqual(list(dedupFasta([])), [])