MSAbundanceSim 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ms_abundance_sim.rb +5 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43c27737444a0c3002974102bd4a03fa58d9cd25
|
4
|
+
data.tar.gz: dbf3f5d8b4dd3f2cee1242f78cead2c22f372b27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7161e89f7b6d8ec3faf8c58430b08c8bf55335895d948391e81a7f25bf82dac69e29348e9f2a018f0e5b5035707ca0c13cfb864aad288ca9eb96f2b35414912a
|
7
|
+
data.tar.gz: 0e73101e9a0ec98a810cca9101d50a41313f62e0dee833b9132d90a90b741be65d7e9ebeb727e1d83759048762a5017dad690cc55b6795e5438045bebd2cfa9e
|
data/lib/ms_abundance_sim.rb
CHANGED
@@ -9,7 +9,7 @@ require 'set'
|
|
9
9
|
require 'yaml'
|
10
10
|
|
11
11
|
class MSAbundanceSim
|
12
|
-
VERSION = "0.
|
12
|
+
VERSION = "0.4.0"
|
13
13
|
end
|
14
14
|
|
15
15
|
ProteinEntry = Struct.new(:entry_line_wo_abundance, :abundances, :additional_lines) do
|
@@ -68,12 +68,12 @@ class MSAbundanceSim
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def get_fold_change(a_i, event_rate, max_abundance)
|
71
|
-
# max fold change at lowest abundance
|
72
71
|
raw_fc = inverse_transform_sample(event_rate)
|
73
|
-
|
74
|
-
|
72
|
+
inv_share = (1.0-(a_i[0].to_f / max_abundance))
|
73
|
+
norm_fc = raw_fc * inv_share
|
74
|
+
trans = rand(0..inv_share)
|
75
75
|
sign = [1,-1].sample
|
76
|
-
return
|
76
|
+
return (norm_fc + trans) * sign
|
77
77
|
end
|
78
78
|
|
79
79
|
# takes 'value' and subtracts rand(min_threshold..value) from it if
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: MSAbundanceSim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Smith, John T. Prince
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|