def test_cat(): 'It tests the cat function' inh1 = StringIO.StringIO('>seq1\nACTG\n') inh2 = StringIO.StringIO('>seq2\nGTCA\n') outh = StringIO.StringIO() cat(infiles=[inh1, inh2], outfile=outh) assert outh.getvalue() == '>seq1\nACTG\n>seq2\nGTCA\n' #it works also with None Values outh = StringIO.StringIO() cat(infiles=[None, None], outfile=outh) assert outh.getvalue() == ''
def _cat_to_fasta(self, files, fasta_fhand, qual_fhand): 'It cats the given files together and it returns a fasta and qual' #all files should be in fasta and qual fastas, quals = self._files_to_temp_fasta(files) cat(fastas, fasta_fhand) cat(quals , qual_fhand)