Class: BwaCaller

Inherits:
Object
  • Object
show all
Defined in:
lib/mutations_caller_pipeline/bwa_caller.rb

Class Method Summary collapse

Class Method Details

.call_paired_end(r1, r2, out_file, index, log_file, bwa, samtools) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/mutations_caller_pipeline/bwa_caller.rb', line 10

def self.call_paired_end(r1, r2, out_file, index, log_file, bwa, samtools)
  cmd = "#{bwa} sampe -r '@RG\tID:foo\tSM:bar\tPL:Illumina' #{index} \
      <(#{bwa} aln #{index} #{r1} 2>>#{log_file} || exit 1) <(#{bwa} aln #{index} #{r2} 2>>#{log_file} ) \
      #{r1} #{r2} 2>>#{log_file} | #{samtools} view -Su - 2>>#{log_file} | #{samtools} sort - #{out_file} 2>>#{log_file}"
  puts cmd
  system('bash','-c', cmd)
end

.call_single_end(r1, out_file, index, log_file, bwa, samtools) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/mutations_caller_pipeline/bwa_caller.rb', line 2

def self.call_single_end(r1,out_file,index, log_file, bwa, samtools)
  cmd = "#{bwa} samse -r '@RG\tID:foo\tSM:bar\tPL:Illumina' #{index} \
      <(#{bwa} aln #{index} #{r1} 2>>#{log_file})  \
      #{r1} 2>>#{log_file} | #{samtools} view -Su - 2>>#{log_file} | #{samtools} sort - #{out_file} 2>>#{log_file}"
  puts cmd
  system('bash','-c',cmd )
end