<% def add_tip(text, help_text) return "
#{text}#{help_text}
" end %>

Summary stats

General stats about the patient cohort

<%= table(id: :summary_stats, header: true, styled: 'bs', cell_align: %w(left center ), attrib: {'class' => 'table table-striped'}) do |data| data.unshift(['Stat', 'Value']) end %>

HPO stats

HPOs more frequent in the cohort

<%= table(id: :hpo_stats, header: true, styled: 'dt', cell_align: %w(left center ), attrib: {'class' => 'table table-striped'}) do |data| data.unshift(['HPO', ' Patient percentage']) end %>

Cohort genome coverage analysis

Distribution of the genome coverage of all mutations characterized in the cohort. Second figure shows the same results for SORs.

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

No genomic data was specified for this cohort

" end %> <%= plot = File.join(@hash_vars[:temp_folder],'sor_coverage_plot.pdf') if File.exists?(plot) embed_pdf(File.join(@hash_vars[:temp_folder],'sor_coverage_plot.pdf'), 'width="800" height="800"') else "

No genomic data was specified for this cohort

" end %>

Distribution of mutations

Distribution of all mutations along the genome (Length) and the number of patients that have at least one of them (Count). Second figure shows the same for SORs.

<%= if !@hash_vars[:all_cnvs_length].nil? sccater2D(id: :all_cnvs_length, header: false, title: 'CNV', row_names: false, x_label: 'Length', y_label: 'Count', width: "800px", height: "800px", responsive: false) else "

No genomic data was specified for this cohort

" end %> <%= if !@hash_vars[:all_sor_length].nil? sccater2D(id: :all_sor_length, header: false, title: 'SOR', row_names: false, x_label: 'Length', y_label: 'Count', width: "800px", height: "800px", responsive: false) else "

No genomic data was specified for this cohort

" end %>

HPO annotations distribution

Analysis of the HPO terms within the HPO ontology and the cohort of patients. Left: distribution of terms within the ontology and the cohort. Right: percentage of terms distribution within the ontology and the cohort.

<%= if !@hash_vars[:ontology_levels].nil? barplot(id: :ontology_levels, header: true, x_label: 'Number of HPO terms', title: 'HPO annotations distribution', width: "800px", height: "800px", responsive: false, transpose: true, config: { 'graphOrientation' => 'vertical' }) end %> <%= if !@hash_vars[:distribution_percentage].nil? line(id: :distribution_percentage, header: true, x_label: 'Percentage of terms', title: 'HPO percentage distribution', width: "800px", height: "800px", responsive: false, transpose: true, config: { 'graphOrientation' => 'vertical' }) end %>

HPOs frequency distribution. Colour based on the HPO frequency.

<%= plot = File.join(@hash_vars[:temp_folder],'hpo_freq_colour.png') if File.exists?(plot) embed_img(plot, 'width="800" height="800"') else "

Invalid file specified.

" end %>

Clustering patients by HPO profile

All patients are clustered using their HPO profiles. First figure shows the information coefficient distribution for the top clusters. Second figure shows which chromosomes are affected in the patients for each top cluster.

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

Genomic data was not specified

" end %> <%= embed_pdf(File.join(@hash_vars[:temp_folder],'boxplot.pdf'), 'width="800" height="800"') %>

HPO profile redundancy

For each patient profile size (number of phenotypes, x-axis) it is shown the number of HPO phenotypes that are parent of other terms within the profile (number of parent terms, y-axis).

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

Unable to find parents_per_term.pdf file.

" end %>

HPO ICs distribution

First figure shows the ICs distribution in terms of the HP ontology (x-axis) and for each single HPO term, its frequency in the cohort according to the HP ontology structure (y-axis) and the second figure shows the same distributions considering the profiles analyzed.

<%= plot = File.join(@hash_vars[:temp_folder],'hpo_ics.pdf') if File.exists?(plot) embed_pdf(plot, 'width="600" height="600"') else "

Unable to find hpo_ics.pdf file.

" end %> <%= embed_pdf(File.join(@hash_vars[:temp_folder],'hpo_profile_ics.pdf'), 'width="600" height="600"') %>

HPO frequency by cluster

<% @hash_vars[:new_cluster_phenotypes].times do |n| %> <%= table(id: "clust_#{n}", header: true, border: 2, row_names: false, text: true, cell_align: %w( center )) do |data| # data.unshift([add_tip("HPO information in cluster #{n}"), "Patients" "Phenotypes", "Frequency")]) # data.unshift(["HPO information in cluster #{n}\tPhenotypes\tFrequency"]) data.unshift(["Patients in Cluster #{n}","Phenotypes", "Frequency"]) end %> <%end%>

Patient profiles heatmaps

For each patient, their HPO profile similarity coefficient is calculated according to the different methods specified in the analysis and represented in these heatmaps.

<% @hash_vars[:clustering_methods].each do |clust_method| plot = File.join(@hash_vars[:temp_folder], "#{clust_method}_heatmap.png") if File.exists?(plot) %> <%= embed_img(plot, 'width="800" height="800"') %> <% else puts 'File not found or method not specified.' end end %> <%= plot = File.join(@hash_vars[:temp_folder],'sim_boxplot.png') if File.exists?(plot) embed_img(plot, 'width="800" height="800"') end %>