def run(description): parser = argparse.ArgumentParser( description = 'Creates a file of contigs from a file of scaffolds - i.e. breaks at every gap in the input', usage = 'fastaq scaffolds_to_contigs [options] <infile> <outfile>') parser.add_argument('--number_contigs', action='store_true', help='Use this to enumerate contig names 1,2,3,... within each scaffold') parser.add_argument('infile', help='Name of input file') parser.add_argument('outfile', help='Name of output contigs file') options = parser.parse_args() tasks.scaffolds_to_contigs(options.infile, options.outfile, number_contigs=options.number_contigs)
def test_scaffolds_to_contigs(self): '''Test scaffolds_to_contigs''' tmp = 'tmp.contigs.fa' tasks.scaffolds_to_contigs( os.path.join(data_dir, 'utils_test_scaffolds.fa'), tmp) self.assertTrue( filecmp.cmp( os.path.join(data_dir, 'utils_test_scaffolds.fa.to_contigs.fa'), tmp)) os.unlink(tmp)
def test_scaffolds_to_contigs_number_contigs(self): '''Test scaffolds_to_contigs with contig numbering''' tmp = 'tmp.contigs.fa' tasks.scaffolds_to_contigs(os.path.join(data_dir, 'utils_test_scaffolds.fa'), tmp, number_contigs=True) self.assertTrue( filecmp.cmp( os.path.join( data_dir, 'utils_test_scaffolds.fa.to_contigs.number_contigs.fa'), tmp)) os.unlink(tmp)
def run(description): parser = argparse.ArgumentParser( description= 'Creates a file of contigs from a file of scaffolds - i.e. breaks at every gap in the input', usage='fastaq scaffolds_to_contigs [options] <infile> <outfile>') parser.add_argument( '--number_contigs', action='store_true', help='Use this to enumerate contig names 1,2,3,... within each scaffold' ) parser.add_argument('infile', help='Name of input file') parser.add_argument('outfile', help='Name of output contigs file') options = parser.parse_args() tasks.scaffolds_to_contigs(options.infile, options.outfile, number_contigs=options.number_contigs)
def test_scaffolds_to_contigs_number_contigs(self): '''Test scaffolds_to_contigs with contig numbering''' tmp = 'tmp.contigs.fa' tasks.scaffolds_to_contigs(os.path.join(data_dir, 'utils_test_scaffolds.fa'), tmp, number_contigs=True) self.assertTrue(filecmp.cmp(os.path.join(data_dir, 'utils_test_scaffolds.fa.to_contigs.number_contigs.fa'), tmp)) os.unlink(tmp)
def test_scaffolds_to_contigs(self): '''Test scaffolds_to_contigs''' tmp = 'tmp.contigs.fa' tasks.scaffolds_to_contigs(os.path.join(data_dir, 'utils_test_scaffolds.fa'), tmp) self.assertTrue(filecmp.cmp(os.path.join(data_dir, 'utils_test_scaffolds.fa.to_contigs.fa'), tmp)) os.unlink(tmp)