bio-primer3 0.0.1.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.travis.yml +12 -0
- data/Gemfile +15 -0
- data/LICENSE.txt +20 -0
- data/README.md +47 -0
- data/README.rdoc +48 -0
- data/Rakefile +47 -0
- data/VERSION +1 -0
- data/lib/bio-primer3.rb +13 -0
- data/lib/bio/primer3/boulder_io.rb +86 -0
- data/lib/bio/primer3/result.rb +28 -0
- data/lib/bio/primer3/wrapper.rb +85 -0
- data/spec/bio-primer3_result_spec.rb +5 -0
- data/spec/bio-primer3_wrapper_spec.rb +61 -0
- data/spec/spec_helper.rb +12 -0
- metadata +173 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c135a6e6af65f1d5835a5016222aea290d37094b
|
4
|
+
data.tar.gz: 0b19ee1cf88372fba5615a5c261125a88e4be050
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a38bc5931d11fce297574a267ff71e02d9f0ae4cb0dd95e8753f9db952cc01d37fd7e707d5b4cbf0910e0a9b83fe7acc34c4faf4ba74c61a890a689754272ae5
|
7
|
+
data.tar.gz: c2a57e89dfbd65b6de1bca389c9fa1a87ad2a8a42a63ceddfaf635bcf3327812ff2d6f03d5cb42af59b83e89bf49bcbee582288e155163225b79cc1a5d26521f
|
data/.document
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 1.9.2
|
4
|
+
- 1.9.3
|
5
|
+
- jruby-19mode # JRuby in 1.9 mode
|
6
|
+
- rbx-19mode
|
7
|
+
# - 1.8.7
|
8
|
+
# - jruby-18mode # JRuby in 1.8 mode
|
9
|
+
# - rbx-18mode
|
10
|
+
|
11
|
+
# uncomment this line if your project needs to run something other than `rake`:
|
12
|
+
# script: bundle exec rspec spec
|
data/Gemfile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
gem 'bio', '~>1.4'
|
4
|
+
gem 'bio-logger', '~>1.0'
|
5
|
+
gem 'bio-commandeer', '~>0.1'
|
6
|
+
|
7
|
+
# Add dependencies to develop your gem here.
|
8
|
+
# Include everything needed to run rake, tests, features, etc.
|
9
|
+
group :development do
|
10
|
+
gem "rspec", "~> 2.8"
|
11
|
+
gem "yard", "~> 0.7"
|
12
|
+
gem "rdoc", "~> 3.12"
|
13
|
+
gem "jeweler", "~> 2.0"
|
14
|
+
gem "bundler", "~> 1.3"
|
15
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2012 Ben J Woodcroft
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# bio-primer3
|
2
|
+
|
3
|
+
[![Build Status](https://secure.travis-ci.org/wwood/bioruby-primer3.png)](http://travis-ci.org/wwood/bioruby-primer3)
|
4
|
+
|
5
|
+
Full description goes here
|
6
|
+
|
7
|
+
Note: this software is under active development!
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
```sh
|
12
|
+
gem install bio-primer3
|
13
|
+
```
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
require 'bio-primer3'
|
19
|
+
```
|
20
|
+
|
21
|
+
The API doc is online. For more code examples see the test files in
|
22
|
+
the source tree.
|
23
|
+
|
24
|
+
## Project home page
|
25
|
+
|
26
|
+
Information on the source tree, documentation, examples, issues and
|
27
|
+
how to contribute, see
|
28
|
+
|
29
|
+
http://github.com/wwood/bioruby-primer3
|
30
|
+
|
31
|
+
The BioRuby community is on IRC server: irc.freenode.org, channel: #bioruby.
|
32
|
+
|
33
|
+
## Cite
|
34
|
+
|
35
|
+
If you use this software, please cite one of
|
36
|
+
|
37
|
+
* [BioRuby: bioinformatics software for the Ruby programming language](http://dx.doi.org/10.1093/bioinformatics/btq475)
|
38
|
+
* [Biogem: an effective tool-based approach for scaling up open source software development in bioinformatics](http://dx.doi.org/10.1093/bioinformatics/bts080)
|
39
|
+
|
40
|
+
## Biogems.info
|
41
|
+
|
42
|
+
This Biogem is published at (http://biogems.info/index.html#bio-primer3)
|
43
|
+
|
44
|
+
## Copyright
|
45
|
+
|
46
|
+
Copyright (c) 2012 Ben J Woodcroft. See LICENSE.txt for further details.
|
47
|
+
|
data/README.rdoc
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
= bio-primer3
|
2
|
+
|
3
|
+
{<img
|
4
|
+
src="https://secure.travis-ci.org/wwood/bioruby-primer3.png"
|
5
|
+
/>}[http://travis-ci.org/#!/wwood/bioruby-primer3]
|
6
|
+
|
7
|
+
Full description goes here
|
8
|
+
|
9
|
+
Note: this software is under active development!
|
10
|
+
|
11
|
+
== Installation
|
12
|
+
|
13
|
+
gem install bio-primer3
|
14
|
+
|
15
|
+
== Usage
|
16
|
+
|
17
|
+
== Developers
|
18
|
+
|
19
|
+
To use the library
|
20
|
+
|
21
|
+
require 'bio-primer3'
|
22
|
+
|
23
|
+
The API doc is online. For more code examples see also the test files in
|
24
|
+
the source tree.
|
25
|
+
|
26
|
+
== Project home page
|
27
|
+
|
28
|
+
Information on the source tree, documentation, issues and how to contribute, see
|
29
|
+
|
30
|
+
http://github.com/wwood/bioruby-primer3
|
31
|
+
|
32
|
+
The BioRuby community is on IRC server: irc.freenode.org, channel: #bioruby.
|
33
|
+
|
34
|
+
== Cite
|
35
|
+
|
36
|
+
If you use this software, please cite one of
|
37
|
+
|
38
|
+
* [BioRuby: bioinformatics software for the Ruby programming language](http://dx.doi.org/10.1093/bioinformatics/btq475)
|
39
|
+
* [Biogem: an effective tool-based approach for scaling up open source software development in bioinformatics](http://dx.doi.org/10.1093/bioinformatics/bts080)
|
40
|
+
|
41
|
+
== Biogems.info
|
42
|
+
|
43
|
+
This Biogem is published at http://biogems.info/index.html#bio-primer3
|
44
|
+
|
45
|
+
== Copyright
|
46
|
+
|
47
|
+
Copyright (c) 2012 Ben J Woodcroft. See LICENSE.txt for further details.
|
48
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "bio-primer3"
|
18
|
+
gem.homepage = "http://github.com/wwood/bioruby-primer3"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Primer3-related Ruby code}
|
21
|
+
gem.description = %Q{Primer3-related Ruby code - wrappers, Boulder IO, etc.}
|
22
|
+
gem.email = "donttrustben@gmail.com"
|
23
|
+
gem.authors = ["Ben J Woodcroft"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rspec/core'
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
31
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
32
|
+
end
|
33
|
+
RSpec::Core::RakeTask.new(:test_without_wrapper) do |spec|
|
34
|
+
spec.pattern = FileList['spec/**/*_spec.rb'].reject{|f| f=='spec/bio-primer3_wrapper_spec.rb'}
|
35
|
+
end
|
36
|
+
|
37
|
+
task :default => :spec
|
38
|
+
|
39
|
+
require 'rdoc/task'
|
40
|
+
Rake::RDocTask.new do |rdoc|
|
41
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
42
|
+
|
43
|
+
rdoc.rdoc_dir = 'rdoc'
|
44
|
+
rdoc.title = "bio-primer3 #{version}"
|
45
|
+
rdoc.rdoc_files.include('README*')
|
46
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
47
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1.pre
|
data/lib/bio-primer3.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
require 'bio-logger'
|
3
|
+
Bio::Log::LoggerPlus.new('bio-primer3')
|
4
|
+
module Bio::Primer3Logging
|
5
|
+
def log
|
6
|
+
Bio::Log::LoggerPlus['bio-primer3']
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
require 'bio/primer3/boulder_io.rb'
|
11
|
+
require 'bio/primer3/wrapper.rb'
|
12
|
+
require 'bio/primer3/result.rb'
|
13
|
+
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# A class for input and output of Boulder I/O files, for instance as used in
|
2
|
+
# primer3. This (I don't think) is a full implementation of the Boulder I/O
|
3
|
+
# format, but serves for my purposes.
|
4
|
+
class BoulderIO
|
5
|
+
include Enumerable
|
6
|
+
|
7
|
+
class ParseException<Exception; end
|
8
|
+
|
9
|
+
class Record
|
10
|
+
include Enumerable
|
11
|
+
attr_accessor :attributes # a hash of key-value pairs
|
12
|
+
|
13
|
+
# Initialise, setting the hash optionally. If no hash is specified, then the
|
14
|
+
# attributes will be an empty hash
|
15
|
+
def initialize(hash=nil)
|
16
|
+
@attributes = hash
|
17
|
+
@attributes ||= {}
|
18
|
+
end
|
19
|
+
|
20
|
+
def to_s
|
21
|
+
ats = @attributes.collect do |key,value|
|
22
|
+
"#{key}=#{value}\n"
|
23
|
+
end
|
24
|
+
"#{ats.join("")}="
|
25
|
+
end
|
26
|
+
|
27
|
+
# Given a Boulder I/O formatted string, parse into a record
|
28
|
+
def self.create(boulder_io_string)
|
29
|
+
baby = self.new
|
30
|
+
|
31
|
+
boulder_io_string.split("\n").each do |line|
|
32
|
+
line.strip!
|
33
|
+
break if line=='=' #break on the final record
|
34
|
+
|
35
|
+
splits = line.split('=')
|
36
|
+
|
37
|
+
# error checking
|
38
|
+
if splits.length != 2
|
39
|
+
raise ParseException, "Could not parse Boulder I/O line: `#{line}', quitting"
|
40
|
+
end
|
41
|
+
|
42
|
+
baby[splits[0]] = splits[1]
|
43
|
+
end
|
44
|
+
baby #return the new'un for convenience
|
45
|
+
end
|
46
|
+
|
47
|
+
# for Enumerable-compatibility
|
48
|
+
def each
|
49
|
+
@attributes.each do |k,v|
|
50
|
+
yield k,v
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# Equivalent to attributes[] - this is a convenient method, isn't it?
|
55
|
+
def [](key)
|
56
|
+
@attributes[key]
|
57
|
+
end
|
58
|
+
|
59
|
+
# Equivalent to attributes[]= - this is a convenient method, isn't it?
|
60
|
+
def []=(key,value)
|
61
|
+
@attributes[key] = value
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# an array of records
|
66
|
+
attr_accessor :records
|
67
|
+
|
68
|
+
# Open a Boulder I/O file and parse it. It is possible to go through all the
|
69
|
+
# records:
|
70
|
+
#
|
71
|
+
# BoulderIO.open('/path/to/boulderio_file').each {|record| record}
|
72
|
+
def self.open(filename)
|
73
|
+
record_strings = File.open(filename).read.split("\n=\n")
|
74
|
+
@records = record_strings.collect do |s|
|
75
|
+
Record.create(s)
|
76
|
+
end
|
77
|
+
@records # return the records for convenience
|
78
|
+
end
|
79
|
+
|
80
|
+
# for Enumerable-compatibility
|
81
|
+
def each
|
82
|
+
@records.each do |r|
|
83
|
+
yield r
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Methods for interacting with Primer3 output.
|
2
|
+
class Bio::Primer3::Result
|
3
|
+
attr_accessor :output_hash
|
4
|
+
def initialize
|
5
|
+
@output_hash ||= {}
|
6
|
+
end
|
7
|
+
|
8
|
+
# Was there any primers found? Assumes you were looking for a left primer, with
|
9
|
+
# a right primer, which won't always be the case.
|
10
|
+
def primer_found?
|
11
|
+
@output_hash['PRIMER_PAIR_NUM_RETURNED'].to_i>0 or
|
12
|
+
(!@output_hash['PRIMER_LEFT_NUM_RETURNED'].nil? and
|
13
|
+
@output_hash['PRIMER_LEFT_NUM_RETURNED'].to_i>0
|
14
|
+
!@output_hash['PRIMER_RIGHT_NUM_RETURNED'].nil? and
|
15
|
+
@output_hash['PRIMER_RIGHT_NUM_RETURNED'].to_i>0)
|
16
|
+
end
|
17
|
+
alias_method :yeh?, :primer_found?
|
18
|
+
|
19
|
+
# Return the requested part of the result
|
20
|
+
def [](key)
|
21
|
+
@output_hash[key]
|
22
|
+
end
|
23
|
+
|
24
|
+
# set the requested part of the result
|
25
|
+
def []=(key,value)
|
26
|
+
@output_hash[key] = value
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
require 'tmpdir'
|
2
|
+
require 'bio'
|
3
|
+
require 'pp'
|
4
|
+
require 'bio-commandeer'
|
5
|
+
|
6
|
+
class Bio::Primer3
|
7
|
+
include Bio::Primer3Logging
|
8
|
+
def self.log
|
9
|
+
Bio::Primer3.new.log
|
10
|
+
end
|
11
|
+
|
12
|
+
# Can only handle single records to be passed at one time to primer3
|
13
|
+
def self.run(primer3_options_hash)
|
14
|
+
default_options = {}
|
15
|
+
unless primer3_options_hash.key?('PRIMER_THERMODYNAMIC_PARAMETERS_PATH')
|
16
|
+
@@thermodynamic_parameters_path ||= Bio::Primer3.compute_thermodynamic_parameters_path
|
17
|
+
if @@thermodynamic_parameters_path.nil?
|
18
|
+
log.warn "No primer3_config directory found, things might go awry when running primer3."
|
19
|
+
else
|
20
|
+
default_options['PRIMER_THERMODYNAMIC_PARAMETERS_PATH'] = @@thermodynamic_parameters_path
|
21
|
+
end
|
22
|
+
end
|
23
|
+
merged_hash = default_options.merge(primer3_options_hash)
|
24
|
+
|
25
|
+
input = BoulderIO::Record.new(merged_hash)
|
26
|
+
|
27
|
+
log = Bio::Log::LoggerPlus['bio-primer3']
|
28
|
+
if log.debug?
|
29
|
+
log.debug "Primer3 input:"
|
30
|
+
log.debug input.to_s
|
31
|
+
end
|
32
|
+
|
33
|
+
result = Bio::Primer3::Result.new
|
34
|
+
Dir.mktmpdir do |dir|
|
35
|
+
Dir.chdir(dir) do
|
36
|
+
out = Bio::Commandeer.run 'primer3_core', {:stdin => input.to_s, :log => log}
|
37
|
+
result.output_hash = BoulderIO::Record.create(out).attributes
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
return result
|
42
|
+
end
|
43
|
+
|
44
|
+
# By default, primer3_core can't find it's own parameters path
|
45
|
+
# (parameter PRIMER_THERMODYNAMIC_PARAMETERS_PATH) unless it is
|
46
|
+
# specified. This method computes the correct path based on the location
|
47
|
+
# of the primer3 executable, and returns the parameters folder
|
48
|
+
# based on it, or nil if none can be found
|
49
|
+
def self.compute_thermodynamic_parameters_path
|
50
|
+
guessed_path = File.join(
|
51
|
+
File.dirname(Bio::Commandeer.run('which primer3_core', :log => log).strip),
|
52
|
+
'primer3_config/'
|
53
|
+
)
|
54
|
+
if File.exist?(guessed_path) and File.directory?(guessed_path)
|
55
|
+
return guessed_path
|
56
|
+
else
|
57
|
+
return nil
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# Ask primer3 if 2 primers are compatible, without regard to the sequence
|
62
|
+
# that they PCR. i.e. work out if there is any primer dimer issue, for instance
|
63
|
+
# or whether they have disparate melting temperatures.
|
64
|
+
#
|
65
|
+
# Returns true/false and the Bio::Primer3::Result object.
|
66
|
+
# other_primer3_options_hash specifies options that are passed to primer3,
|
67
|
+
# and options gives Ruby options:
|
68
|
+
# * :return_result: Instead of true/false being returned, an array of [true/false, primer3_output_hash]
|
69
|
+
# is returned instead.
|
70
|
+
def self.test_primer_compatibility(primer1, primer2, other_primer3_options_hash={}, options={})
|
71
|
+
hash = {
|
72
|
+
'SEQUENCE_PRIMER'=>primer1,
|
73
|
+
'SEQUENCE_PRIMER_REVCOMP'=>primer2,
|
74
|
+
'PRIMER_TASK'=>'check_primers',
|
75
|
+
}.merge(other_primer3_options_hash)
|
76
|
+
|
77
|
+
result = Bio::Primer3.run(hash)
|
78
|
+
|
79
|
+
if options and options[:return_result]
|
80
|
+
return result.primer_found?, result
|
81
|
+
else
|
82
|
+
return result.primer_found?
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe "Primer3Wrapper" do
|
4
|
+
it "should run the example file fine" do
|
5
|
+
|
6
|
+
# This is straight from the example code, except without the P3_FILE_FLAG=1 line
|
7
|
+
example = <<EOF
|
8
|
+
SEQUENCE_ID=example
|
9
|
+
SEQUENCE_TEMPLATE=GTAGTCAGTAGACNATGACNACTGACGATGCAGACNACACACACACACACAGCACACAGGTATTAGTGGGCCATTCGATCCCGACCCAAATCGATAGCTACGATGACG
|
10
|
+
SEQUENCE_TARGET=37,21
|
11
|
+
PRIMER_TASK=generic
|
12
|
+
PRIMER_PICK_LEFT_PRIMER=1
|
13
|
+
PRIMER_PICK_INTERNAL_OLIGO=1
|
14
|
+
PRIMER_PICK_RIGHT_PRIMER=1
|
15
|
+
PRIMER_OPT_SIZE=18
|
16
|
+
PRIMER_MIN_SIZE=15
|
17
|
+
PRIMER_MAX_SIZE=21
|
18
|
+
PRIMER_MIN_TM=56
|
19
|
+
PRIMER_MAX_NS_ACCEPTED=2
|
20
|
+
PRIMER_PRODUCT_SIZE_RANGE=75-100
|
21
|
+
P3_FILE_FLAG=1
|
22
|
+
SEQUENCE_INTERNAL_EXCLUDED_REGION=37,21
|
23
|
+
PRIMER_EXPLAIN_FLAG=1
|
24
|
+
=
|
25
|
+
EOF
|
26
|
+
|
27
|
+
example_hash = {}
|
28
|
+
example.split("\n").reject{|s| s== '='}.each do |line|
|
29
|
+
splits = line.split('=')
|
30
|
+
example_hash[splits[0]]=splits[1]
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
result = Bio::Primer3.run(example_hash)
|
35
|
+
result.kind_of?(Bio::Primer3::Result).should eq(true)
|
36
|
+
|
37
|
+
result['SEQUENCE_ID'].should eq('example') #Something the same between the input and output
|
38
|
+
result['PRIMER_INTERNAL_0_PENALTY'].nil?.should eq(false) #Something only in the output
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'should correctly work out the path to the primer3 config directory' do
|
42
|
+
found_path = Bio::Primer3.compute_thermodynamic_parameters_path
|
43
|
+
found_path.match(/primer3_config\/$/).nil?.should eq(false)
|
44
|
+
found_path.length.should > 15 #should give an actual path
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should ok reasonable primers" do
|
48
|
+
Bio::Primer3.test_primer_compatibility('NATGACNACTGACGATGCAGA', 'TCGTAGCTATCGATTTGGGT', {'PRIMER_MIN_TM'=>56, 'PRIMER_MAX_NS_ACCEPTED'=>2}).should eq(true)
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should return object checking primers" do
|
52
|
+
bool, result = Bio::Primer3.test_primer_compatibility('NATGACNACTGACGATGCAGA', 'TCGTAGCTATCGATTTGGGT', {'PRIMER_MIN_TM'=>56, 'PRIMER_MAX_NS_ACCEPTED'=>2}, :return_result => true)
|
53
|
+
bool.should eq(true)
|
54
|
+
result.kind_of?(Bio::Primer3::Result).should == true
|
55
|
+
end
|
56
|
+
|
57
|
+
it "should not ok reasonable primers" do
|
58
|
+
# Won't work because there is an N in the moddle of the right primer
|
59
|
+
Bio::Primer3.test_primer_compatibility('ATTGACACTGACGATGCAGA', 'ATACGATTTGNGGTCGGGAT', 'PRIMER_MAX_NS_ACCEPTED'=>0).should eq(false)
|
60
|
+
end
|
61
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'bio-primer3'
|
5
|
+
|
6
|
+
# Requires supporting files with custom matchers and macros, etc,
|
7
|
+
# in ./support/ and its subdirectories.
|
8
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,173 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bio-primer3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1.pre
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ben J Woodcroft
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-03-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bio
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.4'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.4'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bio-logger
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bio-commandeer
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.1'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.8'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.8'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: yard
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.7'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.7'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rdoc
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.12'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.12'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: jeweler
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '2.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '2.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: bundler
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '1.3'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '1.3'
|
125
|
+
description: Primer3-related Ruby code - wrappers, Boulder IO, etc.
|
126
|
+
email: donttrustben@gmail.com
|
127
|
+
executables: []
|
128
|
+
extensions: []
|
129
|
+
extra_rdoc_files:
|
130
|
+
- LICENSE.txt
|
131
|
+
- README.md
|
132
|
+
- README.rdoc
|
133
|
+
files:
|
134
|
+
- ".document"
|
135
|
+
- ".travis.yml"
|
136
|
+
- Gemfile
|
137
|
+
- LICENSE.txt
|
138
|
+
- README.md
|
139
|
+
- README.rdoc
|
140
|
+
- Rakefile
|
141
|
+
- VERSION
|
142
|
+
- lib/bio-primer3.rb
|
143
|
+
- lib/bio/primer3/boulder_io.rb
|
144
|
+
- lib/bio/primer3/result.rb
|
145
|
+
- lib/bio/primer3/wrapper.rb
|
146
|
+
- spec/bio-primer3_result_spec.rb
|
147
|
+
- spec/bio-primer3_wrapper_spec.rb
|
148
|
+
- spec/spec_helper.rb
|
149
|
+
homepage: http://github.com/wwood/bioruby-primer3
|
150
|
+
licenses:
|
151
|
+
- MIT
|
152
|
+
metadata: {}
|
153
|
+
post_install_message:
|
154
|
+
rdoc_options: []
|
155
|
+
require_paths:
|
156
|
+
- lib
|
157
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '0'
|
162
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 1.3.1
|
167
|
+
requirements: []
|
168
|
+
rubyforge_project:
|
169
|
+
rubygems_version: 2.2.0
|
170
|
+
signing_key:
|
171
|
+
specification_version: 4
|
172
|
+
summary: Primer3-related Ruby code
|
173
|
+
test_files: []
|