<% hpo = @hash_vars[:hpo] def get_hpo_link(hpo_code) link = '-' if hpo_code != '-' link = "#{hpo_code}" end return link end %>

Average of patients by HPO profile average in clusters

Distribution of patients in clusters based on the average of phenotypes by profile.

<%= plot = File.join(@hash_vars[:temp_folder], "clusters_distribution_#{@hash_vars[:cluster_name]}.pdf") if File.exists?(plot) embed_pdf(plot, 'width="800" height="800"') else "

File not specified.

" end %>

Patient HPO profiles by cluster.

<%= table(id: :clusters, header: true, border: 2, row_names: false, text: true, cell_align: %w( center ), styled: 'dt', attrib: {'class' => 'table'}) do |data| patient_list = [] data.each do |element| # Cluster clID, patient_number, patient_ids, hpo_codes, hpo_names = element # TODO: mostrar registro por paciente #STDERR.puts element.inspect patient_ids.each_with_index do |patID, i| patient_record = [clID, patient_number] patient_record << patID patient_record << hpo_codes[i].map{|hpo_code| get_hpo_link(hpo_code)}.join(', ') patient_record << hpo_names[i].join(', ') patient_list << patient_record end end data.clear data.concat(patient_list) data.unshift(["Cluster ID","Patients in Cluster","Patient IDs", "HPO codes", "Phenotypes"]) end %>

Cluster detailed view.

<% @hash_vars[:sim_mat4cluster].each do |clID, sim_matrix| @hash_vars[:sim_matrix] = sim_matrix %> <%= heatmap(id: :sim_matrix, header: true, row_names: true, title: "Cluster #{clID}" )%> <% end %>