Пример #1
0
    def __init__(self, config, target_name, input_files, output_file,
                 regions_file=None, dependencies=()):
        bam_input = MultiBAMInput(config, input_files)
        if len(bam_input.files) > 1 and regions_file:
            raise ValueError("DepthHistogram for regions require single, "
                             "indexed input BAM file.")

        builder = factory.new("depths")
        builder.add_value("%(TEMP_IN_BAM)s")
        builder.add_value("%(OUT_FILE)s")
        builder.set_option("--target-name", target_name)
        builder.set_kwargs(OUT_FILE=output_file)
        bam_input.setup(builder)

        if regions_file:
            builder.set_option('--regions-file', '%(IN_REGIONS)s')
            builder.set_kwargs(IN_REGIONS=regions_file)

        command = ParallelCmds(bam_input.commands + [builder.finalize()])
        description = "<DepthHistogram: %s -> '%s'>" \
            % (describe_files(bam_input.files), output_file)
        MultiBAMInputNode.__init__(self,
                                   bam_input=bam_input,
                                   command=command,
                                   description=description,
                                   dependencies=dependencies)
Пример #2
0
    def __init__(self, parameters):
        bam_input = MultiBAMInput(parameters.config, parameters.input_files)
        bam_input.setup(parameters.command)
        cmd_map = parameters.command.finalize()

        description = "<mapDamage (plots): %s -> '%s'>" \
            % (describe_files(parameters.input_files),
               parameters.output_directory)
        MultiBAMInputNode.__init__(self,
                                   bam_input=bam_input,
                                   command=ParallelCmds(bam_input.commands +
                                                        [cmd_map]),
                                   description=description,
                                   dependencies=parameters.dependencies)
Пример #3
0
    def __init__(self, parameters):
        bam_input = MultiBAMInput(parameters.config, parameters.input_files)
        bam_input.setup(parameters.command)
        cmd_map = parameters.command.finalize()

        description = "<mapDamage (plots): %s -> '%s'>" \
            % (describe_files(parameters.input_files),
               parameters.output_directory)
        MultiBAMInputNode.__init__(self,
                                   bam_input=bam_input,
                                   command=ParallelCmds(bam_input.commands +
                                                        [cmd_map]),
                                   description=description,
                                   dependencies=parameters.dependencies)
Пример #4
0
    def __init__(self, config, input_files, output_file, dependencies=()):
        bam_input = MultiBAMInput(config, input_files)
        duphist_command = factory.new("duphist")
        duphist_command.add_value("%(TEMP_IN_BAM)s")
        duphist_command.set_kwargs(OUT_STDOUT=output_file)
        bam_input.setup(duphist_command)
        duphist_command = duphist_command.finalize()

        commands = ParallelCmds(bam_input.commands + [duphist_command])

        description = "<DuplicateHistogram: %s -> %r>" % (describe_files(input_files), output_file)
        MultiBAMInputNode.__init__(
            self, bam_input=bam_input, command=commands, description=description, dependencies=dependencies
        )
Пример #5
0
    def __init__(self, parameters):
        self._directory = parameters.directory
        bam_input = MultiBAMInput(parameters.config, parameters.input_files)
        bam_input.setup(parameters.command)
        command = parameters.command.finalize()

        description = "<mapDamage (rescale): %s -> %r>" \
            % (describe_files(parameters.input_files),
               parameters.output_file)
        MultiBAMInputNode.__init__(self,
                                   bam_input=bam_input,
                                   command=ParallelCmds(bam_input.commands +
                                                        [command]),
                                   description=description,
                                   dependencies=parameters.dependencies)
Пример #6
0
    def __init__(self, parameters):
        self._directory = parameters.directory
        bam_input = MultiBAMInput(parameters.config, parameters.input_files)
        bam_input.setup(parameters.command)
        command = parameters.command.finalize()

        description = "<mapDamage (rescale): %s -> %r>" \
            % (describe_files(parameters.input_files),
               parameters.output_file)
        MultiBAMInputNode.__init__(self,
                                   bam_input=bam_input,
                                   command=ParallelCmds(bam_input.commands +
                                                        [command]),
                                   description=description,
                                   dependencies=parameters.dependencies)
Пример #7
0
    def __init__(self, config, input_bams, output_bam, keep_dupes=True, dependencies=()):
        bam_input = MultiBAMInput(config, input_bams)

        builder = factory.new("rmdup_collapsed")
        builder.add_value("%(TEMP_IN_BAM)s")
        builder.set_kwargs(OUT_STDOUT=output_bam)
        bam_input.setup(builder)

        if not keep_dupes:
            builder.set_option("--remove-duplicates")

        filteruniq = builder.finalize()
        command = ParallelCmds(bam_input.commands + [filteruniq])
        description = "<FilterCollapsedBAM: %s>" % (describe_files(bam_input.files),)
        MultiBAMInputNode.__init__(
            self, bam_input=bam_input, command=command, description=description, dependencies=dependencies
        )
Пример #8
0
    def __init__(self, config, input_files, output_file, dependencies=()):
        bam_input = MultiBAMInput(config, input_files)
        duphist_command = factory.new("duphist")
        duphist_command.add_value('%(TEMP_IN_BAM)s')
        duphist_command.set_kwargs(OUT_STDOUT=output_file)
        bam_input.setup(duphist_command)
        duphist_command = duphist_command.finalize()

        commands = ParallelCmds(bam_input.commands + [duphist_command])

        description = "<DuplicateHistogram: %s -> %r>" \
            % (describe_files(input_files), output_file)
        MultiBAMInputNode.__init__(self,
                                   bam_input=bam_input,
                                   command=commands,
                                   description=description,
                                   dependencies=dependencies)
Пример #9
0
    def __init__(self, config, target_name, input_files, output_file, regions_file=None, dependencies=()):
        bam_input = MultiBAMInput(config, input_files)
        if len(bam_input.files) > 1 and regions_file:
            raise ValueError("DepthHistogram for regions require single, " "indexed input BAM file.")

        builder = factory.new("depths")
        builder.add_value("%(TEMP_IN_BAM)s")
        builder.add_value("%(OUT_FILE)s")
        builder.set_option("--target-name", target_name)
        builder.set_kwargs(OUT_FILE=output_file)
        bam_input.setup(builder)

        if regions_file:
            builder.set_option("--regions-file", "%(IN_REGIONS)s")
            builder.set_kwargs(IN_REGIONS=regions_file)

        command = ParallelCmds(bam_input.commands + [builder.finalize()])
        description = "<DepthHistogram: %s -> '%s'>" % (describe_files(bam_input.files), output_file)
        MultiBAMInputNode.__init__(
            self, bam_input=bam_input, command=command, description=description, dependencies=dependencies
        )
Пример #10
0
    def __init__(self, config, input_bams, output_bam, keep_dupes=True,
                 dependencies=()):
        bam_input = MultiBAMInput(config, input_bams)

        builder = factory.new("rmdup_collapsed")
        builder.add_value("%(TEMP_IN_BAM)s")
        builder.set_kwargs(OUT_STDOUT=output_bam)
        bam_input.setup(builder)

        if not keep_dupes:
            builder.set_option("--remove-duplicates")

        filteruniq = builder.finalize()
        command = ParallelCmds(bam_input.commands + [filteruniq])
        description = "<FilterCollapsedBAM: %s>" \
            % (describe_files(bam_input.files),)
        MultiBAMInputNode.__init__(self,
                                   bam_input=bam_input,
                                   command=command,
                                   description=description,
                                   dependencies=dependencies)