pets 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/README.md +79 -5
- data/bin/coPatReporter.rb +68 -156
- data/bin/comPatMondo.rb +1 -4
- data/bin/evidence_profiler.rb +102 -150
- data/bin/get_gen_features.rb +146 -0
- data/bin/get_network_nodes.rb +79 -132
- data/bin/get_sorted_profs.rb +25 -36
- data/bin/install_deps.rb +8 -0
- data/bin/paco_translator.rb +29 -72
- data/bin/phen2reg.rb +1 -4
- data/bin/profiles2phenopacket.rb +86 -0
- data/bin/reg2phen.rb +1 -3
- data/example_datasets/associations_file.txt +757 -0
- data/example_datasets/example_patient.txt +6 -0
- data/example_datasets/example_patient_hpos.txt +15 -0
- data/example_datasets/genes.txt +8 -0
- data/example_datasets/hpo2ci.txt +2798 -0
- data/example_datasets/hummu_congenital_full_dataset.txt +4183 -0
- data/example_datasets/launch.sh +20 -0
- data/external_code/generate_boxpot.R +51 -21
- data/external_code/get_clusters.R +2 -2
- data/external_code/install_R_dependencies.R +16 -0
- data/external_code/plot_heatmap.R +34 -30
- data/lib/pets/coPatReporterMethods.rb +172 -424
- data/lib/pets/cohort.rb +309 -0
- data/lib/pets/common_optparse.rb +30 -0
- data/lib/pets/constants.rb +8 -0
- data/lib/pets/generalMethods.rb +29 -319
- data/lib/pets/genomic_features.rb +240 -0
- data/lib/pets/io.rb +481 -0
- data/lib/pets/parsers/cohort_parser.rb +111 -0
- data/lib/pets/parsers/reference_parser.rb +39 -0
- data/lib/pets/version.rb +1 -1
- data/lib/pets.rb +9 -0
- data/pets.gemspec +7 -3
- data/templates/cluster_report.erb +25 -5
- data/templates/cohort_report.erb +5 -7
- data/templates/evidence_profile.erb +20 -4
- data/templates/patient_report.erb +1 -1
- metadata +96 -5
| @@ -25,14 +25,34 @@ | |
| 25 25 | 
             
            <div style="width: 90%; background-color:#ecf0f1; margin: 0 auto;"> 
         | 
| 26 26 | 
             
            	<h1 style="text-align: center; background-color:#d6eaf8">Patient HPO profiles by cluster.</h1>
         | 
| 27 27 | 
             
            		<%= table(id: :clusters, header: true, border: 2, row_names: false, text: true, 
         | 
| 28 | 
            -
            			cell_align: %w( center )) do |data|
         | 
| 29 | 
            -
            				 | 
| 28 | 
            +
            			cell_align: %w( center ), styled: 'dt', attrib: {'class' => 'table'}) do |data|
         | 
| 29 | 
            +
            				patient_list = []
         | 
| 30 | 
            +
            				data.each do |element| # Cluster
         | 
| 31 | 
            +
            					clID, patient_number, patient_ids, hpo_codes, hpo_names = element
         | 
| 32 | 
            +
            					# TODO: mostrar registro por paciente
         | 
| 30 33 | 
             
            					#STDERR.puts element.inspect
         | 
| 31 | 
            -
            					 | 
| 32 | 
            -
             | 
| 33 | 
            -
             | 
| 34 | 
            +
            					patient_ids.each_with_index do |patID, i|
         | 
| 35 | 
            +
            						patient_record = [clID, patient_number]
         | 
| 36 | 
            +
            						patient_record << patID
         | 
| 37 | 
            +
            						patient_record << hpo_codes[i].map{|hpo_code| get_hpo_link(hpo_code)}.join(', ')
         | 
| 38 | 
            +
            						patient_record << hpo_names[i].join(', ')
         | 
| 39 | 
            +
            						patient_list << patient_record
         | 
| 40 | 
            +
            					end
         | 
| 34 41 | 
             
            				end
         | 
| 42 | 
            +
            				data.clear
         | 
| 43 | 
            +
            				data.concat(patient_list) 
         | 
| 35 44 | 
             
            				data.unshift(["Cluster ID","Patients in Cluster","Patient IDs", "HPO codes", "Phenotypes"])				
         | 
| 36 45 | 
             
            			end
         | 
| 37 46 | 
             
            		%>
         | 
| 38 47 | 
             
            </div>
         | 
| 48 | 
            +
             | 
| 49 | 
            +
            <div style="width: 90%; background-color:#ecf0f1; margin: 0 auto;"> 
         | 
| 50 | 
            +
            	<h1 style="text-align: center; background-color:#d6eaf8"> Cluster detailed view.</h1>
         | 
| 51 | 
            +
            	<%
         | 
| 52 | 
            +
            		@hash_vars[:sim_mat4cluster].each do |clID, sim_matrix|
         | 
| 53 | 
            +
            			@hash_vars[:sim_matrix] = sim_matrix %>
         | 
| 54 | 
            +
            			<%= heatmap(id: :sim_matrix, header: true, row_names: true, title: "Cluster #{clID}" )%>
         | 
| 55 | 
            +
            		<% end
         | 
| 56 | 
            +
            	%>
         | 
| 57 | 
            +
             | 
| 58 | 
            +
            </div>
         | 
    
        data/templates/cohort_report.erb
    CHANGED
    
    | @@ -161,17 +161,15 @@ | |
| 161 161 | 
             
            	<% 
         | 
| 162 162 | 
             
            		@hash_vars[:clustering_methods].each do |clust_method|
         | 
| 163 163 | 
             
            			plot = File.join(@hash_vars[:temp_folder], "#{clust_method}_heatmap.png")
         | 
| 164 | 
            -
            			if File. | 
| 164 | 
            +
            			if File.exist?(plot) %>
         | 
| 165 165 | 
             
            				<%= embed_img(plot, 'width="800" height="800"') %>
         | 
| 166 166 | 
             
            			<% else
         | 
| 167 167 | 
             
            				puts 'File not found or method not specified.'
         | 
| 168 168 | 
             
            			end
         | 
| 169 | 
            -
             | 
| 170 | 
            -
             | 
| 171 | 
            -
             | 
| 172 | 
            -
             | 
| 173 | 
            -
            		if File.exists?(plot)
         | 
| 174 | 
            -
            			embed_img(plot, 'width="800" height="800"') 
         | 
| 169 | 
            +
            			plot = File.join(@hash_vars[:temp_folder], clust_method + '_sim_boxplot.png')
         | 
| 170 | 
            +
            			if File.exist?(plot) %>
         | 
| 171 | 
            +
            				<%= embed_img(plot, 'width="800" height="800"') %> 
         | 
| 172 | 
            +
            			<% end
         | 
| 175 173 | 
             
            		end
         | 
| 176 174 | 
             
            	%>	
         | 
| 177 175 | 
             
            </div>
         | 
| @@ -4,7 +4,7 @@ | |
| 4 4 | 
             
            	<% @hash_vars[:similarity_matrixs].each do |pair, similarity_matrix| %>
         | 
| 5 5 | 
             
            		<% 
         | 
| 6 6 | 
             
            			matrix_name = pair + '_sim_matrix'
         | 
| 7 | 
            -
            			if pair | 
| 7 | 
            +
            			if pair.include?('gene_HP')
         | 
| 8 8 | 
             
            				dict = @hash_vars[:evidences][pair][:id2lab]
         | 
| 9 9 | 
             
            				header = similarity_matrix.first
         | 
| 10 10 | 
             
            				header.map! do |item|
         | 
| @@ -27,8 +27,24 @@ | |
| 27 27 | 
             
            	<% end %>
         | 
| 28 28 | 
             
            	<%=circular_genome(id: :candidates, header: false, row_names: true, transpose: false, 
         | 
| 29 29 | 
             
            		 genomic_coordinates: @hash_vars[:genomic_coordinates] )%>
         | 
| 30 | 
            -
            	<% if !@hash_vars[:var_ids].nil?  | 
| 31 | 
            -
            		 | 
| 32 | 
            -
             | 
| 30 | 
            +
            	<% if !@hash_vars[:var_ids].nil? 
         | 
| 31 | 
            +
            		if @hash_vars[:var_ids].length > 200 %>
         | 
| 32 | 
            +
            			<p> Too much variant records</p>
         | 
| 33 | 
            +
            		<% else %>
         | 
| 34 | 
            +
            			<%=circular_genome(id: :var_ids, header: false, 
         | 
| 35 | 
            +
            				row_names: true, transpose: false, 
         | 
| 36 | 
            +
            		 		genomic_coordinates: @hash_vars[:var_coordinates] )%>
         | 
| 37 | 
            +
            		<% end %>
         | 
| 33 38 | 
             
            	<% end %>
         | 
| 39 | 
            +
             | 
| 40 | 
            +
            	<h1 style="text-align: center; background-color:#d6eaf8">Candidate regions</h1>
         | 
| 41 | 
            +
             | 
| 42 | 
            +
            	<%=  table(id: :hotspot_table) do |data|
         | 
| 43 | 
            +
            			data.each do |row|
         | 
| 44 | 
            +
            				row[1] = row[1].join(" ")
         | 
| 45 | 
            +
            				row[2] = row[2].join(",")
         | 
| 46 | 
            +
            				row[3] = row[3].join(",")
         | 
| 47 | 
            +
            			end
         | 
| 48 | 
            +
            		end
         | 
| 49 | 
            +
            	%>
         | 
| 34 50 | 
             
            </div>
         | 
| @@ -141,7 +141,7 @@ | |
| 141 141 | 
             
            			row.each_with_index do |cell, i|
         | 
| 142 142 | 
             
            				if i == 3
         | 
| 143 143 | 
             
            					row[i] = cell.map{|h|
         | 
| 144 | 
            -
            						hpo_names, rejected = hpo. | 
| 144 | 
            +
            						hpo_names, rejected = hpo.translate_names([h])
         | 
| 145 145 | 
             
            						"#{get_hpo_link(h)}: #{hpo_names.first}"
         | 
| 146 146 | 
             
            					}.join("\n<br>")
         | 
| 147 147 | 
             
            				elsif i == 4
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: pets
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.2. | 
| 4 | 
            +
              version: 0.2.5
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Elena Rojano, Pedro Seoane
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2023-08-04 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| @@ -44,14 +44,14 @@ dependencies: | |
| 44 44 | 
             
                requirements:
         | 
| 45 45 | 
             
                - - "~>"
         | 
| 46 46 | 
             
                  - !ruby/object:Gem::Version
         | 
| 47 | 
            -
                    version: 3. | 
| 47 | 
            +
                    version: 3.11.0
         | 
| 48 48 | 
             
              type: :development
         | 
| 49 49 | 
             
              prerelease: false
         | 
| 50 50 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 51 | 
             
                requirements:
         | 
| 52 52 | 
             
                - - "~>"
         | 
| 53 53 | 
             
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            -
                    version: 3. | 
| 54 | 
            +
                    version: 3.11.0
         | 
| 55 55 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 56 56 | 
             
              name: statistics2
         | 
| 57 57 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -94,6 +94,20 @@ dependencies: | |
| 94 94 | 
             
                - - "~>"
         | 
| 95 95 | 
             
                  - !ruby/object:Gem::Version
         | 
| 96 96 | 
             
                    version: 0.1.0
         | 
| 97 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 98 | 
            +
              name: NetAnalyzer
         | 
| 99 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 100 | 
            +
                requirements:
         | 
| 101 | 
            +
                - - ">="
         | 
| 102 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 103 | 
            +
                    version: '0'
         | 
| 104 | 
            +
              type: :runtime
         | 
| 105 | 
            +
              prerelease: false
         | 
| 106 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 107 | 
            +
                requirements:
         | 
| 108 | 
            +
                - - ">="
         | 
| 109 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 110 | 
            +
                    version: '0'
         | 
| 97 111 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 98 112 | 
             
              name: report_html
         | 
| 99 113 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -136,6 +150,34 @@ dependencies: | |
| 136 150 | 
             
                - - ">="
         | 
| 137 151 | 
             
                  - !ruby/object:Gem::Version
         | 
| 138 152 | 
             
                    version: '0'
         | 
| 153 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 154 | 
            +
              name: expcalc
         | 
| 155 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 156 | 
            +
                requirements:
         | 
| 157 | 
            +
                - - ">="
         | 
| 158 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 159 | 
            +
                    version: '0'
         | 
| 160 | 
            +
              type: :runtime
         | 
| 161 | 
            +
              prerelease: false
         | 
| 162 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 163 | 
            +
                requirements:
         | 
| 164 | 
            +
                - - ">="
         | 
| 165 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 166 | 
            +
                    version: '0'
         | 
| 167 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 168 | 
            +
              name: bio-vcf
         | 
| 169 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 170 | 
            +
                requirements:
         | 
| 171 | 
            +
                - - ">="
         | 
| 172 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 173 | 
            +
                    version: '0'
         | 
| 174 | 
            +
              type: :runtime
         | 
| 175 | 
            +
              prerelease: false
         | 
| 176 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 177 | 
            +
                requirements:
         | 
| 178 | 
            +
                - - ">="
         | 
| 179 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 180 | 
            +
                    version: '0'
         | 
| 139 181 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 140 182 | 
             
              name: parallel
         | 
| 141 183 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -150,6 +192,34 @@ dependencies: | |
| 150 192 | 
             
                - - "~>"
         | 
| 151 193 | 
             
                  - !ruby/object:Gem::Version
         | 
| 152 194 | 
             
                    version: 1.20.1
         | 
| 195 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 196 | 
            +
              name: net-ftp
         | 
| 197 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 198 | 
            +
                requirements:
         | 
| 199 | 
            +
                - - ">="
         | 
| 200 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 201 | 
            +
                    version: '0'
         | 
| 202 | 
            +
              type: :runtime
         | 
| 203 | 
            +
              prerelease: false
         | 
| 204 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 205 | 
            +
                requirements:
         | 
| 206 | 
            +
                - - ">="
         | 
| 207 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 208 | 
            +
                    version: '0'
         | 
| 209 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 210 | 
            +
              name: net-http
         | 
| 211 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 212 | 
            +
                requirements:
         | 
| 213 | 
            +
                - - ">="
         | 
| 214 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 215 | 
            +
                    version: '0'
         | 
| 216 | 
            +
              type: :runtime
         | 
| 217 | 
            +
              prerelease: false
         | 
| 218 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 219 | 
            +
                requirements:
         | 
| 220 | 
            +
                - - ">="
         | 
| 221 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 222 | 
            +
                    version: '0'
         | 
| 153 223 | 
             
            description: PETS suite includes three different tools. CohortAnalyzer performs the
         | 
| 154 224 | 
             
              calculation of several statistics that gives an overview of a cohort of patients
         | 
| 155 225 | 
             
              to analyse. Reg2Phen uses associations between pathological phenotypes and regions
         | 
| @@ -171,14 +241,17 @@ executables: | |
| 171 241 | 
             
            - fmeasure_index.rb
         | 
| 172 242 | 
             
            - generate_HPO_IC_table.rb
         | 
| 173 243 | 
             
            - get_PR_values.rb
         | 
| 244 | 
            +
            - get_gen_features.rb
         | 
| 174 245 | 
             
            - get_network_nodes.rb
         | 
| 175 246 | 
             
            - get_sorted_profs.rb
         | 
| 247 | 
            +
            - install_deps.rb
         | 
| 176 248 | 
             
            - merge_by_cluster.rb
         | 
| 177 249 | 
             
            - merge_pairs.rb
         | 
| 178 250 | 
             
            - paco_translator.rb
         | 
| 179 251 | 
             
            - phen2reg.rb
         | 
| 180 252 | 
             
            - phen2reg_predictor_check.rb
         | 
| 181 253 | 
             
            - profile_cleaner.rb
         | 
| 254 | 
            +
            - profiles2phenopacket.rb
         | 
| 182 255 | 
             
            - reg2phen.rb
         | 
| 183 256 | 
             
            - region_to_patients_generator.rb
         | 
| 184 257 | 
             
            - relate_CI_to_association_value.rb
         | 
| @@ -202,20 +275,31 @@ files: | |
| 202 275 | 
             
            - bin/fmeasure_index.rb
         | 
| 203 276 | 
             
            - bin/generate_HPO_IC_table.rb
         | 
| 204 277 | 
             
            - bin/get_PR_values.rb
         | 
| 278 | 
            +
            - bin/get_gen_features.rb
         | 
| 205 279 | 
             
            - bin/get_network_nodes.rb
         | 
| 206 280 | 
             
            - bin/get_sorted_profs.rb
         | 
| 281 | 
            +
            - bin/install_deps.rb
         | 
| 207 282 | 
             
            - bin/merge_by_cluster.rb
         | 
| 208 283 | 
             
            - bin/merge_pairs.rb
         | 
| 209 284 | 
             
            - bin/paco_translator.rb
         | 
| 210 285 | 
             
            - bin/phen2reg.rb
         | 
| 211 286 | 
             
            - bin/phen2reg_predictor_check.rb
         | 
| 212 287 | 
             
            - bin/profile_cleaner.rb
         | 
| 288 | 
            +
            - bin/profiles2phenopacket.rb
         | 
| 213 289 | 
             
            - bin/reg2phen.rb
         | 
| 214 290 | 
             
            - bin/region_to_patients_generator.rb
         | 
| 215 291 | 
             
            - bin/relate_CI_to_association_value.rb
         | 
| 216 292 | 
             
            - bin/setup
         | 
| 293 | 
            +
            - example_datasets/associations_file.txt
         | 
| 294 | 
            +
            - example_datasets/example_patient.txt
         | 
| 295 | 
            +
            - example_datasets/example_patient_hpos.txt
         | 
| 296 | 
            +
            - example_datasets/genes.txt
         | 
| 297 | 
            +
            - example_datasets/hpo2ci.txt
         | 
| 298 | 
            +
            - example_datasets/hummu_congenital_full_dataset.txt
         | 
| 299 | 
            +
            - example_datasets/launch.sh
         | 
| 217 300 | 
             
            - external_code/generate_boxpot.R
         | 
| 218 301 | 
             
            - external_code/get_clusters.R
         | 
| 302 | 
            +
            - external_code/install_R_dependencies.R
         | 
| 219 303 | 
             
            - external_code/lines.R
         | 
| 220 304 | 
             
            - external_code/plot_area.R
         | 
| 221 305 | 
             
            - external_code/plot_boxplot.R
         | 
| @@ -242,7 +326,14 @@ files: | |
| 242 326 | 
             
            - external_data/uniq_hpo_with_CI.txt
         | 
| 243 327 | 
             
            - lib/pets.rb
         | 
| 244 328 | 
             
            - lib/pets/coPatReporterMethods.rb
         | 
| 329 | 
            +
            - lib/pets/cohort.rb
         | 
| 330 | 
            +
            - lib/pets/common_optparse.rb
         | 
| 331 | 
            +
            - lib/pets/constants.rb
         | 
| 245 332 | 
             
            - lib/pets/generalMethods.rb
         | 
| 333 | 
            +
            - lib/pets/genomic_features.rb
         | 
| 334 | 
            +
            - lib/pets/io.rb
         | 
| 335 | 
            +
            - lib/pets/parsers/cohort_parser.rb
         | 
| 336 | 
            +
            - lib/pets/parsers/reference_parser.rb
         | 
| 246 337 | 
             
            - lib/pets/phen2reg_methods.rb
         | 
| 247 338 | 
             
            - lib/pets/reg2phen_methods.rb
         | 
| 248 339 | 
             
            - lib/pets/version.rb
         | 
| @@ -272,7 +363,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 272 363 | 
             
                - !ruby/object:Gem::Version
         | 
| 273 364 | 
             
                  version: '0'
         | 
| 274 365 | 
             
            requirements: []
         | 
| 275 | 
            -
            rubygems_version: 3. | 
| 366 | 
            +
            rubygems_version: 3.3.7
         | 
| 276 367 | 
             
            signing_key:
         | 
| 277 368 | 
             
            specification_version: 4
         | 
| 278 369 | 
             
            summary: Suite with predictive tools.
         |