rbbt-study 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/rbbt/entity/study/genotypes/knowledge_base.rb +6 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Y2VhZGVkOGYwZGMzMGMzYjcxN2FkOGY3YmZmY2ExMjlkYThhNjcyMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2IwOWRlNjVkNDUwNGZlYjE3ZTI5ZjBlMjQ1YjBjNzA1MDlhNDIxYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Yzg1ZjI4Y2JlN2FmYTVlMGFiMGYzYmE4MWI1YzU4ZDg0ZDlmMGNjMzA5ZDY0
|
10
|
+
NTUzYTYxN2M0ODFkMDhiYWIzZTA1OTg0YzA1MjcwYzIyYzU0YmE0NDk2MjBl
|
11
|
+
YzM4MDhmYjFjNmNmMmExZGFhYzc1ZGYxZWY4ZDRhYWM4M2I1ZDI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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]
|
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.
|
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]
|