vienna_rna 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -8
- data/lib/vienna_rna/modules/rna_extensions.rb +2 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79dd44b4836a93bc3e52e940d0b5c8f489a27eb2
|
4
|
+
data.tar.gz: d6a763e1548196913b62d0bf94f828fd4070b475
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8998ee77448b339a1daef102e735a47e8e4e4a6fe83dff9f2ed90473e05bff114fa6aba2a542b8b5e7c82a1ac9916fedfd648b31ece9df3f411a2091ee51be1
|
7
|
+
data.tar.gz: 54dfa5dd360117d3fa3429c9dc49100097e8a3572130f059b0aed6db67c2af7c52ae5e4969b05f604027c25123aacaf5f67bc0a24da6dddcd117fd24792bfd45
|
data/README.md
CHANGED
@@ -1,11 +1,18 @@
|
|
1
1
|
A simple gem for facilitating bindings to the ViennaRNA package (http://www.tbi.univie.ac.at/~ivo/RNA/). Note that this gem makes no effort to build and install the ViennaRNA suite locally at this time, and instead relies on its presence on the host machine. Leverages the BioRuby gem (http://bioruby.open-bio.org/) libraries for file parsing.
|
2
2
|
|
3
3
|
Simple use case:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
4
|
+
> require "vienna_rna"
|
5
|
+
#=> true
|
6
|
+
> rna = ViennaRna::Fold.run(seq: "CCUCGAGGGGAACCCGAAAGGGACCCGAGAGG")
|
7
|
+
#=> #<ViennaRna::Fold:0x007f9c48839dc0>
|
8
|
+
> rna.structure
|
9
|
+
#=> "((((..(((...(((....))).)))..))))"
|
10
|
+
> rna.mfe
|
11
|
+
#=> -19.7
|
12
|
+
|
13
|
+
... now an even easier way ...
|
14
|
+
|
15
|
+
> mfe_rna = RNA("CCUCGAGGGGAACCCGAAAGGGACCCGAGAGG").run(:fold).mfe_rna
|
16
|
+
#=> echo CCUCGAGGGGAACCCGAAAGGGACCCGAGAGG | rnafold --noPS
|
17
|
+
#=> Total runtime: 0.013 sec.
|
18
|
+
#=> #<ViennaRna::ViennaRna::Rna CCUCGAGGGGAACCCGAAAG... ((((..(((...(((....) [truncated]>
|
@@ -4,7 +4,8 @@ module ViennaRna
|
|
4
4
|
base.extend(ClassMethods)
|
5
5
|
base.send(:include, InstanceMethods)
|
6
6
|
base.extend(StructureBasedClassAndInstanceMethods)
|
7
|
-
|
7
|
+
|
8
|
+
# All the methods in here are also copied in as instance methods, where the first argument is the ViennaRna::Rna#structure
|
8
9
|
base.class_eval do
|
9
10
|
StructureBasedClassAndInstanceMethods.public_instance_methods.each do |class_method|
|
10
11
|
define_method(class_method) do |*args|
|
@@ -34,8 +35,6 @@ module ViennaRna
|
|
34
35
|
end
|
35
36
|
|
36
37
|
module StructureBasedClassAndInstanceMethods
|
37
|
-
# All the methods in here are also copied in as instance methods, where the first argument is the ViennaRna::Rna#structure
|
38
|
-
|
39
38
|
def bp_distance(structure_1, structure_2)
|
40
39
|
# Takes two structures and calculates the distance between them by |symmetric difference(bp_in_a, bp_in_b)|
|
41
40
|
raise "The two structures are not the same length" unless structure_1.length == structure_2.length
|