rbbt-study 0.2.4 → 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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDVhMjJlZjRiODE4MTAwNWEwMDUwY2M1OWQ3NTZiYzcyMjY5YTFjYQ==
4
+ Y2VhZGVkOGYwZGMzMGMzYjcxN2FkOGY3YmZmY2ExMjlkYThhNjcyMA==
5
5
  data.tar.gz: !binary |-
6
- NWE0NzJlOWRjOWQzMGEyZGM5OGZlYWI3MmNlNTM2YzVlYTJlZmE0ZQ==
6
+ N2IwOWRlNjVkNDUwNGZlYjE3ZTI5ZjBlMjQ1YjBjNzA1MDlhNDIxYg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- OTAzOWRhMTMzZWJhOGVlZTk2YzI2MzVmNTAwY2UxMmM4YjIzZDViNGI2MjBm
10
- OWMyOWVlNzg5NWU3Mjk0NmRmN2UxYzI4ZDk1M2Q2OWY5Yjg1OTA3YjA2ZWI2
11
- MzJiNzgwYzY5NmRmMzI5MWVmOTA5MDgxZTM2MmVjNzFjYmM1MmM=
9
+ Yzg1ZjI4Y2JlN2FmYTVlMGFiMGYzYmE4MWI1YzU4ZDg0ZDlmMGNjMzA5ZDY0
10
+ NTUzYTYxN2M0ODFkMDhiYWIzZTA1OTg0YzA1MjcwYzIyYzU0YmE0NDk2MjBl
11
+ YzM4MDhmYjFjNmNmMmExZGFhYzc1ZGYxZWY4ZDRhYWM4M2I1ZDI=
12
12
  data.tar.gz: !binary |-
13
- MzQ0NzhkNzgzOWEwYWYzMTkzY2RkODlkZjA0MTRlMWIwNjU1NmEzYWZmYjM2
14
- NzBmZTg4YTMxZWQ2MzU4NzZjYTJiMDYzY2ZjZDNiNWFiNTFmOTg4ZmU2NGU1
15
- OWVkZGU5MDM3OTdjMmRmNzhkZWYwNDY3ZmI2NmVlODZmNDJkOWE=
13
+ ZmUxNWNkZjI3NDk2MTlmYzQ3YTc0NjE2M2Q3YzQzMGRkZjNlOWM4Yjg2MDM5
14
+ OWI2MDkxMGFjMWY3NTA5N2NlNzZmM2Q3MjBiNTExNjFmYWZkY2IwMTYwY2Y4
15
+ NjM0NzkwMDAxMmJmM2RiNjQzOGM3YTU1NjRjNWJiOTMyMjFlNWE=
@@ -21,24 +21,25 @@ module Study
21
21
 
22
22
  sample_mutations = study.knowledge_base.get_database(:sample_mutations, :source => "Sample")
23
23
  all_mutations = study.all_mutations
24
- mutations2mutated_isoforms = Misc.process_to_hash(all_mutations){|mutations| mutations.mutated_isoforms }
24
+ mutations2mutated_isoforms = Misc.process_to_hash(all_mutations){|mutations| mutations.any? ? mutations.mutated_isoforms : [] }
25
25
  #mi2damaged = Misc.process_to_hash(MutatedIsoform.setup(mutations2mutated_isoforms.values.flatten.compact.uniq, study.organism)){|mis| mis.damaged? }
26
26
  mi2damaged = Misc.process_to_hash(MutatedIsoform.setup(mutations2mutated_isoforms.values.flatten.compact.uniq, study.organism)){|mis| [false] * mis.length }
27
+ mi2consequence = Misc.process_to_hash(MutatedIsoform.setup(mutations2mutated_isoforms.values.flatten.compact.uniq, study.organism)){|mis| mis.consequence }
27
28
 
28
29
  gene_mutations = study.knowledge_base.get_database(:mutation_genes, :source => "Ensembl Gene ID")
30
+ gene_mutations.unnamed = true
29
31
  gene_mutations.entity_options["Genomic Mutation"] = {:watson => study.watson, :organism => study.organism}
30
32
  study.samples.select_by(:has_genotype?).each do |sample|
31
33
  values = sample.affected_genes.collect do |gene|
32
- mutations = gene_mutations[gene].subset(sample_mutations[sample] || [])
34
+ mutations = gene_mutations[gene] & (sample_mutations[sample] || [])
33
35
 
34
36
  if mutations.any?
37
+ GenomicMutation.setup(mutations, "Mutations in #{ sample } over #{ gene }", study.organism, study.watson)
35
38
  junction = mutations.select_by(:in_exon_junction?).any?
36
39
 
37
40
  mis = Annotated.flatten mutations2mutated_isoforms.values_at(*mutations).compact
38
41
 
39
- affected = (mis.any? and mis.select_by(:consequence){|c| ! %w(UTR SYNONYMOUS).include? c}.any?)
40
- #damaged = (mis.any? and mis.select_by(:damaged?).any?)
41
-
42
+ affected = (mis.any? and mis.select{|mi| c = mi2consequence[mi]; ! %w(UTR SYNONYMOUS).include? c}.any?)
42
43
  damaged = (mis.any? and mis.select{|mi| mi2damaged[mi] }.any?)
43
44
 
44
45
  [gene, mutations * ";;", affected, damaged, junction]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-study
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez