def run(description):
    parser = argparse.ArgumentParser(
        description = 'Removes duplicate sequences from input file, based on their names. If the same name is found more than once, then the longest sequence is kept. Order of sequences is preserved in output',
        usage = 'fastaq to_unique_by_id <infile> <outfile>')
    parser.add_argument('infile', help='Name of input file')
    parser.add_argument('outfile', help='Name of output file')
    options = parser.parse_args()
    tasks.to_unique_by_id(options.infile, options.outfile)
Exemple #2
0
def run(description):
    parser = argparse.ArgumentParser(
        description=
        'Removes duplicate sequences from input file, based on their names. If the same name is found more than once, then the longest sequence is kept. Order of sequences is preserved in output',
        usage='fastaq to_unique_by_id <infile> <outfile>')
    parser.add_argument('infile', help='Name of input file')
    parser.add_argument('outfile', help='Name of output file')
    options = parser.parse_args()
    tasks.to_unique_by_id(options.infile, options.outfile)
Exemple #3
0
 def test_to_unique_by_id(self):
     '''Test to_unique_by_id()'''
     tmpfile = 'tmp.unique_by_id.fa'
     tasks.to_unique_by_id(
         os.path.join(data_dir, 'sequences_test_to_unique_by_id.fa'),
         tmpfile)
     self.assertTrue(
         filecmp.cmp(
             os.path.join(data_dir,
                          'sequences_test_to_unique_by_id.fa.out'),
             tmpfile))
     os.unlink(tmpfile)
Exemple #4
0
 def test_to_unique_by_id(self):
     '''Test to_unique_by_id()'''
     tmpfile = 'tmp.unique_by_id.fa'
     tasks.to_unique_by_id(os.path.join(data_dir, 'sequences_test_to_unique_by_id.fa'), tmpfile)
     self.assertTrue(filecmp.cmp(os.path.join(data_dir, 'sequences_test_to_unique_by_id.fa.out'), tmpfile))
     os.unlink(tmpfile)