Class: GatkCaller

Inherits:
Object
  • Object
show all
Defined in:
lib/mutations_caller_pipeline_aws/gatk_caller.rb

Class Method Summary collapse

Class Method Details

.call(log_dir, gatk, index_fa, read_bam, read_vcf, job_prefix, account, dbsnp_file, debug) ⇒ Object

INDEX is normal genom.fa Genotyper



4
5
6
7
8
9
10
11
12
# File 'lib/mutations_caller_pipeline_aws/gatk_caller.rb', line 4

def self.call(log_dir, gatk, index_fa, read_bam, read_vcf, job_prefix, ,dbsnp_file, debug)
  cmd = "qsub -pe DJ 4 -o #{log_dir} -e #{log_dir}_genotyper_errors -V -cwd -b y -N genotyper_#{job_prefix} -l h_vmem=6G -hold_jid recalibration_#{job_prefix} #{}\
    java -Xmx6g -jar #{gatk} -l INFO -R #{index_fa} -T UnifiedGenotyper \
    -I #{read_bam} --dbsnp #{dbsnp_file} \
    -o #{read_vcf} -nt 4 --max_alternate_alleles 8 \
    --genotype_likelihoods_model BOTH"
  puts cmd
  system(cmd) if debug == 1
end

.coverage(log_dir, gatk, index_fa, read_bam, outfile_prefix, job_prefix, account, debug) ⇒ Object

INDEX is normal genom.fa Coverage Summary parallel not possible yet (1.6-13-g91f02df)



17
18
19
20
21
22
23
24
# File 'lib/mutations_caller_pipeline_aws/gatk_caller.rb', line 17

def self.coverage(log_dir, gatk, index_fa, read_bam, outfile_prefix, job_prefix, , debug)
  cmd = "qsub -o #{log_dir} -e #{log_dir}_coverage_errors -V -cwd -b y -N coverage_#{job_prefix} -l h_vmem=14G -hold_jid recalibration_#{job_prefix} #{}\
    java -Xmx6g -jar #{gatk} -R #{index_fa} -T DepthOfCoverage \
    -I #{read_bam} --omitDepthOutputAtEachBase \
    -o #{outfile_prefix} --omitIntervalStatistics --omitLocusTable"
  puts cmd
  system(cmd) if debug == 1
end

.prepare_realigne(log_dir, gatk, read_bam, index_fa, target_intervals, job_prefix, account, dbsnp_file, debug) ⇒ Object

Preparation realignement



52
53
54
55
56
57
58
59
60
61
# File 'lib/mutations_caller_pipeline_aws/gatk_caller.rb', line 52

def self.prepare_realigne(log_dir, gatk, read_bam, index_fa, target_intervals, job_prefix, , dbsnp_file, debug)
  cmd = "qsub -pe DJ 4 -o #{log_dir} -e #{log_dir}_prep_realign_errors -V -cwd -b y -N prep_realignment_#{job_prefix} -l h_vmem=6G -hold_jid index_#{job_prefix} #{}\
    java -Xmx6g -jar #{gatk} -nt 4 \
    -I #{read_bam} --known #{dbsnp_file} \
    -R #{index_fa} \
    -T RealignerTargetCreator \
    -o #{target_intervals}"
  puts cmd
  system(cmd) if debug == 1
end

.realigne(log_dir, gatk, read_bam, index_fa, target_intervals, realigned_bam, job_prefix, account, debug) ⇒ Object

Realignment parallel not possible yet (1.6-13-g91f02df)



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/mutations_caller_pipeline_aws/gatk_caller.rb', line 65

def self.realigne(log_dir, gatk, read_bam, index_fa, target_intervals, realigned_bam, job_prefix, , debug)
  cmd = "qsub -o #{log_dir} -e #{log_dir}_realign_errors -V -cwd -b y -N realignment_#{job_prefix} -l h_vmem=14G -hold_jid prep_realignment_#{job_prefix} #{} \
    java -Xmx6g -jar #{gatk} \
    -I #{read_bam} \
    -R #{index_fa} \
    -T IndelRealigner \
    -targetIntervals #{target_intervals} \
    -o #{realigned_bam}"
  puts cmd
  system(cmd) if debug == 1
end

.recalibrate_bam(log_dir, gatk, index_fa, read_bam, recal_file, job_prefix, account, dbsnp_file, debug) ⇒ Object

Making recalibration table



27
28
29
30
31
32
33
34
# File 'lib/mutations_caller_pipeline_aws/gatk_caller.rb', line 27

def self.recalibrate_bam(log_dir ,gatk, index_fa, read_bam, recal_file, job_prefix, , dbsnp_file, debug )
  cmd = "qsub -o #{log_dir} -e #{log_dir}_recalibrate_errors -V -cwd -b y -N recalibration_table_#{job_prefix} -l h_vmem=14G  -hold_jid realignment_#{job_prefix} #{} \
    java -Xmx6g -jar #{gatk} -knownSites #{dbsnp_file} -I #{read_bam} \
    -R #{index_fa} -T BaseRecalibrator  \
    -o #{recal_file}"
  puts cmd
  system(cmd) if debug == 1
end

.table_calibration(log_dir, gatk, index_fa, read_bam, recal_bam, recal_file, job_prefix, account, debug) ⇒ Object

Using recalibration table parallel not possible yet (1.6-13-g91f02df)



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/mutations_caller_pipeline_aws/gatk_caller.rb', line 38

def self.table_calibration(log_dir, gatk, index_fa, read_bam, recal_bam, recal_file, job_prefix, , debug)
  cmd = "qsub -V -o #{log_dir} -e #{log_dir}_prep_recal_errors -cwd -b y -N recalibration_#{job_prefix} -l h_vmem=14G -hold_jid recalibration_table_#{job_prefix} #{} \
    java -Xmx6g -jar #{gatk} \
    -R #{index_fa} \
    -I #{read_bam} \
    -T PrintReads \
    -o #{recal_bam} \
    -BQSR #{recal_file}"
  puts cmd
  system(cmd) if debug == 1
end