コード例 #1
0
ファイル: interleave.py プロジェクト: nds/Fastaq
def run(description):
    parser = argparse.ArgumentParser(
        description = description,
        usage = 'fastaq interleave <infile_1> <infile_2> <outfile>')
    parser.add_argument('infile_1', help='Name of first input file')
    parser.add_argument('infile_2', help='Name of second input file')
    parser.add_argument('outfile', help='Name of output file of interleaved reads')
    options = parser.parse_args()
    tasks.interleave(options.infile_1, options.infile_2, options.outfile)
コード例 #2
0
ファイル: interleave.py プロジェクト: nds/Fastaq
def run(description):
    parser = argparse.ArgumentParser(
        description=description,
        usage='fastaq interleave <infile_1> <infile_2> <outfile>')
    parser.add_argument('infile_1', help='Name of first input file')
    parser.add_argument('infile_2', help='Name of second input file')
    parser.add_argument('outfile',
                        help='Name of output file of interleaved reads')
    options = parser.parse_args()
    tasks.interleave(options.infile_1, options.infile_2, options.outfile)
コード例 #3
0
ファイル: interleave.py プロジェクト: martinghunt/Fastaq
def run(description):
    parser = argparse.ArgumentParser(
        description = description,
        usage = 'fastaq interleave <infile_1> <infile_2> <outfile>')
    parser.add_argument('--suffix1', help='Suffix to add to all names from infile_1 (if suffix not already present)')
    parser.add_argument('--suffix2', help='Suffix to add to all names from infile_2 (if suffix not already present)')
    parser.add_argument('infile_1', help='Name of first input file')
    parser.add_argument('infile_2', help='Name of second input file')
    parser.add_argument('outfile', help='Name of output file of interleaved reads')
    options = parser.parse_args()
    tasks.interleave(
        options.infile_1,
        options.infile_2,
        options.outfile,
        suffix1=options.suffix1,
        suffix2=options.suffix2
    )
コード例 #4
0
ファイル: interleave.py プロジェクト: jhh130910/code-test
def run(description):
    parser = argparse.ArgumentParser(
        description=description,
        usage='fastaq interleave <infile_1> <infile_2> <outfile>')
    parser.add_argument(
        '--suffix1',
        help=
        'Suffix to add to all names from infile_1 (if suffix not already present)'
    )
    parser.add_argument(
        '--suffix2',
        help=
        'Suffix to add to all names from infile_2 (if suffix not already present)'
    )
    parser.add_argument('infile_1', help='Name of first input file')
    parser.add_argument('infile_2', help='Name of second input file')
    parser.add_argument('outfile',
                        help='Name of output file of interleaved reads')
    options = parser.parse_args()
    tasks.interleave(options.infile_1,
                     options.infile_2,
                     options.outfile,
                     suffix1=options.suffix1,
                     suffix2=options.suffix2)
コード例 #5
0
ファイル: tasks_test.py プロジェクト: jhh130910/code-test
    def test_interleave(self):
        '''Check that interleave works as expected'''
        tmp = 'tmp.interleaved.fa'
        tasks.interleave(
            os.path.join(data_dir, 'sequences_test_deinterleaved_1.fa'),
            os.path.join(data_dir, 'sequences_test_deinterleaved_2.fa'), tmp)
        self.assertTrue(
            filecmp.cmp(
                os.path.join(data_dir, 'sequences_test_interleaved.fa'), tmp))

        tasks.interleave(
            os.path.join(data_dir,
                         'sequences_test_deinterleaved_no_suffixes_1.fa'),
            os.path.join(data_dir,
                         'sequences_test_deinterleaved_no_suffixes_2.fa'),
            tmp,
            suffix1='/1',
            suffix2='/2')
        self.assertTrue(
            filecmp.cmp(
                os.path.join(data_dir,
                             'sequences_test_interleaved_with_suffixes.fa'),
                tmp))

        with self.assertRaises(tasks.Error):
            tasks.interleave(
                os.path.join(data_dir,
                             'sequences_test_deinterleaved_bad_1.fa'),
                os.path.join(data_dir,
                             'sequences_test_deinterleaved_bad_2.fa'), tmp)

        with self.assertRaises(tasks.Error):
            tasks.interleave(
                os.path.join(data_dir,
                             'sequences_test_deinterleaved_bad2_1.fa'),
                os.path.join(data_dir,
                             'sequences_test_deinterleaved_bad2_2.fa'), tmp)
        os.unlink(tmp)
コード例 #6
0
ファイル: tasks_test.py プロジェクト: martinghunt/Fastaq
    def test_interleave(self):
        '''Check that interleave works as expected'''
        tmp = 'tmp.interleaved.fa'
        tasks.interleave(os.path.join(data_dir, 'sequences_test_deinterleaved_1.fa'),
                         os.path.join(data_dir, 'sequences_test_deinterleaved_2.fa'),
                         tmp)
        self.assertTrue(filecmp.cmp(os.path.join(data_dir, 'sequences_test_interleaved.fa'), tmp))

        tasks.interleave(os.path.join(data_dir, 'sequences_test_deinterleaved_no_suffixes_1.fa'),
                         os.path.join(data_dir, 'sequences_test_deinterleaved_no_suffixes_2.fa'),
                         tmp, suffix1='/1', suffix2='/2')
        self.assertTrue(filecmp.cmp(os.path.join(data_dir, 'sequences_test_interleaved_with_suffixes.fa'), tmp))

        with self.assertRaises(tasks.Error):
            tasks.interleave(os.path.join(data_dir, 'sequences_test_deinterleaved_bad_1.fa'),
                             os.path.join(data_dir, 'sequences_test_deinterleaved_bad_2.fa'),
                             tmp)

        with self.assertRaises(tasks.Error):
            tasks.interleave(os.path.join(data_dir, 'sequences_test_deinterleaved_bad2_1.fa'),
                             os.path.join(data_dir, 'sequences_test_deinterleaved_bad2_2.fa'),
                             tmp)
        os.unlink(tmp)