bioseqalign 0.0.1

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.
@@ -0,0 +1,151 @@
1
+ require 'bioseqalign/SeqAlign'
2
+
3
+ class BioSeqAlign
4
+ #
5
+ # fit seq2 into seq1, returns the score
6
+ #
7
+ def self.fitAlignScore(seq1, seq2, match=1, mismatch=-1, indel=-1)
8
+ fa = FitAlign.new(seq1, seq2)
9
+ fa.setMatchScore(match)
10
+ fa.setMismatchScore(mismatch)
11
+ fa.setIndelScore(indel)
12
+ fa.run
13
+ fa.getAlignScore
14
+ end
15
+ #
16
+ # fit seq2 into seq1, returns alignment
17
+ #
18
+ # example:
19
+ # [input]:: seq1 = <tt>AAAAAAAAGCTGAAAAAAAA</tt>
20
+ #
21
+ # seq2 = <tt>GCTG</tt>
22
+ #
23
+ # [output]:: <tt>["AAAAAAAAGCTGAAAAAAAA", "--------GCTG--------"]</tt>
24
+ #
25
+ # result of fitting alignment
26
+ #
27
+ # seq1: <tt>AAAAAAAAGCTGAAAAAAAA</tt>
28
+ #
29
+ # seq2: <tt>--------GCTG--------</tt>
30
+ #
31
+ def self.fitAlignStr(seq1, seq2, match=1, mismatch=-1, indel=-1)
32
+ fa = FitAlign.new(seq1, seq2)
33
+ fa.setMatchScore(match)
34
+ fa.setMismatchScore(mismatch)
35
+ fa.setIndelScore(indel)
36
+ fa.run
37
+ fa.getAlignment
38
+ end
39
+ #
40
+ # prefix-suffix alignment, returns score. Prefix of seq2 aligned with
41
+ # suffix of seq1
42
+ #
43
+ def self.prefixSuffixAlignScore(seq1, seq2, match=1, mismatch=-1, indel=-1)
44
+ fa = PrefixSuffixAlign.new(seq1, seq2)
45
+ fa.setMatchScore(match)
46
+ fa.setMismatchScore(mismatch)
47
+ fa.setIndelScore(indel)
48
+ fa.run
49
+ fa.getAlignScore
50
+ end
51
+ #
52
+ # prefix-suffix alignment, returns alignment. Prefix of seq2 aligned with
53
+ # suffix of seq1
54
+ #
55
+ # example:
56
+ #
57
+ # [input]:: seq1 = <tt>GGGGGGGGAAAAA</tt>
58
+ #
59
+ # seq2 = <tt>AAAAAACTGATAC</tt>
60
+ #
61
+ # [output]:: <tt>["GGGGGGGGAAAAA--------", "--------AAAAAACTGATAC"]</tt>
62
+ #
63
+ # result of prefix-suffix alignment
64
+ #
65
+ # seq1: <tt>GGGGGGGGAAAAA--------</tt>
66
+ #
67
+ # seq2: <tt>--------AAAAAACTGATAC</tt>
68
+ #
69
+ def self.prefixSuffixAlignStr(seq1, seq2, match=1, mismatch=-1, indel=-1)
70
+ fa = PrefixSuffixAlign.new(seq1, seq2)
71
+ fa.setMatchScore(match)
72
+ fa.setMismatchScore(mismatch)
73
+ fa.setIndelScore(indel)
74
+ fa.run
75
+ fa.getAlignment
76
+ end
77
+ #
78
+ # local alignment of seq1 and seq2, returns score.
79
+ #
80
+ def self.localAlignScore(seq1, seq2, match=1, mismatch=-1, indel=-1)
81
+ fa = LocalAlign.new(seq1, seq2)
82
+ fa.setMatchScore(match)
83
+ fa.setMismatchScore(mismatch)
84
+ fa.setIndelScore(indel)
85
+ fa.run
86
+ fa.getAlignScore
87
+ end
88
+ #
89
+ # local alignment of seq1 and seq2, returns alignment.
90
+ #
91
+ # example:
92
+ #
93
+ # [input]:: seq1 = <tt>CTGAGTCGATAA</tt>
94
+ #
95
+ # seq2 = <tt>GGGGTCGATTTT</tt>
96
+ #
97
+ # [output]:: <tt>["GTCGAT", "GTCGAT"]</tt>
98
+ #
99
+ # result of local alignment
100
+ #
101
+ # seq1: <tt>GTCGAT</tt>
102
+ #
103
+ # seq2: <tt>GTCGAT</tt>
104
+ #
105
+ def self.localAlignStr(seq1, seq2, match=1, mismatch=-1, indel=-1)
106
+ fa = LocalAlign.new(seq1, seq2)
107
+ fa.setMatchScore(match)
108
+ fa.setMismatchScore(mismatch)
109
+ fa.setIndelScore(indel)
110
+ fa.run
111
+ fa.getAlignment
112
+ end
113
+ #
114
+ # global alignment of seq1 and seq2, returns score.
115
+ #
116
+ def self.globalAlignScore(seq1, seq2, match=1, mismatch=-1, indel=-1)
117
+ fa = GlobalAlign.new(seq1, seq2)
118
+ fa.setMatchScore(match)
119
+ fa.setMismatchScore(mismatch)
120
+ fa.setIndelScore(indel)
121
+ fa.run
122
+ fa.getAlignScore
123
+ end
124
+ #
125
+ # global alignment of seq1 and seq2, returns alignment.
126
+ #
127
+ # example:
128
+ #
129
+ # [input]:: seq1 = <tt>CTGAGTCGATAA</tt>
130
+ #
131
+ # seq2 = <tt>GGGGTCGATTTT</tt>
132
+ #
133
+ # [output]:: <tt>["CTGAGTCGA-TA", "AGGGGTCGATTT"]</tt>
134
+ #
135
+ # result of global alignment
136
+ #
137
+ # seq1: <tt>CTGAGTCGA-TA</tt>
138
+ #
139
+ # seq2: <tt>AGGGGTCGATTT</tt>
140
+ #
141
+ def self.globalAlignStr(seq1, seq2, match=1, mismatch=-1, indel=-1)
142
+ fa = GlobalAlign.new(seq1, seq2)
143
+ fa.setMatchScore(match)
144
+ fa.setMismatchScore(mismatch)
145
+ fa.setIndelScore(indel)
146
+ fa.run
147
+ fa.getAlignment
148
+ end
149
+
150
+
151
+ end
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bioseqalign
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Stefano R.B.
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-06-04 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rice
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: A simple gem to perform fast pairwise sequence alignment using seqan
31
+ email: stefano.rb@gmail.com
32
+ executables: []
33
+ extensions:
34
+ - ext/bioseqalign/extconf.rb
35
+ extra_rdoc_files: []
36
+ files:
37
+ - lib/bioseqalign.rb
38
+ - ext/bioseqalign/FitAlign.hpp
39
+ - ext/bioseqalign/extconf.rb
40
+ - ext/bioseqalign/PrefixSuffixAlign.hpp~
41
+ - ext/bioseqalign/GlobalAlign.hpp
42
+ - ext/bioseqalign/PrefixSuffixAlign.hpp
43
+ - ext/bioseqalign/LocalAlign.cpp~
44
+ - ext/bioseqalign/PrefixSuffixAlign.cpp~
45
+ - ext/bioseqalign/runTest.rb
46
+ - ext/bioseqalign/PrefixSuffixAlign.cpp
47
+ - ext/bioseqalign/LocalAlign.hpp
48
+ - ext/bioseqalign/GlobalAlign.hpp~
49
+ - ext/bioseqalign/PairwiseAlign.cpp
50
+ - ext/bioseqalign/runTest.rb~
51
+ - ext/bioseqalign/FitAlign.cpp~
52
+ - ext/bioseqalign/LocalAlign.cpp
53
+ - ext/bioseqalign/Makefile
54
+ - ext/bioseqalign/fitalgntest.cpp~
55
+ - ext/bioseqalign/PairwiseAlign.hpp
56
+ - ext/bioseqalign/PairwiseAlign.cpp~
57
+ - ext/bioseqalign/LocalAlign.hpp~
58
+ - ext/bioseqalign/GlobalAlign.cpp~
59
+ - ext/bioseqalign/PairwiseAlign.hpp~
60
+ - ext/bioseqalign/extconf.rb~
61
+ - ext/bioseqalign/FitAlign.hpp~
62
+ - ext/bioseqalign/fitalgntest.cpp
63
+ - ext/bioseqalign/GlobalAlign.cpp
64
+ - ext/bioseqalign/FitAlign.cpp
65
+ homepage: http://rubygems.org/gems/bioseqalign
66
+ licenses:
67
+ - MIT
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ - ext
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ required_rubygems_version: !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ! '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ requirements: []
86
+ rubyforge_project:
87
+ rubygems_version: 1.8.23
88
+ signing_key:
89
+ specification_version: 3
90
+ summary: Pairwise sequence alignment using seqan
91
+ test_files: []