melt_baseline 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/melt_baseline.rb +113 -0
- metadata +47 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 13b370dda90d4cf095f6c37ce88568e1c9df683504eea5324a5309e62a559cfa
|
4
|
+
data.tar.gz: 3ef3964e6f6fab2729f1b7525e6bed72f4340fbddc2bfbb157732c73b6262053
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 871bfb732c0d287b16a1e415c702bedc49dfca3ad44beff84485e9a68dc5ecb0b45c77fc1945c8262fa22368cfe72c1bd0f0d079b0b95e24536248666ab2f837
|
7
|
+
data.tar.gz: 455e1197b4b1b0be95d1df12b428b9a43b550a51f4a972f73d4176b404bc50c6ac6094a760034602498cb4270c176716e9301ae6c1ce2bfb314563df25eb7d6a
|
@@ -0,0 +1,113 @@
|
|
1
|
+
# High-Resolution Melting Background Removal (MeltBaseline)
|
2
|
+
|
3
|
+
##############################################################
|
4
|
+
# MIT License
|
5
|
+
|
6
|
+
# Copyright (c) [2020] [ZACHARY L. DWIGHT]
|
7
|
+
|
8
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
+
# of this software and associated documentation files (the "Software"), to deal
|
10
|
+
# in the Software without restriction, including without limitation the rights
|
11
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
+
# copies of the Software, and to permit persons to whom the Software is
|
13
|
+
# furnished to do so, subject to the following conditions:
|
14
|
+
|
15
|
+
# The above copyright notice and this permission notice shall be included in all
|
16
|
+
# copies or substantial portions of the Software.
|
17
|
+
|
18
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
24
|
+
# SOFTWARE.
|
25
|
+
##############################################################
|
26
|
+
|
27
|
+
# Important Note: MELTING CURVE ANALYSIS Data Generation IP
|
28
|
+
|
29
|
+
# The generation of actual melt data may be covered by
|
30
|
+
# U.S. Patent Nos. 7,582,429; 7,803,551; 8,068,992; 8,093,002;
|
31
|
+
# 8,296,074; 9,273,346; and other U.S. and foreign patents and
|
32
|
+
# patent applications owned by the University of Utah Research
|
33
|
+
# Foundation and licensed to BioFire Defense, LLC.
|
34
|
+
|
35
|
+
# If your PCR instrument is not licensed under these patents,
|
36
|
+
# please contact Jill Powlick at bioMerieux (jill.powlick@biomerieux.com)
|
37
|
+
# for sublicensing information.
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
#INPUTS DEFINED
|
42
|
+
|
43
|
+
#t is the array of temperatures
|
44
|
+
#h is the array of raw fluorescence values
|
45
|
+
#c is the width of the cursors (areas before and after melt occurs)
|
46
|
+
|
47
|
+
#OUTPUT DEFINED
|
48
|
+
# returns new array of fluorescence values, user may want to normalize to 100%
|
49
|
+
# as opposed to 1 (max helicity) and 0 (no helicity)
|
50
|
+
|
51
|
+
module MELTBASELINE
|
52
|
+
class MeltCurve
|
53
|
+
def self.normalize(hs,ts,cw)
|
54
|
+
# Select a number of points that represents the region BEFORE melting
|
55
|
+
tcstart = 0
|
56
|
+
tcend = cw
|
57
|
+
|
58
|
+
# Select a number of points that represents the region AFTER melting
|
59
|
+
bcstart = hs.length() - cw
|
60
|
+
bcend = hs.length() - 1
|
61
|
+
|
62
|
+
#find slope of cursor regions
|
63
|
+
m1 = self.getslope(ts[tcstart],ts[tcend],hs[tcstart],hs[tcend])
|
64
|
+
m2 = self.getslope(ts[bcstart],ts[bcend],hs[bcstart],hs[bcend])
|
65
|
+
|
66
|
+
#define intercepts
|
67
|
+
b1 = self.getintercept(ts[tcend],hs[tcend],m1)
|
68
|
+
b2 = self.getintercept(ts[bcstart],hs[bcstart],m2)
|
69
|
+
newF = 1.000
|
70
|
+
a = []
|
71
|
+
for i in (0..hs.length()-1)
|
72
|
+
topF=self.getpoint(m1,ts[i],b1);
|
73
|
+
|
74
|
+
botF=self.getpoint(m2,ts[i],b2);
|
75
|
+
|
76
|
+
newF = (hs[i].to_f - botF.to_f )/(topF.to_f - botF.to_f );
|
77
|
+
if(newF < 0 )
|
78
|
+
newF = 0
|
79
|
+
end
|
80
|
+
if(newF > 1)
|
81
|
+
newF = 1
|
82
|
+
end
|
83
|
+
a.push(newF);
|
84
|
+
end
|
85
|
+
return a
|
86
|
+
end
|
87
|
+
|
88
|
+
def self.getintercept(x,y,m)
|
89
|
+
b = y-(x*m)
|
90
|
+
return b
|
91
|
+
end
|
92
|
+
|
93
|
+
def self.getpoint(m,x,b)
|
94
|
+
point = m*x+b
|
95
|
+
return point
|
96
|
+
end
|
97
|
+
|
98
|
+
def self.getslope(t1,t2,f1,f2)
|
99
|
+
slope = (f2-f1)/(t2-t1)
|
100
|
+
return slope
|
101
|
+
end
|
102
|
+
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
##### EXAMPLE USAGE #####
|
107
|
+
# require 'melt_baseline'
|
108
|
+
|
109
|
+
# t = [60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95]
|
110
|
+
# h = [61572,60624,59537,58351,56644,54569,53361,51715,49491,48180,46515,45691,45097,44579,44050,44440,43907,39960,33507,26271,18696,11805,6121,2377,1278,2492,3287,3259,3184,3180,3094,2993,2880,2683,2508,2342]
|
111
|
+
# c = 6
|
112
|
+
|
113
|
+
# puts MELTBASELINE::MeltCurve.normalize(h,t,c)
|
metadata
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: melt_baseline
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Zachary L. Dwight
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-10-27 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: 'A Ruby gem used for High-Resolution Melting (HRM) background signal
|
14
|
+
removal using a baseline method similar to that described by Wittwer & Palais (2009). DOI:
|
15
|
+
10.1016/S0076-6879(08)03813-5.'
|
16
|
+
email: zach.dwight@path.utah.edu
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- lib/melt_baseline.rb
|
22
|
+
homepage: https://dna-utah.org
|
23
|
+
licenses:
|
24
|
+
- MIT
|
25
|
+
metadata: {}
|
26
|
+
post_install_message:
|
27
|
+
rdoc_options: []
|
28
|
+
require_paths:
|
29
|
+
- lib
|
30
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
requirements: []
|
41
|
+
rubyforge_project:
|
42
|
+
rubygems_version: 2.7.6
|
43
|
+
signing_key:
|
44
|
+
specification_version: 4
|
45
|
+
summary: High-Resolution DNA Melting Curve Background Removal Baseline Method (Molecular
|
46
|
+
Diagnostics)
|
47
|
+
test_files: []
|