Class: MuTect::Line

Inherits:
Mutation::Record show all
Defined in:
lib/mutect.rb

Instance Attribute Summary

Attributes inherited from Mutation::Record

#muts

Instance Method Summary collapse

Methods inherited from Mutation::Record

#copy, #mut, #skip_oncotator?

Methods included from Mutation::Filtering

#criteria_failed?, #criterion_ok?

Methods included from GenomicLocus

#default_stop, #loc, #long_chrom, #range, #short_chrom

Methods included from IntervalList::Interval

#above?, #below?, #center, #clone, #contains?, #diff, #dist, #intersect, #overlaps?, #size, #union

Methods inherited from HashTable::HashLine

#[], #[]=, alias_key, #approve!, #format_column, #invalid?, #invalidate!, #method_missing, #respond_to_missing?, #set_table, #to_s, #update

Constructor Details

#initialize(h, table) ⇒ Line

Returns a new instance of Line.



42
43
44
45
# File 'lib/mutect.rb', line 42

def initialize h, table
  super h, table
  @muts.push Mutation.new(seqname,pos,ref,alt,t_ref_count,t_alt_count)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class HashTable::HashLine

Instance Method Details

#keep_germline?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/mutect.rb', line 27

def keep_germline?
  !criteria_failed?(self, [ :mutect, :germline ])
end

#keep_somatic?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/mutect.rb', line 24

def keep_somatic?
  !criteria_failed?(self, [ :mutect, :somatic ])
end

#n_depthObject



40
# File 'lib/mutect.rb', line 40

def n_depth; n_alt_count.to_i + n_ref_count.to_i end

#n_var_freqObject



38
# File 'lib/mutect.rb', line 38

def n_var_freq; n_alt_count.to_f / n_depth end

#q0_ratioObject



31
32
33
# File 'lib/mutect.rb', line 31

def q0_ratio
  map_q0_reads.to_f / (t_alt_count.to_i + n_alt_count.to_i)
end

#t_depthObject



39
# File 'lib/mutect.rb', line 39

def t_depth; t_alt_count.to_i + t_ref_count.to_i end

#t_var_freqObject



37
# File 'lib/mutect.rb', line 37

def t_var_freq; t_alt_count.to_f / t_depth end

#vf_ratioObject



34
35
36
# File 'lib/mutect.rb', line 34

def vf_ratio
  t_var_freq > 0 ? n_var_freq / t_var_freq : 0
end