radpipe/stages.py
def bwa_align(self, inputs, output, ref_fasta, input_path, output_path, sm,
                  extra_options):
        '''Align fastq files with BWA mem'''
        safe_make_dir(os.path.dirname(output))
        # cores = min(self.get_stage_options("alignment", "cores") - 1, 1)
        cores = self.get_stage_options("alignment", "cores")
        # If PE fastq inputs, join into a string
        if isinstance(inputs, list):
            fastq_input = " ".join(inputs)
        else:
            fastq_input = inputs
        lb = os.path.basename(input_path)
        log_file = os.path.join(output_path, "{sm}.bwa.log".format(sm=sm))
        read_group_string = "@RG\tID:{lb}\tLB:{lb}\tPU:{lb}\tPL:ILLUMINA\tSM:{sm}" \
                            "".format(lb=lb, sm=sm)
        command = 'set -o pipefail; bwa mem -t {cores} {extra_options} ' \
                  '-R "{rg}" {ref_fasta} {fastq_input} 2> {log_file} | ' \
                  'samtools view -b - > {output}' .format(
                          cores=cores, extra_options=extra_options,
                          rg=read_group_string, ref_fasta=ref_fasta,
                          fastq_input=fastq_input, output=output,
                          log_file=log_file)
        # Use bash instead of sh
        command = "bash -c '{}'".format(command)
        run_stage(self.state, "alignment", command)
Align fastq files with BWA mem
Align fastq files with BWA mem
Align fastq files with BWA mem
def bwa_align(self, inputs, output, ref_fasta, input_path, output_path, sm,
                  extra_options):
        safe_make_dir(os.path.dirname(output))
        cores = self.get_stage_options("alignment", "cores")
        if isinstance(inputs, list):
            fastq_input = " ".join(inputs)
        else:
            fastq_input = inputs
        lb = os.path.basename(input_path)
        log_file = os.path.join(output_path, "{sm}.bwa.log".format(sm=sm))
        read_group_string = "@RG\tID:{lb}\tLB:{lb}\tPU:{lb}\tPL:ILLUMINA\tSM:{sm}" \
                            "".format(lb=lb, sm=sm)
        command = 'set -o pipefail; bwa mem -t {cores} {extra_options} ' \
                  '-R "{rg}" {ref_fasta} {fastq_input} 2> {log_file} | ' \
                  'samtools view -b - > {output}' .format(
                          cores=cores, extra_options=extra_options,
                          rg=read_group_string, ref_fasta=ref_fasta,
                          fastq_input=fastq_input, output=output,
                          log_file=log_file)
        command = "bash -c '{}'".format(command)
        run_stage(self.state, "alignment", command)
def bwa_align ( self , inputs , output , ref_fasta , input_path , output_path , sm , extra_options ) : safe_make_dir ( os . path . dirname ( output ) ) cores = self . get_stage_options ( "alignment" , "cores" ) if isinstance ( inputs , list ) : fastq_input = " " . join ( inputs ) else : fastq_input = inputs lb = os . path . basename ( input_path ) log_file = os . path . join ( output_path , "{sm}.bwa.log" . format ( sm = sm ) ) read_group_string = "@RG\tID:{lb}\tLB:{lb}\tPU:{lb}\tPL:ILLUMINA\tSM:{sm}" "" . format ( lb = lb , sm = sm ) command = 'set -o pipefail; bwa mem -t {cores} {extra_options} ' '-R "{rg}" {ref_fasta} {fastq_input} 2> {log_file} | ' 'samtools view -b - > {output}' . format ( cores = cores , extra_options = extra_options , rg = read_group_string , ref_fasta = ref_fasta , fastq_input = fastq_input , output = output , log_file = log_file ) command = "bash -c '{}'" . format ( command ) run_stage ( self . state , "alignment" , command )
Align fastq files with BWA mem
Align fastq files with BWA mem
'''Align fastq files with BWA mem''' # cores = min(self.get_stage_options("alignment", "cores") - 1, 1) # If PE fastq inputs, join into a string # Use bash instead of sh
self
inputs
output
ref_fasta
input_path
output_path
sm
extra_options