wrnap 0.7.0 → 0.9.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e67dd610a703da6f012401c1a479b55ccc15bf2c
4
- data.tar.gz: 818d39645466e83e4381ac5144e1217d347087c7
3
+ metadata.gz: ac1239c0ba7934c50ad98b76df47db8e55fece20
4
+ data.tar.gz: 968842380493afb6092cce95df09d3c4d61bb3c4
5
5
  SHA512:
6
- metadata.gz: 70ef4ad2ecb35a0319b0b5b70e265fd6c0a7794c5d9fec50c7a3b2215cedf767d45b5925d13aee4756be828ae6f877e250c8a2315e39d12543be205e6da1414d
7
- data.tar.gz: 7c82729aaf7b7b80761994570dd6ca6e3542fcd44e9ab0231a6a16ba124b3662791dcce737df636d56369eef61047eef6d2a0a24c210caa9c371c7da7e69a850
6
+ metadata.gz: d3ca46aa20984438b365a325d6a63d0b90f68d8bbd9e238cdfb2927685fe11360a696a9d78dc18d75118ba3a47a1a9e3de0524f0ebf19ec2854aa3620fc2f9cc
7
+ data.tar.gz: 0620bed745bc6bed2a2615792422bce97ce31b77e6ad12761dfec85716c8f3577a4c8f7ab7d70934e0cd7c4e49afc1ef8c06fc30a8b8eb9188a11a3582b08168
@@ -102,6 +102,12 @@ module Wrnap
102
102
 
103
103
  alias :empty_str :empty_structure
104
104
 
105
+ def no_structure
106
+ self.class.init_from_string(seq, nil, nil, name)
107
+ end
108
+
109
+ alias :no_str :no_structure
110
+
105
111
  def one_structure(structure_1)
106
112
  self.class.init_from_string(seq, structure_1.is_a?(Symbol) ? send(structure_1) : structure_1, nil, name)
107
113
  end
@@ -137,6 +143,10 @@ module Wrnap
137
143
  Wrnap::Package.lookup(package_name).run(self, options)
138
144
  end
139
145
 
146
+ def ==(other_rna)
147
+ other_rna.kind_of?(Wrnap::Global::Rna) ? [seq, str_1, str_2] == [other_rna.seq, other_rna.str_1, other_rna.str_2] : super
148
+ end
149
+
140
150
  def method_missing(name, *args, &block)
141
151
  if (name_str = "#{name}") =~ /^run_\w+$/
142
152
  run(name_str.gsub(/^run_/, ""), *args)
@@ -40,7 +40,7 @@ module Wrnap
40
40
  sequence: self.sequence,
41
41
  structure: options[:rna][:structure] || options[:rna][:str_1] || options[:rna][:str],
42
42
  second_structure: options[:rna][:second_structure] || options[:rna][:str_2],
43
- comment: options[:rna][:comment] || options[:rna][:name]
43
+ comment: options[:rna][:comment] || options[:rna][:name] || identifier
44
44
  })
45
45
 
46
46
  remove_instance_variable(:@sequence)
@@ -125,8 +125,12 @@ module Wrnap
125
125
  end
126
126
  end
127
127
 
128
+ def identifier
129
+ "%s %d %s %d" % [accession, from, plus_strand? ? ?+ : ?-, to]
130
+ end
131
+
128
132
  def inspect
129
- super.gsub(/((\w(::)?)+)>$/) { |_| "%s %d %s %d %s>" % [accession, from, plus_strand? ? ?+ : ?-, to, $1] }
133
+ super.gsub(/((\w(::)?)+)>$/) { |_| "%s %s>" % [identifier, $1] }
130
134
  end
131
135
  end
132
136
  end
@@ -33,6 +33,10 @@ module Wrnap
33
33
  def shuffle(sequence, token_length = 2)
34
34
  Shuffle.new(sequence).shuffle(token_length)
35
35
  end
36
+
37
+ def structure_from_bp_list(length, base_pairs)
38
+ base_pairs.to_a.map(&:to_a).map(&:sort).inject("." * length) { |structure, (i, j)| structure.tap { structure[i] = ?(; structure[j] = ?) } }
39
+ end
36
40
  end
37
41
 
38
42
  module InstanceMethods
@@ -50,6 +54,18 @@ module Wrnap
50
54
  end
51
55
 
52
56
  module OneStructureBasedMethods
57
+ def helices(structure)
58
+ array = base_pairs(structure).sort_by(&:first).map(&:to_a)
59
+
60
+ unless array.empty?
61
+ array[1..-1].inject([[array.first]]) do |bins, (i, j)|
62
+ bins.tap { bins[-1][-1] == [i - 1, j + 1] ? bins[-1] << [i, j] : bins << [[i, j]] }
63
+ end
64
+ else
65
+ []
66
+ end
67
+ end
68
+
53
69
  def max_bp_distance(structure)
54
70
  base_pairs(structure).count + ((structure.length - 3) / 2.0).floor
55
71
  end
@@ -1,3 +1,3 @@
1
1
  module Wrnap
2
- VERSION = "0.7.0"
2
+ VERSION = "0.9.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wrnap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Senter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-15 00:00:00.000000000 Z
11
+ date: 2014-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -130,15 +130,6 @@ extensions: []
130
130
  extra_rdoc_files: []
131
131
  files:
132
132
  - ".gitignore"
133
- - ".idea/.name"
134
- - ".idea/.rakeTasks"
135
- - ".idea/encodings.xml"
136
- - ".idea/misc.xml"
137
- - ".idea/modules.xml"
138
- - ".idea/scopes/scope_settings.xml"
139
- - ".idea/vcs.xml"
140
- - ".idea/workspace.xml"
141
- - ".idea/wrnap.iml"
142
133
  - Gemfile
143
134
  - LICENSE.md
144
135
  - README.md
@@ -197,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
188
  version: '0'
198
189
  requirements: []
199
190
  rubyforge_project:
200
- rubygems_version: 2.2.2
191
+ rubygems_version: 2.3.0
201
192
  signing_key:
202
193
  specification_version: 4
203
194
  summary: A comprehensive wrapper (wRNApper) for various RNA CLI programs.
@@ -1 +0,0 @@
1
- wrnap
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Settings><!--This file was automatically generated by Ruby plugin.
3
- You are allowed to:
4
- 1. Remove rake task
5
- 2. Add existing rake tasks
6
- To add existing rake tasks automatically delete this file and reload the project.
7
- --><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build wrnap-0.5.1.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Build and install wrnap-0.5.1.gem into system gems" fullCmd="install" taksId="install" /><RakeTask description="Create tag v0.5.1 and build and push wrnap-0.5.1.gem to Rubygems" fullCmd="release" taksId="release" /></RakeGroup></Settings>
@@ -1,5 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
4
- </project>
5
-
@@ -1,5 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager" version="2" project-jdk-name="rbenv: 2.0.0-p0" project-jdk-type="RUBY_SDK" />
4
- </project>
5
-
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/wrnap.iml" filepath="$PROJECT_DIR$/.idea/wrnap.iml" />
6
- </modules>
7
- </component>
8
- </project>
9
-
@@ -1,5 +0,0 @@
1
- <component name="DependencyValidationManager">
2
- <state>
3
- <option name="SKIP_IMPORT_STATEMENTS" value="false" />
4
- </state>
5
- </component>
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
- </component>
6
- </project>
7
-
@@ -1,169 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ChangeListManager">
4
- <list default="true" id="f215766d-a45c-47cc-a7d7-9487868cd8b4" name="Default" comment="">
5
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/wrnap/package/base.rb" afterPath="$PROJECT_DIR$/lib/wrnap/package/base.rb" />
6
- </list>
7
- <ignored path="wrnap.iws" />
8
- <ignored path=".idea/workspace.xml" />
9
- <option name="TRACKING_ENABLED" value="true" />
10
- <option name="SHOW_DIALOG" value="false" />
11
- <option name="HIGHLIGHT_CONFLICTS" value="true" />
12
- <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
13
- <option name="LAST_RESOLUTION" value="IGNORE" />
14
- </component>
15
- <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
16
- <component name="CreatePatchCommitExecutor">
17
- <option name="PATCH_PATH" value="" />
18
- </component>
19
- <component name="DaemonCodeAnalyzer">
20
- <disable_hints />
21
- </component>
22
- <component name="FavoritesManager">
23
- <favorites_list name="wrnap" />
24
- </component>
25
- <component name="FileEditorManager">
26
- <leaf>
27
- <file leaf-file-name="wrnap.rb" pinned="false" current="true" current-in-tab="true">
28
- <entry file="file://$PROJECT_DIR$/lib/wrnap.rb">
29
- <provider selected="true" editor-type-id="text-editor">
30
- <state vertical-scroll-proportion="-0.074179746" vertical-offset="52" max-vertical-offset="1183">
31
- <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
32
- <folding />
33
- </state>
34
- </provider>
35
- </entry>
36
- </file>
37
- </leaf>
38
- </component>
39
- <component name="FindManager">
40
- <FindUsagesManager>
41
- <setting name="OPEN_NEW_TAB" value="true" />
42
- </FindUsagesManager>
43
- </component>
44
- <component name="Git.Settings">
45
- <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
46
- </component>
47
- <component name="ProjectFrameBounds">
48
- <option name="y" value="22" />
49
- <option name="width" value="1280" />
50
- <option name="height" value="774" />
51
- </component>
52
- <component name="ProjectLevelVcsManager" settingsEditedManually="false">
53
- <OptionsSetting value="true" id="Add" />
54
- <OptionsSetting value="true" id="Remove" />
55
- <OptionsSetting value="true" id="Checkout" />
56
- <OptionsSetting value="true" id="Update" />
57
- <OptionsSetting value="true" id="Status" />
58
- <OptionsSetting value="true" id="Edit" />
59
- <ConfirmationsSetting value="0" id="Add" />
60
- <ConfirmationsSetting value="0" id="Remove" />
61
- </component>
62
- <component name="ProjectReloadState">
63
- <option name="STATE" value="0" />
64
- </component>
65
- <component name="ProjectView">
66
- <navigator currentView="ProjectPane" proportions="" version="1">
67
- <flattenPackages />
68
- <showMembers />
69
- <showModules />
70
- <showLibraryContents />
71
- <hideEmptyPackages />
72
- <abbreviatePackageNames />
73
- <autoscrollToSource />
74
- <autoscrollFromSource />
75
- <sortByType />
76
- </navigator>
77
- <panes>
78
- <pane id="ProjectPane">
79
- <subPane>
80
- <PATH>
81
- <PATH_ELEMENT>
82
- <option name="myItemId" value="wrnap" />
83
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
84
- </PATH_ELEMENT>
85
- </PATH>
86
- </subPane>
87
- </pane>
88
- <pane id="Scope" />
89
- </panes>
90
- </component>
91
- <component name="PropertiesComponent">
92
- <property name="WebServerToolWindowFactoryState" value="false" />
93
- <property name="options.lastSelected" value="reference.settingsdialog.IDE.editor.colors.Font" />
94
- <property name="options.splitter.main.proportions" value="0.3" />
95
- <property name="options.splitter.details.proportions" value="0.2" />
96
- <property name="options.searchVisible" value="true" />
97
- <property name="FullScreen" value="false" />
98
- </component>
99
- <component name="RunManager">
100
- <list size="0" />
101
- </component>
102
- <component name="ShelveChangesManager" show_recycled="false" />
103
- <component name="SvnConfiguration">
104
- <configuration />
105
- </component>
106
- <component name="TaskManager">
107
- <task active="true" id="Default" summary="Default task">
108
- <changelist id="f215766d-a45c-47cc-a7d7-9487868cd8b4" name="Default" comment="" />
109
- <created>1399483991383</created>
110
- <updated>1399483991383</updated>
111
- </task>
112
- <servers />
113
- </component>
114
- <component name="ToolWindowManager">
115
- <frame x="0" y="22" width="1280" height="774" extended-state="6" />
116
- <editor active="false" />
117
- <layout>
118
- <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32968536" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
119
- <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
120
- <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
121
- <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
122
- <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
123
- <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
124
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.16796875" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
125
- <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
126
- <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
127
- <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
128
- <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25307798" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
129
- <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
130
- <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
131
- <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
132
- <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
133
- <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
134
- <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
135
- <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
136
- <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
137
- </layout>
138
- </component>
139
- <component name="Vcs.Log.UiProperties">
140
- <option name="RECENTLY_FILTERED_USER_GROUPS">
141
- <collection />
142
- </option>
143
- <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
144
- <collection />
145
- </option>
146
- </component>
147
- <component name="VcsContentAnnotationSettings">
148
- <option name="myLimit" value="2678400000" />
149
- </component>
150
- <component name="VcsManagerConfiguration">
151
- <option name="myTodoPanelSettings">
152
- <TodoPanelSettings />
153
- </option>
154
- </component>
155
- <component name="XDebuggerManager">
156
- <breakpoint-manager />
157
- </component>
158
- <component name="editorHistoryManager">
159
- <entry file="file://$PROJECT_DIR$/lib/wrnap.rb">
160
- <provider selected="true" editor-type-id="text-editor">
161
- <state vertical-scroll-proportion="-0.074179746" vertical-offset="52" max-vertical-offset="1183">
162
- <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
163
- <folding />
164
- </state>
165
- </provider>
166
- </entry>
167
- </component>
168
- </project>
169
-
@@ -1,49 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="RUBY_MODULE" version="4">
3
- <component name="FacetManager">
4
- <facet type="gem" name="Ruby Gem">
5
- <configuration>
6
- <option name="GEM_APP_ROOT_PATH" value="$MODULE_DIR$" />
7
- <option name="GEM_APP_TEST_PATH" value="" />
8
- <option name="GEM_APP_LIB_PATH" value="$MODULE_DIR$/lib" />
9
- </configuration>
10
- </facet>
11
- </component>
12
- <component name="NewModuleRootManager">
13
- <content url="file://$MODULE_DIR$" />
14
- <orderEntry type="inheritedJdk" />
15
- <orderEntry type="sourceFolder" forTests="false" />
16
- <orderEntry type="module-library">
17
- <library name="wrnap (v0.5.1, /Users/evansenter/Source/wrnap) [path][gem]">
18
- <CLASSES>
19
- <root url="file://$MODULE_DIR$/lib" />
20
- <root url="file://$MODULE_DIR$/pkg" />
21
- <root url="file://$MODULE_DIR$/.idea" />
22
- </CLASSES>
23
- <SOURCES>
24
- <root url="file://$MODULE_DIR$/lib" />
25
- <root url="file://$MODULE_DIR$/pkg" />
26
- <root url="file://$MODULE_DIR$/.idea" />
27
- </SOURCES>
28
- </library>
29
- </orderEntry>
30
- <orderEntry type="library" scope="PROVIDED" name="activesupport (v4.1.0, rbenv: 2.0.0-p0) [gem]" level="application" />
31
- <orderEntry type="library" scope="PROVIDED" name="bio (v1.4.3.0001, rbenv: 2.0.0-p0) [gem]" level="application" />
32
- <orderEntry type="library" scope="PROVIDED" name="bundler (v1.6.2, rbenv: 2.0.0-p0) [gem]" level="application" />
33
- <orderEntry type="library" scope="PROVIDED" name="entrez (v0.5.8.1, rbenv: 2.0.0-p0) [gem]" level="application" />
34
- <orderEntry type="library" scope="PROVIDED" name="hoe (v3.12.0, rbenv: 2.0.0-p0) [gem]" level="application" />
35
- <orderEntry type="library" scope="PROVIDED" name="httparty (v0.13.1, rbenv: 2.0.0-p0) [gem]" level="application" />
36
- <orderEntry type="library" scope="PROVIDED" name="i18n (v0.6.9, rbenv: 2.0.0-p0) [gem]" level="application" />
37
- <orderEntry type="library" scope="PROVIDED" name="json (v1.8.1, rbenv: 2.0.0-p0) [gem]" level="application" />
38
- <orderEntry type="library" scope="PROVIDED" name="minitest (v5.3.3, rbenv: 2.0.0-p0) [gem]" level="application" />
39
- <orderEntry type="library" scope="PROVIDED" name="multi_xml (v0.5.5, rbenv: 2.0.0-p0) [gem]" level="application" />
40
- <orderEntry type="library" scope="PROVIDED" name="rake (v10.2.2, rbenv: 2.0.0-p0) [gem]" level="application" />
41
- <orderEntry type="library" scope="PROVIDED" name="rand (v0.9.1, rbenv: 2.0.0-p0) [gem]" level="application" />
42
- <orderEntry type="library" scope="PROVIDED" name="rinruby (v2.0.3, rbenv: 2.0.0-p0) [gem]" level="application" />
43
- <orderEntry type="library" scope="PROVIDED" name="rroc (v0.1.1, rbenv: 2.0.0-p0) [gem]" level="application" />
44
- <orderEntry type="library" scope="PROVIDED" name="shuffle (v0.1.1, rbenv: 2.0.0-p0) [gem]" level="application" />
45
- <orderEntry type="library" scope="PROVIDED" name="thread_safe (v0.3.3, rbenv: 2.0.0-p0) [gem]" level="application" />
46
- <orderEntry type="library" scope="PROVIDED" name="tzinfo (v1.1.0, rbenv: 2.0.0-p0) [gem]" level="application" />
47
- </component>
48
- </module>
49
-