def test_outputbasename(self): ''' Test that the outputfile parameter works with just a basename ''' os.mkdir('basename') os.symlink(self.sff, os.path.join('basename', 'sff1.sff')) outfile = bwa.compile_reads('basename', 'outputfile.fastq') eq_('outputfile.fastq', outfile) eq_(seqio.reads_in_file(self.sff), seqio.reads_in_file(outfile))
def test_outputabsrelpath(self): ''' Test that the outputfile parameter works with a relative or abs path ''' os.mkdir('absrel') os.symlink(self.sff, os.path.join('absrel', 'sff1.sff')) outfile = bwa.compile_reads('absrel', 'absrel/outputfile.fastq') eq_('absrel/outputfile.fastq', outfile) eq_(seqio.reads_in_file(self.sff), seqio.reads_in_file('absrel/outputfile.fastq'))
def test_paramdirfastqonly(self): ''' Directory of only fastq ''' os.mkdir('fastq') os.symlink(self.fastq, os.path.join('fastq', 'fq1.fastq')) os.symlink(self.fastq, os.path.join('fastq', 'fq2.fastq')) outfile = bwa.compile_reads('fastq') expected_readcount = seqio.reads_in_file(self.sff) * 2 self._isfastq(outfile) eq_(expected_readcount, seqio.reads_in_file(outfile))
def test_paramdirsffonly(self): ''' Directory of only sff files ''' os.mkdir('sffs') os.symlink(self.sff, os.path.join('sffs', 'sff1.sff')) os.symlink(self.sff, os.path.join('sffs', 'sff2.sff')) outfile = bwa.compile_reads('sffs') expected_readcount = seqio.reads_in_file(self.sff) * 2 self._isfastq(outfile) eq_(expected_readcount, seqio.reads_in_file(outfile))
def test_paramdirmixed(self): ''' Directory of sff & fastq ''' os.mkdir('mixed') os.symlink(self.sff, os.path.join('mixed', 'sff1.sff')) os.symlink(self.fastq, os.path.join('mixed', 'fq1.fastq')) outfile = bwa.compile_reads('mixed') expected_readcount = seqio.reads_in_file( self.sff ) + \ seqio.reads_in_file( self.fastq ) self._isfastq(outfile) eq_(expected_readcount, seqio.reads_in_file(outfile))
def readsinfiletest( self, fafile, expectedlines ): eq_( seqio.reads_in_file( fafile ), expectedlines )
def readsinfiletest(self, fafile, expectedlines): eq_(seqio.reads_in_file(fafile), expectedlines)