bioseqalign 0.0.1 → 0.0.2
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.
- data/ext/bioseqalign/fitalgntest.cpp +11 -5
- data/ext/bioseqalign/runTest.rb +20 -2
- data/lib/bioseqalign.rb +13 -11
- metadata +3 -3
@@ -13,7 +13,9 @@ extern "C"
|
|
13
13
|
//void Init_FitAlign()
|
14
14
|
void Init_SeqAlign()
|
15
15
|
{
|
16
|
-
|
16
|
+
Module rb_cModule = define_module("SeqAlign");
|
17
|
+
//Data_Type<PairwiseAlign> rb_cPairwiseAlign = define_class<PairwiseAlign>("PairwiseAlign")
|
18
|
+
Data_Type<PairwiseAlign> rb_cPairwiseAlign = define_class_under<PairwiseAlign>(rb_cModule,"PairwiseAlign")
|
17
19
|
.define_constructor(Constructor<PairwiseAlign>())
|
18
20
|
.define_constructor(Constructor<PairwiseAlign,std::string,std::string>())
|
19
21
|
//.define_constructor(Constructor<PairwiseAlign,std::string,std::string,int,int,int>())
|
@@ -25,23 +27,27 @@ void Init_SeqAlign()
|
|
25
27
|
.define_method("setMatchScore", &PairwiseAlign::setMatchScore)
|
26
28
|
.define_method("setMismatchScore", &PairwiseAlign::setMismatchScore)
|
27
29
|
.define_method("setIndelScore", &PairwiseAlign::setIndelScore);
|
28
|
-
Data_Type<FitAlign> rb_cFitAlign = define_class<FitAlign,PairwiseAlign>("FitAlign")
|
30
|
+
//Data_Type<FitAlign> rb_cFitAlign = define_class<FitAlign,PairwiseAlign>("FitAlign")
|
31
|
+
Data_Type<FitAlign> rb_cFitAlign = define_class_under<FitAlign,PairwiseAlign>(rb_cModule,"FitAlign")
|
29
32
|
.define_constructor(Constructor<FitAlign>())
|
30
33
|
.define_constructor(Constructor<FitAlign,std::string,std::string>())
|
31
34
|
//.define_constructor(Constructor<FitAlign,std::string,std::string,int,int,int>())
|
32
35
|
.define_method("run", &FitAlign::run)
|
33
36
|
.define_method("getAlignment", &FitAlign::getAlignment);
|
34
|
-
Data_Type<PrefixSuffixAlign> rb_cPrefixSuffixAlign = define_class<PrefixSuffixAlign,PairwiseAlign>("PrefixSuffixAlign")
|
37
|
+
//Data_Type<PrefixSuffixAlign> rb_cPrefixSuffixAlign = define_class<PrefixSuffixAlign,PairwiseAlign>("PrefixSuffixAlign")
|
38
|
+
Data_Type<PrefixSuffixAlign> rb_cPrefixSuffixAlign = define_class_under<PrefixSuffixAlign,PairwiseAlign>(rb_cModule, "PrefixSuffixAlign")
|
35
39
|
.define_constructor(Constructor<PrefixSuffixAlign>())
|
36
40
|
.define_constructor(Constructor<PrefixSuffixAlign,std::string,std::string>())
|
37
41
|
.define_method("run", &PrefixSuffixAlign::run)
|
38
42
|
.define_method("getAlignment", &PrefixSuffixAlign::getAlignment);
|
39
|
-
Data_Type<LocalAlign> rb_cLocalAlign = define_class<LocalAlign,PairwiseAlign>("LocalAlign")
|
43
|
+
//Data_Type<LocalAlign> rb_cLocalAlign = define_class<LocalAlign,PairwiseAlign>("LocalAlign")
|
44
|
+
Data_Type<LocalAlign> rb_cLocalAlign = define_class_under<LocalAlign,PairwiseAlign>(rb_cModule,"LocalAlign")
|
40
45
|
.define_constructor(Constructor<LocalAlign>())
|
41
46
|
.define_constructor(Constructor<LocalAlign,std::string,std::string>())
|
42
47
|
.define_method("run", &LocalAlign::run)
|
43
48
|
.define_method("getAlignment", &LocalAlign::getAlignment);
|
44
|
-
Data_Type<GlobalAlign> rb_cGlobalAlign = define_class<GlobalAlign,PairwiseAlign>("GlobalAlign")
|
49
|
+
//Data_Type<GlobalAlign> rb_cGlobalAlign = define_class<GlobalAlign,PairwiseAlign>("GlobalAlign")
|
50
|
+
Data_Type<GlobalAlign> rb_cGlobalAlign = define_class_under<GlobalAlign,PairwiseAlign>(rb_cModule,"GlobalAlign")
|
45
51
|
.define_constructor(Constructor<GlobalAlign>())
|
46
52
|
.define_constructor(Constructor<GlobalAlign,std::string,std::string>())
|
47
53
|
.define_method("run", &GlobalAlign::run)
|
data/ext/bioseqalign/runTest.rb
CHANGED
@@ -1,5 +1,23 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require './SeqAlign'
|
2
|
+
|
3
|
+
|
4
|
+
module BSA
|
5
|
+
|
6
|
+
include SeqAlign
|
7
|
+
|
8
|
+
end
|
9
|
+
|
10
|
+
fa = BSA::FitAlign.new("AAAACCCAAA", "CCC")
|
11
|
+
fa.run
|
12
|
+
puts fa.getAlignScore
|
13
|
+
|
14
|
+
#fa = SeqAlign::FitAlign.new("AAAACCCAAA", "CCC")
|
15
|
+
#puts fa
|
16
|
+
#fa = BSA::FitAlign.new("AAAACCCAAA", "CCC")
|
17
|
+
|
18
|
+
|
19
|
+
Process.exit(0)
|
20
|
+
|
3
21
|
require './SeqAlign'
|
4
22
|
|
5
23
|
sa = PairwiseAlign.new("TCGA", "TCGA")
|
data/lib/bioseqalign.rb
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
require 'bioseqalign/SeqAlign'
|
2
2
|
|
3
|
-
|
3
|
+
module BioSeqAlign
|
4
|
+
|
5
|
+
include SeqAlign
|
6
|
+
|
4
7
|
#
|
5
8
|
# fit seq2 into seq1, returns the score
|
6
9
|
#
|
7
|
-
def
|
10
|
+
def BioSeqAlign.fitAlignScore(seq1, seq2, match=1, mismatch=-1, indel=-1)
|
8
11
|
fa = FitAlign.new(seq1, seq2)
|
9
12
|
fa.setMatchScore(match)
|
10
13
|
fa.setMismatchScore(mismatch)
|
@@ -28,7 +31,7 @@ class BioSeqAlign
|
|
28
31
|
#
|
29
32
|
# seq2: <tt>--------GCTG--------</tt>
|
30
33
|
#
|
31
|
-
def
|
34
|
+
def BioSeqAlign.fitAlignStr(seq1, seq2, match=1, mismatch=-1, indel=-1)
|
32
35
|
fa = FitAlign.new(seq1, seq2)
|
33
36
|
fa.setMatchScore(match)
|
34
37
|
fa.setMismatchScore(mismatch)
|
@@ -40,7 +43,7 @@ class BioSeqAlign
|
|
40
43
|
# prefix-suffix alignment, returns score. Prefix of seq2 aligned with
|
41
44
|
# suffix of seq1
|
42
45
|
#
|
43
|
-
def
|
46
|
+
def BioSeqAlign.prefixSuffixAlignScore(seq1, seq2, match=1, mismatch=-1, indel=-1)
|
44
47
|
fa = PrefixSuffixAlign.new(seq1, seq2)
|
45
48
|
fa.setMatchScore(match)
|
46
49
|
fa.setMismatchScore(mismatch)
|
@@ -66,7 +69,7 @@ class BioSeqAlign
|
|
66
69
|
#
|
67
70
|
# seq2: <tt>--------AAAAAACTGATAC</tt>
|
68
71
|
#
|
69
|
-
def
|
72
|
+
def BioSeqAlign.prefixSuffixAlignStr(seq1, seq2, match=1, mismatch=-1, indel=-1)
|
70
73
|
fa = PrefixSuffixAlign.new(seq1, seq2)
|
71
74
|
fa.setMatchScore(match)
|
72
75
|
fa.setMismatchScore(mismatch)
|
@@ -77,7 +80,7 @@ class BioSeqAlign
|
|
77
80
|
#
|
78
81
|
# local alignment of seq1 and seq2, returns score.
|
79
82
|
#
|
80
|
-
def
|
83
|
+
def BioSeqAlign.localAlignScore(seq1, seq2, match=1, mismatch=-1, indel=-1)
|
81
84
|
fa = LocalAlign.new(seq1, seq2)
|
82
85
|
fa.setMatchScore(match)
|
83
86
|
fa.setMismatchScore(mismatch)
|
@@ -102,7 +105,7 @@ class BioSeqAlign
|
|
102
105
|
#
|
103
106
|
# seq2: <tt>GTCGAT</tt>
|
104
107
|
#
|
105
|
-
def
|
108
|
+
def BioSeqAlign.localAlignStr(seq1, seq2, match=1, mismatch=-1, indel=-1)
|
106
109
|
fa = LocalAlign.new(seq1, seq2)
|
107
110
|
fa.setMatchScore(match)
|
108
111
|
fa.setMismatchScore(mismatch)
|
@@ -113,7 +116,7 @@ class BioSeqAlign
|
|
113
116
|
#
|
114
117
|
# global alignment of seq1 and seq2, returns score.
|
115
118
|
#
|
116
|
-
def
|
119
|
+
def BioSeqAlign.globalAlignScore(seq1, seq2, match=1, mismatch=-1, indel=-1)
|
117
120
|
fa = GlobalAlign.new(seq1, seq2)
|
118
121
|
fa.setMatchScore(match)
|
119
122
|
fa.setMismatchScore(mismatch)
|
@@ -138,7 +141,7 @@ class BioSeqAlign
|
|
138
141
|
#
|
139
142
|
# seq2: <tt>AGGGGTCGATTT</tt>
|
140
143
|
#
|
141
|
-
def
|
144
|
+
def BioSeqAlign.globalAlignStr(seq1, seq2, match=1, mismatch=-1, indel=-1)
|
142
145
|
fa = GlobalAlign.new(seq1, seq2)
|
143
146
|
fa.setMatchScore(match)
|
144
147
|
fa.setMismatchScore(mismatch)
|
@@ -146,6 +149,5 @@ class BioSeqAlign
|
|
146
149
|
fa.run
|
147
150
|
fa.getAlignment
|
148
151
|
end
|
149
|
-
|
150
|
-
|
152
|
+
|
151
153
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bioseqalign
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-06
|
12
|
+
date: 2014-08-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rice
|
@@ -62,7 +62,7 @@ files:
|
|
62
62
|
- ext/bioseqalign/fitalgntest.cpp
|
63
63
|
- ext/bioseqalign/GlobalAlign.cpp
|
64
64
|
- ext/bioseqalign/FitAlign.cpp
|
65
|
-
homepage:
|
65
|
+
homepage: https://github.com/stefrb/bioseqalign
|
66
66
|
licenses:
|
67
67
|
- MIT
|
68
68
|
post_install_message:
|