bio-gadget 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.org CHANGED
@@ -17,13 +17,16 @@ Currently available commands are
17
17
 
18
18
  : bio
19
19
  : ---
20
- : gthor bio:fqlzma # automatic (re)compression of *.fq(.gz|.bz2) files
21
- : gthor bio:qvstat QUAL # statistics of quality values in *.qual file
20
+ : gthor bio:fqlzma # automatic (re)compression of *.fq(.gz|.bz2) files
21
+ : gthor bio:qvstat QUAL # statistics of quality values in *.qual file
22
+ : gthor bio:wigchr WIG CHR # extract wiggle track on specified chromosome
22
23
 
23
24
  * Contributing
24
25
 
25
26
  1. Fork it
26
27
  2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Added some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create new Pull Request
28
+ 3. (optional) Install gems (`bundle`)
29
+ 4. Add your feature
30
+ 5. Commit your changes (`git commit -am 'Added some feature'`)
31
+ 6. Push to the branch (`git push origin my-new-feature`)
32
+ 7. Create new Pull Request
@@ -1,3 +1,24 @@
1
1
  require 'bio-gadget/version'
2
2
  require 'bio-gadget/fqlzma'
3
3
  require 'bio-gadget/qvstat'
4
+ require 'bio-gadget/wigchr'
5
+
6
+ module Bio
7
+ class Gadget < Thor
8
+
9
+ namespace :bio
10
+
11
+ private
12
+
13
+ def myopen(file, &block)
14
+ # how to write?
15
+ f = (/\|/ !~ file && /\.gz$/ =~ file) ? "| gunzip -c #{file}" : file
16
+ unless block.nil?
17
+ o = open(f); block.call(o); o.close
18
+ else
19
+ open(f)
20
+ end
21
+ end
22
+
23
+ end
24
+ end
@@ -30,17 +30,5 @@ module Bio
30
30
  }
31
31
  end
32
32
 
33
- private
34
-
35
- def myopen(file, &block)
36
- # how to write?
37
- f = (/\|/ !~ file && /\.gz$/ =~ file) ? "| gunzip -c #{file}" : file
38
- unless block.nil?
39
- o = open(f); block.call(o); o.close
40
- else
41
- open(f)
42
- end
43
- end
44
-
45
33
  end
46
34
  end
@@ -3,7 +3,7 @@ require 'thor'
3
3
  module Bio
4
4
  class Gadget < Thor
5
5
 
6
- VERSION = "0.1.1"
6
+ VERSION = "0.1.2"
7
7
 
8
8
  end
9
9
  end
@@ -0,0 +1,28 @@
1
+ module Bio
2
+ class Gadget < Thor
3
+
4
+ namespace :bio
5
+
6
+ desc 'wigchr WIG CHR', 'extract wiggle track on specified chromosome'
7
+ def wigchr(wigfile, chr)
8
+ target = false
9
+ myopen(wigfile) { |fp|
10
+ fp.each { |line|
11
+ if (/^(fixed|variable)Step/ =~ line)
12
+ if (/chrom=#{chr}\s/ =~ line)
13
+ target = true
14
+ puts line
15
+ else
16
+ target = false
17
+ end
18
+ elsif (/^\d/ =~ line)
19
+ puts line if target
20
+ else
21
+ puts line
22
+ end
23
+ }
24
+ }
25
+ end
26
+
27
+ end
28
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio-gadget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-14 00:00:00.000000000 Z
12
+ date: 2012-11-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gthor
@@ -61,6 +61,7 @@ files:
61
61
  - lib/bio-gadget/fqlzma.rb
62
62
  - lib/bio-gadget/qvstat.rb
63
63
  - lib/bio-gadget/version.rb
64
+ - lib/bio-gadget/wigchr.rb
64
65
  homepage: https://github.com/shka/ruby-bio-gadget
65
66
  licenses: []
66
67
  post_install_message: