def run(description): parser = argparse.ArgumentParser( description='Converts CAF file to FASTQ format', usage='fastaq caf_to_fastq [options] <infile> <outfile>') parser.add_argument('infile', help='Name of input CAF file.') parser.add_argument('outfile', help='Name of output FASTQ file') parser.add_argument( '-c', '--clip', action='store_true', help= 'Use clipping info to clip reads, if present in the input CAF file (as lines of the form "Clipping QUAL start end"). Default is to not clip' ) parser.add_argument( '-l', '--min_length', type=int, help='Minimum length of sequence to output [%(default)s]', default=1, metavar='INT') options = parser.parse_args() tasks.caf_to_fastq(options.infile, options.outfile, trim=options.clip, min_length=options.min_length)
def test_caf_to_fastq_default(self): '''Test caf_to_fastq with no filtering''' tmpfile = 'tmp.fq' tasks.caf_to_fastq(os.path.join(data_dir, 'caf_test.caf'), tmpfile) self.assertTrue( filecmp.cmp(os.path.join( data_dir, 'caf_test.to_fastq.no_trim.min_length_0.fq'), tmpfile, shallow=False)) os.unlink(tmpfile)
def test_caf_to_fastq_trim_and_min_length(self): '''Test caf_to_fastq with trimming and min_length''' tmpfile = 'tmp.fq' tasks.caf_to_fastq(os.path.join(data_dir, 'caf_test.caf'), tmpfile, trim=True, min_length=6) self.assertTrue( filecmp.cmp(os.path.join(data_dir, 'caf_test.to_fastq.trim.min_length_6.fq'), tmpfile, shallow=False)) os.unlink(tmpfile)
def run(description): parser = argparse.ArgumentParser( description="Converts CAF file to FASTQ format", usage="fastaq caf_to_fastq [options] <infile> <outfile>" ) parser.add_argument("infile", help="Name of input CAF file.") parser.add_argument("outfile", help="Name of output FASTQ file") parser.add_argument( "-c", "--clip", action="store_true", help='Use clipping info to clip reads, if present in the input CAF file (as lines of the form "Clipping QUAL start end"). Default is to not clip', ) parser.add_argument( "-l", "--min_length", type=int, help="Minimum length of sequence to output [%(default)s]", default=1, metavar="INT", ) options = parser.parse_args() tasks.caf_to_fastq(options.infile, options.outfile, trim=options.clip, min_length=options.min_length)
def test_caf_to_fastq_trim_and_min_length(self): '''Test caf_to_fastq with trimming and min_length''' tmpfile = 'tmp.fq' tasks.caf_to_fastq(os.path.join(data_dir, 'caf_test.caf'), tmpfile, trim=True, min_length=6) self.assertTrue(filecmp.cmp(os.path.join(data_dir, 'caf_test.to_fastq.trim.min_length_6.fq'), tmpfile, shallow=False)) os.unlink(tmpfile)
def test_caf_to_fastq_default(self): '''Test caf_to_fastq with no filtering''' tmpfile = 'tmp.fq' tasks.caf_to_fastq(os.path.join(data_dir, 'caf_test.caf'), tmpfile) self.assertTrue(filecmp.cmp(os.path.join(data_dir, 'caf_test.to_fastq.no_trim.min_length_0.fq'), tmpfile, shallow=False)) os.unlink(tmpfile)