bio-kallisto 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 36048108c5b9813bf977518cf77b594d149b9082
4
+ data.tar.gz: 14574c16217eb8cc0104e6dbe09e32e331af1fd2
5
+ SHA512:
6
+ metadata.gz: 038678b6cda9589385e8d9d5e3d10d2f9eda5d7c6149f252711c651a820b34db2dee47345fcfebb53f277486a5824a541a1c33e2b1e9b7087ab83272c3d4ada2
7
+ data.tar.gz: a8d95291fcf1a1587a0776dc6f87fe62325df8c749331d9d9cdb6a3ef44ca47aabfe8e34f088bf9b1548c6db9d53bba46e732ccd8e0b33eee4cc62cdb10371c5
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
@@ -0,0 +1,15 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.0
4
+ - 2.2.0
5
+ # - 1.9.2
6
+ # - 1.9.3
7
+ # - jruby-19mode # JRuby in 1.9 mode
8
+
9
+ # - rbx-19mode
10
+ # - 1.8.7
11
+ # - jruby-18mode # JRuby in 1.8 mode
12
+ # - rbx-18mode
13
+
14
+ # uncomment this line if your project needs to run something other than `rake`:
15
+ # script: bundle exec rspec spec
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+ gem "systemu", ">=2.5.2"
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "shoulda", ">= 0"
10
+ gem "rdoc", "~> 3.12"
11
+ gem "simplecov", ">= 0"
12
+ gem "jeweler", ">=2.0.1"
13
+ gem "bundler", ">= 1.0.21"
14
+ gem "bio", ">= 1.4.2"
15
+ end
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2015 homonecloco
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.
@@ -0,0 +1,47 @@
1
+ # bio-kallisto
2
+
3
+ [![Build Status](https://secure.travis-ci.org/homonecloco/bioruby-kallisto.png)](http://travis-ci.org/homonecloco/bioruby-kallisto)
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-kallisto
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```ruby
18
+ require 'bio-kallisto'
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/homonecloco/bioruby-kallisto
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-kallisto)
43
+
44
+ ## Copyright
45
+
46
+ Copyright (c) 2015 homonecloco. See LICENSE.txt for further details.
47
+
@@ -0,0 +1,48 @@
1
+ = bio-kallisto
2
+
3
+ {<img
4
+ src="https://secure.travis-ci.org/homonecloco/bioruby-kallisto.png"
5
+ />}[http://travis-ci.org/#!/homonecloco/bioruby-kallisto]
6
+
7
+ Full description goes here
8
+
9
+ Note: this software is under active development!
10
+
11
+ == Installation
12
+
13
+ gem install bio-kallisto
14
+
15
+ == Usage
16
+
17
+ == Developers
18
+
19
+ To use the library
20
+
21
+ require 'bio-kallisto'
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/homonecloco/bioruby-kallisto
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-kallisto
44
+
45
+ == Copyright
46
+
47
+ Copyright (c) 2015 homonecloco. See LICENSE.txt for further details.
48
+
@@ -0,0 +1,51 @@
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://guides.rubygems.org/specification-reference/ for more options
17
+ gem.name = "bio-kallisto"
18
+ gem.homepage = "http://github.com/homonecloco/bioruby-kallisto"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{Basic wrapper for the Kallistio Mapper}
21
+ gem.description = %Q{Basic wrapper for the Kallistio Mapper}
22
+ gem.email = "ricardo.ramirez-gonzalez@tgac.ac.uk"
23
+ gem.authors = ["homonecloco"]
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require 'rake/testtask'
29
+ Rake::TestTask.new(:test) do |test|
30
+ test.libs << 'lib' << 'test'
31
+ test.pattern = 'test/**/test_*.rb'
32
+ test.verbose = true
33
+ end
34
+
35
+ desc "Code coverage detail"
36
+ task :simplecov do
37
+ ENV['COVERAGE'] = "true"
38
+ Rake::Task['test'].execute
39
+ end
40
+
41
+ task :default => :test
42
+
43
+ require 'rdoc/task'
44
+ Rake::RDocTask.new do |rdoc|
45
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
46
+
47
+ rdoc.rdoc_dir = 'rdoc'
48
+ rdoc.title = "bio-kallisto #{version}"
49
+ rdoc.rdoc_files.include('README*')
50
+ rdoc.rdoc_files.include('lib/**/*.rb')
51
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,9 @@
1
+ #!/bin/env ruby
2
+
3
+
4
+ $: << File.expand_path(File.dirname(__FILE__) + '/../lib')
5
+ $: << File.expand_path('.')
6
+ path= File.expand_path(File.dirname(__FILE__) + '/../lib/bio-kallisto.rb')
7
+ require path
8
+
9
+ Bio::Kallisto.index(reference: ARGV[0])
@@ -0,0 +1,9 @@
1
+ #!/bin/env ruby
2
+
3
+
4
+ $: << File.expand_path(File.dirname(__FILE__) + '/../lib')
5
+ $: << File.expand_path('.')
6
+ path= File.expand_path(File.dirname(__FILE__) + '/../lib/bio-kallisto.rb')
7
+ require path
8
+
9
+ Bio::Kallisto.map(index:ARGV[0], fastq:[ARGV[1], ARGV[2]], output_dir:ARGV[3] )
@@ -0,0 +1,34 @@
1
+ require 'rbconfig'
2
+ require 'open-uri'
3
+ require 'fileutils'
4
+ include FileUtils::Verbose
5
+ require 'rake/clean'
6
+
7
+ version="0.42.3"
8
+ URL="https://github.com/pachterlab/kallisto/archive/v#{version}.tar.gz"
9
+ path = File.expand_path(File.dirname(__FILE__))
10
+ puts path
11
+ #path_external = File.join ( path , "../lib/bio/external" )
12
+
13
+
14
+ task :download do
15
+ open(URL) do |uri|
16
+ File.open("v#{version}.tar.gz",'wb') do |fout|
17
+ fout.write(uri.read)
18
+ end #fout
19
+ end #uri
20
+ end
21
+
22
+ task :compile do
23
+ sh "tar -xzf v#{version}.tar.gz"
24
+ cd ("kallisto-#{version}") do
25
+ mkdir "build"
26
+ cd "build" do
27
+ sh "cmake -DCMAKE_INSTALL_PREFIX:PATH=#{path}/../lib/bio/external .."
28
+ sh "make"
29
+ sh "make install"
30
+ end
31
+ end
32
+ end
33
+ #task :default => [:download, :compile, :clean]
34
+ task :default => [:download, :compile]
@@ -0,0 +1,12 @@
1
+ # Please require your code below, respecting the naming conventions in the
2
+ # bioruby directory tree.
3
+ #
4
+ # For example, say you have a plugin named bio-plugin, the only uncommented
5
+ # line in this file would be
6
+ #
7
+ # require 'bio/bio-plugin/plugin'
8
+ #
9
+ # In this file only require other files. Avoid other source code.
10
+
11
+ require 'bio-kallisto/kallisto.rb'
12
+
@@ -0,0 +1,49 @@
1
+ require 'systemu'
2
+
3
+ module Bio
4
+ class Kallisto
5
+
6
+ def self.index (reference:, output_index:nil, k:31 , unique: false )
7
+
8
+ $stderr.put "reference undefined " unless reference
9
+
10
+ output_index = "#{reference}.kallisto.k#{k}" unless output_index
11
+
12
+ extra=""
13
+ extra="--make-unique" if unique
14
+
15
+ command = "kallisto index --kmer-size=#{k} --index=#{output_index} #{extra} #{reference}"
16
+ status, stdout, stderr = systemu command
17
+ if status.exitstatus != 0
18
+ $stderr.puts "Failed to run wrapping command correctly, as non-zero exit status "+
19
+ "#{status.exitstatus} detected. Command run was `#{command}'"
20
+ return false
21
+ else
22
+ return true
23
+ end
24
+ end
25
+
26
+ def self.map(index:, fastq:, output_dir:, single:false, bias:false, fragment_length:0, pseudobam:false, bootstrap_samples:0, threads:1, seed:42)
27
+
28
+ extra = ""
29
+ extra += " --single" if single
30
+ extra += " --bias" if bias
31
+ extra += " --fragment-length=#{fragment_length}" if fragment_length > 0
32
+ extra += " --pseudobam" if pseudobam
33
+ extra += " --bootstrap-samples=#{bootstrap-samples}" if bootstrap_samples > 0
34
+ extra += " --threads=#{threads}" if threads > 1
35
+ extra += " --seed=#{seed}" if seed != 42
36
+ command = "kallisto quant --index=#{index} --output-dir=#{output_dir} #{extra} #{fastq.join(' ')}"
37
+
38
+ status, stdout, stderr = systemu command
39
+ if status.exitstatus != 0
40
+ $stderr.puts "Failed to run wrapping command correctly, as non-zero exit status "+
41
+ "#{status.exitstatus} detected. Command run was `#{command}'"
42
+ return false
43
+ else
44
+ return true
45
+ end
46
+
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,34 @@
1
+ require 'simplecov'
2
+
3
+ module SimpleCov::Configuration
4
+ def clean_filters
5
+ @filters = []
6
+ end
7
+ end
8
+
9
+ SimpleCov.configure do
10
+ clean_filters
11
+ load_adapter 'test_frameworks'
12
+ end
13
+
14
+ ENV["COVERAGE"] && SimpleCov.start do
15
+ add_filter "/.rvm/"
16
+ end
17
+ require 'rubygems'
18
+ require 'bundler'
19
+ begin
20
+ Bundler.setup(:default, :development)
21
+ rescue Bundler::BundlerError => e
22
+ $stderr.puts e.message
23
+ $stderr.puts "Run `bundle install` to install missing gems"
24
+ exit e.status_code
25
+ end
26
+ require 'test/unit'
27
+ require 'shoulda'
28
+
29
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
30
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
31
+ require 'bio-kallisto'
32
+
33
+ class Test::Unit::TestCase
34
+ end
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestBioKallisto < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,161 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bio-kallisto
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - homonecloco
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-10-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: systemu
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.5.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 2.5.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: shoulda
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rdoc
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.12'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.12'
55
+ - !ruby/object:Gem::Dependency
56
+ name: simplecov
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: jeweler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 2.0.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 2.0.1
83
+ - !ruby/object:Gem::Dependency
84
+ name: bundler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 1.0.21
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 1.0.21
97
+ - !ruby/object:Gem::Dependency
98
+ name: bio
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: 1.4.2
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: 1.4.2
111
+ description: Basic wrapper for the Kallistio Mapper
112
+ email: ricardo.ramirez-gonzalez@tgac.ac.uk
113
+ executables:
114
+ - kallisto_index.rb
115
+ - kallisto_map.rb
116
+ extensions: []
117
+ extra_rdoc_files:
118
+ - LICENSE.txt
119
+ - README.md
120
+ - README.rdoc
121
+ files:
122
+ - ".document"
123
+ - ".travis.yml"
124
+ - Gemfile
125
+ - LICENSE.txt
126
+ - README.md
127
+ - README.rdoc
128
+ - Rakefile
129
+ - VERSION
130
+ - bin/kallisto_index.rb
131
+ - bin/kallisto_map.rb
132
+ - ext/Rakefile
133
+ - lib/bio-kallisto.rb
134
+ - lib/bio-kallisto/kallisto.rb
135
+ - test/helper.rb
136
+ - test/test_bio-kallisto.rb
137
+ homepage: http://github.com/homonecloco/bioruby-kallisto
138
+ licenses:
139
+ - MIT
140
+ metadata: {}
141
+ post_install_message:
142
+ rdoc_options: []
143
+ require_paths:
144
+ - lib
145
+ required_ruby_version: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ required_rubygems_version: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ version: '0'
155
+ requirements: []
156
+ rubyforge_project:
157
+ rubygems_version: 2.4.7
158
+ signing_key:
159
+ specification_version: 4
160
+ summary: Basic wrapper for the Kallistio Mapper
161
+ test_files: []