Class: TCGA::RsemExpression

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

Instance Method Summary collapse

Constructor Details

#initialize(sample) ⇒ RsemExpression

Returns a new instance of RsemExpression.



16
17
18
# File 'lib/tcga.rb', line 16

def initialize sample
  @sample = sample
end

Instance Method Details

#gene_expObject



25
26
27
28
29
30
31
32
33
34
# File 'lib/tcga.rb', line 25

def gene_exp
  if gene_file
    @gene_exp ||= HashTable.new gene_file, :header => { :gene_id => :str,
                                                        :raw_count => :float,
                                                        :scaled_estimate => :float,
                                                        :transcript_id => :str },
                                            :skip_header => true,
                                            :idx => :gene_id
  end
end

#gene_fileObject



19
20
21
22
23
24
# File 'lib/tcga.rb', line 19

def gene_file
  exp = sdrf.find do |exp|
    exp.tcga_barcode == @sample.barcode && exp.header21 == 'RSEM_genes'
  end
  File.join(GermConfig.get_conf(:tcga, :cancer_types, @sample.cancer_type, :rsem_exp_raw), exp.header19) if exp
end

#sdrfObject



35
36
37
38
39
# File 'lib/tcga.rb', line 35

def sdrf
  return @sdrf if @sdrf
  sdrf_file = GermConfig.get_conf(:tcga, :cancer_types, @sample.cancer_type, :rsem_exp_sdrf)
  @sdrf = SDRF.new sdrf_file if sdrf_file
end