basil 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.
data/bin/basil ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'ostruct'
4
+ require 'optparse'
5
+ require 'pp'
6
+
7
+ require 'bundler'
8
+ Bundler.require :default
9
+
10
+ opts = Trollop::options do
11
+
12
+ version "Basil PRE-RELEASE"
13
+ banner <<-EOS
14
+ Basil is an HTPS demultiplexer
15
+
16
+ Usage:
17
+ basil [options] -i <reads/directory> -o <output directory>
18
+ where [options] are:
19
+ EOS
20
+
21
+ opt :barcodes, 'barcodes definition file', short: 'b', type: String
22
+ opt :reads, 'reads (fastq/fasta/qseq)', short: 'i'
23
+ opt :illumina, 'Illumina output directory', short: 'd'
24
+ opt :pretrim, 'trim N nucleotides from start', type: Integer
25
+ opt :afttrim, 'trim N nucleotides from end', type: Integer
26
+ opt :out, 'output directory', short: 'o', type: String
27
+ end
28
+
29
+ filename = ARGV.shift
data/lib/basil.rb ADDED
@@ -0,0 +1,3 @@
1
+ Dir.glob(File.join(File.dirname(__FILE__), 'basil', '*.rb')).each do |f|
2
+ require f
3
+ end
data/readme.md ADDED
@@ -0,0 +1,11 @@
1
+ # Basil
2
+
3
+ Yet another tool for splitting barcoded sequences. It had to be done.
4
+
5
+ ## Installation
6
+
7
+ gem install basil
8
+
9
+ ## Usage
10
+
11
+ basil -h
@@ -0,0 +1,38 @@
1
+ require 'spec_helper'
2
+
3
+ describe Basil do
4
+
5
+ let (:barcodes) {
6
+ {
7
+ 1 => 'gggg',
8
+ 2 => 'aaaa',
9
+ 3 => 'tttt',
10
+ 4 => 'cccc',
11
+ }
12
+ }
13
+
14
+ let (:basil) { Basil.new barcodes }
15
+
16
+ let (:dna) { 'ggggtcatcatcatcatcatcatca' }
17
+
18
+ it 'can be created' do
19
+ barcodes.should_not raise_error TypeError
20
+ end
21
+
22
+ it 'raises an error if duplicate barcodes are specified' do
23
+ Basil.new({ 1 => 'gggg', 2 => 'gggg' }).should raise_error
24
+ end
25
+
26
+ it '#recognize returns the name of matched barcode' do
27
+ basil.recognize(dna).should == 1
28
+ end
29
+
30
+ it '#recognize is case insensitive' do
31
+ basil.recognize(dna.upcase!).should == 1
32
+ end
33
+
34
+ it '#recognize does not recognize barcodes in the middle of sequences' do
35
+ basil.recognize('aggggaaa').should be_nil
36
+ end
37
+
38
+ end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe Buffer do
4
+
5
+ let (:buffer) { Buffer.new }
6
+
7
+ it 'can be created' do
8
+ buffer.should_not raise_error TypeError
9
+ end
10
+
11
+ it 'can be given stuff' do
12
+ buffer['thing'] << 'another thing'
13
+ buffer['thing'].first.should == 'another thing'
14
+ end
15
+ end
@@ -0,0 +1,3 @@
1
+ $LOAD_PATH << File.join(File.dirname(__FILE__), 'lib')
2
+
3
+ require 'basil'
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: basil
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Austin G. Davis-Richardson
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2010-02-10 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: dna
16
+ requirement: &70286137539700 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 0.0.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70286137539700
25
+ - !ruby/object:Gem::Dependency
26
+ name: trollop
27
+ requirement: &70286137539140 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70286137539140
36
+ - !ruby/object:Gem::Dependency
37
+ name: rspec
38
+ requirement: &70286137538460 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *70286137538460
47
+ description: Split multiplexed high-throughput sequencing reads by barcode.
48
+ email: harekrishna@gmail.com
49
+ executables:
50
+ - basil
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - lib/basil.rb
55
+ - spec/basil_spec.rb
56
+ - spec/buffer_spec.rb
57
+ - spec/spec_helper.rb
58
+ - readme.md
59
+ - bin/basil
60
+ homepage: http://github.com/audy/basil
61
+ licenses: []
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ requirements: []
79
+ rubyforge_project:
80
+ rubygems_version: 1.8.15
81
+ signing_key:
82
+ specification_version: 3
83
+ summary: HTPS demultiplexer
84
+ test_files: []