<s> '''<STR_LIT>''' <EOL> import unittest <EOL> import StringIO <EOL> import ngsutils . fastq . fromqseq <EOL> class FromQseqTest ( unittest . TestCase ) : <EOL> def testQseq ( self ) : <EOL> qseq = StringIO . StringIO ( '''<STR_LIT>''' . replace ( '<STR_LIT:|>' , '<STR_LIT:\t>' ) ) <EOL> out = StringIO . StringIO ( '<STR_LIT>' ) <EOL> ngsutils . fastq . fromqseq . read_illumina_export ( ngsutils . fastq . fromqseq . qseq_reader ( fileobj = qseq ) , out = out ) <EOL> self . assertEqual ( out . getvalue ( ) , '''<STR_LIT>''' ) <EOL> def testQseqTag ( self ) : <EOL> qseq = StringIO . StringIO ( '''<STR_LIT>''' . replace ( '<STR_LIT:|>' , '<STR_LIT:\t>' ) ) <EOL> out = StringIO . StringIO ( '<STR_LIT>' ) <EOL> ngsutils . fastq . fromqseq . read_illumina_export ( ngsutils . fastq . fromqseq . qseq_reader ( fileobj = qseq ) , tag = '<STR_LIT>' , out = out ) <EOL> self . assertEqual ( out . getvalue ( ) , '''<STR_LIT>''' ) <EOL> def testQseqLength ( self ) : <EOL> qseq = StringIO . StringIO ( '''<STR_LIT>''' . replace ( '<STR_LIT:|>' , '<STR_LIT:\t>' ) ) <EOL> out = StringIO . StringIO ( '<STR_LIT>' ) <EOL> results = ngsutils . fastq . fromqseq . read_illumina_export ( ngsutils . fastq . fromqseq . qseq_reader ( fileobj = qseq ) , trim = True , min_length = <NUM_LIT:8> , out = out ) <EOL> self . assertEqual ( results . reads , <NUM_LIT:3> ) <EOL> self . assertEqual ( results . qcfailed , <NUM_LIT:1> ) <EOL> self . assertEqual ( results . lenfailed , <NUM_LIT:1> ) <EOL> self . assertEqual ( results . passed , <NUM_LIT:1> ) <EOL> self . assertEqual ( results . lengths [ <NUM_LIT:8> ] , <NUM_LIT:1> ) <EOL> self . assertEqual ( out . getvalue ( ) , '''<STR_LIT>''' ) <EOL> def testQseqQCFail ( self ) : <EOL> qseq = StringIO . StringIO ( '''<STR_LIT>''' . replace ( '<STR_LIT:|>' , '<STR_LIT:\t>' ) ) <EOL> out = StringIO . StringIO ( '<STR_LIT>' ) <EOL> ngsutils . fastq . fromqseq . read_illumina_export ( ngsutils . fastq . fromqseq . qseq_reader ( fileobj = qseq ) , out = out ) <EOL> self . assertEqual ( out . getvalue ( ) , '''<STR_LIT>''' ) <EOL> def testQseqQC ( self ) : <EOL> qseq = StringIO . StringIO ( '''<STR_LIT>''' . replace ( '<STR_LIT:|>' , '<STR_LIT:\t>' ) ) <EOL> out = StringIO . StringIO ( '<STR_LIT>' ) <EOL> ngsutils . fastq . fromqseq . read_illumina_export ( ngsutils . fastq . fromqseq . qseq_reader ( fileobj = qseq ) , qc_remove = False , out = out ) <EOL> self . assertEqual ( out . getvalue ( ) , '''<STR_LIT>''' ) <EOL> def testQseqSolexa ( self ) : <EOL> qseq = StringIO . StringIO ( '''<STR_LIT>''' . replace ( '<STR_LIT:|>' , '<STR_LIT:\t>' ) ) <EOL> out = StringIO . StringIO ( '<STR_LIT>' ) <EOL> ngsutils . fastq . fromqseq . read_illumina_export ( ngsutils . fastq . fromqseq . qseq_reader ( fileobj = qseq ) , solexa_quals = True , out = out ) <EOL> self . assertEqual ( out . getvalue ( ) , '''<STR_LIT>''' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
