def main():
    option_parser, opts, args = parse_command_line_parameters(**script_info)

    technical_lengths = get_technical_lengths(
        open(opts.input_map, 'U'), opts.debug)

    if opts.use_sfftools:
        set_sff_trimpoints_with_sfftools(
            opts.libdir, technical_lengths, opts.sffinfo_path,
            opts.sfffile_path, opts.debug)
    else:
        set_sff_trimpoints(opts.libdir, technical_lengths)
Example #2
0
def main():
    option_parser, opts, args = parse_command_line_parameters(**script_info)

    technical_lengths = get_technical_lengths(open(opts.input_map, 'U'),
                                              opts.debug)

    if opts.use_sfftools:
        set_sff_trimpoints_with_sfftools(opts.libdir, technical_lengths,
                                         opts.sffinfo_path, opts.sfffile_path,
                                         opts.debug)
    else:
        set_sff_trimpoints(opts.libdir, technical_lengths)
Example #3
0
    def test_set_sff_trimpoints_with_sfftools(self):
        _, orig_reads = parse_binary_sff(open(self.sff_fp), True)
        orig_reads = list(orig_reads)

        set_sff_trimpoints_with_sfftools(self.sff_dir, {'F6AVWTA01': 10})

        # check trimpoint file
        for line in open(self.sff_fp + '.trim'):
            toks = line.split()
            trim_start = int(toks[1])
            trim_end = int(toks[2])
            self.assertTrue(trim_start <= trim_end)
            self.assertEqual(trim_start, 11)

        # Check resultant SFF file
        _, reads = parse_binary_sff(open(self.sff_fp), True)
        for read, orig_read in zip(reads, orig_reads):
            self.assertEqual(read['clip_qual_left'], 11)
            # Check that eveything else is the same between original
            # reads and trimmed reads.
            orig_read['clip_qual_left'] = 11
            self.assertEqual(read, orig_read)
    def test_set_sff_trimpoints_with_sfftools(self):
        _, orig_reads = parse_binary_sff(open(self.sff_fp), True)
        orig_reads = list(orig_reads)

        set_sff_trimpoints_with_sfftools(self.sff_dir, {'F6AVWTA01': 10})

        # check trimpoint file
        for line in open(self.sff_fp + '.trim'):
            toks = line.split()
            trim_start = int(toks[1])
            trim_end = int(toks[2])
            self.assertTrue(trim_start <= trim_end)
            self.assertEqual(trim_start, 11)

        # Check resultant SFF file
        _, reads = parse_binary_sff(open(self.sff_fp), True)
        for read, orig_read in zip(reads, orig_reads):
            self.assertEqual(read['clip_qual_left'], 11)
            # Check that eveything else is the same between original
            # reads and trimmed reads.
            orig_read['clip_qual_left'] = 11
            self.assertEqual(read, orig_read)