<% def get_hpo_link(hpo_code) # STDERR.puts hpo_code.inspect if hpo_code == '-' link = '-' else link = "#{hpo_code}" end return link end def red_text(text) return "#{text}" end def add_tip(text, help_text) return "
#{text}#{help_text}
" end %>

Input HPO quality control

HPO terms with IC values less than 1 are marked in red, and they do not give much information to our system. Please, if possible, select more specific HPO terms suggested in Possible child HPO terms column.

<%= table(id: :characterised_hpos, header: true, border: 2, cell_align: %w(left center center center center left)) do |data| data.each do |row| row.each_with_index do |cell, i| if i == 1 # STDERR.puts cell.inspect row[i] = get_hpo_link(cell) elsif i == 4 row[i] = cell.map{|h,n| [get_hpo_link(h), n].compact}.join(', ') elsif i == 5 row[i] = cell.map{|r| "#{get_hpo_link(r.first)} (#{r.last})"}.join(', ') elsif i == 3 ci = cell.to_f if ci <= 1 text = red_text(ci.round(2)) else text = ci.round(2) end row[i] = text elsif i == 2 if cell == 'no' row[i] = red_text(cell) end end end end data.unshift([add_tip("HPO name", "Name of the HPO"), "HPO code", "Exists in database?", "Information Coefficient (IC)", "Is child of", "Possible child HPO terms"]) end %>

Regions associated to HPO profile

General representation

<%= if !@hash_vars[:merged_regions].nil? circular_data = [] @hash_vars[:merged_regions].sort{|reg1, reg2| [reg1[0].to_i, reg1[1].to_i] <=> [reg2[0].to_i, reg2[1].to_i]}.each do |row| #TODO if chr were x or y, change them to 23 and 24 and, when print, use x and y again circular_data_row = [] circular_data_row << "#{row[1]}-#{row[2]}" circular_data_row << row[5] circular_data_row << row[0] circular_data << circular_data_row end circular_data.unshift(%w[Coords CombScore Chr]) @hash_vars[:circular_data] = circular_data circular( id: :circular_data, header: true, row_names: true, responsive: false, sample_attributes: {'Chr' => 2}, config:{ # 'smpLabelOrientation' => 'circular', 'smpOverlays' => ['Chr'], 'colorSpectrum' => ["#d73027", "#fc8d59", "#fee090", "#ffffbf", "#e0f3f8", "#91bfdb", "#4575b4"], # 'segregateSamplesBy' => ['Chr'] } ) do |data| data.pop #Discard chromosome data end end %>

Ranked genomic regions associated to the HPO profile

The following table shows all the predicted genomic regions, the HPO terms found for it, their original association values and the calculated combined score. Results are ranked from the highest to the lowest combined score.

<%= if !@hash_vars[:merged_regions].nil? gene_var = @hash_vars[:genes_with_kegg_data] table(id: :merged_regions, header: true, border: 2, cell_align: %w(center center center left center center)) do |data| hpo_metadata = @hash_vars[:hpo_metadata] data.each_with_index do |row, row_number| row.each_with_index do |cell, i| if i == 3 row[i] = cell.map{|h| "#{get_hpo_link(h)}: #{hpo_metadata[h][1]}"}.join("\n
") elsif i == 4 row[i] = cell.map{|a| if a.abs > 0.01 a.to_f.round(2) else "%e" %a end }.join("\n
") end end if !gene_var.nil? gene_data = gene_var[row_number] if !gene_data.empty? table = '' table << "" geneIDs = gene_data.map{|gd| gd.first} gene_data.each do |geneID, attributes| table << '' table << "" if !attributes.nil? table << "" table << "" table << "" else table << '' * 3 end table << '' end table << '
#{["GeneID", "Gene Names", "Description", "KEGG pathways"].join('')}
#{geneID}#{attributes[0][0..1].join(', ')}#{attributes[1]}#{attributes[2].map{|pws| "#{pws.last}"}.join('
')}
' row << table else row << ('-') end else row << ('-') end end data.unshift(["Chromosome", "Start", "Stop", "Associated HPOs", "Association values
(For each HPO)", "Combined score", "Gene data" ]) end end %> <% if !@hash_vars[:pathway_stats].empty? %>

KEGG pathways significance in the genes located into the predicted regions

<%= table(id: :pathway_stats, header: true, border: 2 ) do |data| data.each do |row| row.each_with_index do |field, i| new_field = field if i == 0 new_field = "#{field.last}" elsif i == 1 new_field = field.map{|geneID| "#{geneID}" }.join(', ') elsif i == 2 new_field = field.join(", ") end row[i] = new_field end end data.unshift(["KEGG pathway", "Genes in pathway", "Contigency table: PN, NP, PP, NN", "Fisher p-value" ]) end %> <% end %>