MSAbundanceSim 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ms_abundance_sim.rb +5 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 15ce22fdc00a43ccd1de3e549b7686ce1163b640
4
- data.tar.gz: 25bf60003d8eccaa9d02a7173528d7a58d58bddc
3
+ metadata.gz: 43c27737444a0c3002974102bd4a03fa58d9cd25
4
+ data.tar.gz: dbf3f5d8b4dd3f2cee1242f78cead2c22f372b27
5
5
  SHA512:
6
- metadata.gz: f0e0e2327e26353dd960bd3986d958e397ade85c7145ba556abe7109bae38d9f21b16ec51b04b4e701d3ed9e24c8a90b56358cb8e002dc81e8d21737806de54d
7
- data.tar.gz: 9ad8473d36030038fb20b2f94c1c39d0167fbb11ffbebc7e4e9f61bb4eb3d9cdc10ff863074e18e3448afb30128e78cc9c3e865fd745e60a85fc855ee2242f03
6
+ metadata.gz: 7161e89f7b6d8ec3faf8c58430b08c8bf55335895d948391e81a7f25bf82dac69e29348e9f2a018f0e5b5035707ca0c13cfb864aad288ca9eb96f2b35414912a
7
+ data.tar.gz: 0e73101e9a0ec98a810cca9101d50a41313f62e0dee833b9132d90a90b741be65d7e9ebeb727e1d83759048762a5017dad690cc55b6795e5438045bebd2cfa9e
@@ -9,7 +9,7 @@ require 'set'
9
9
  require 'yaml'
10
10
 
11
11
  class MSAbundanceSim
12
- VERSION = "0.3.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
- norm_fc = raw_fc * (1.0-(a_i[0].to_f / max_abundance))
74
- pert_fc = norm_fc * rand
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 pert_fc * sign
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.3.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-23 00:00:00.000000000 Z
11
+ date: 2017-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler