bio-gadget 0.4.0 → 0.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8b08f5a256d452f6399fe4484d6a18811bc3b58
4
- data.tar.gz: 532b1903529b32c549eb321e363d0dc8e8efaf27
3
+ metadata.gz: 83130daa98cf1f04006aba7a9602b52a036d8d9c
4
+ data.tar.gz: 3c99911a518cacaa4ee0661bbff1d007b506500b
5
5
  SHA512:
6
- metadata.gz: 23f150133d857f16a9ff0a326201fb044ec167d51fcf5addc23cb445ef219b75ff84038d457c3325fe076ce024b91d3afa2ffa33dcbba3c33401b9c75dfaf0bb
7
- data.tar.gz: edbfc69fcfa8f7db2003236fc8d7b01046a051955907ad45bb2939096b389d6c3a6f19c79d95dbf3212ed320a20c6f9bf477a5f57e3ce9a542ccedd52ab4e4e5
6
+ metadata.gz: 2869693a0cb2357c9d9bab623a6686475c96ef9b9e28e6498a3b8cbe66404f7d31cccbe3b09957436eab9c9c87442df37177b2ca3704244bd03f97d2bb09b9b8
7
+ data.tar.gz: 644f86a29aed0eebbf30031f54fe70b28ce607d8248b594d393396bee192e83aa30ea0faffebcc35ffd8bd294e36e3f1f6f99b5ba266b11cdc3f266db76a01c9
@@ -8,14 +8,16 @@ module Bio
8
8
 
9
9
  namespace :bio
10
10
 
11
- desc 'demlt BARCODE [FASTQ]', 'demultiplex fastq from STDIN by barcodes'
11
+ desc 'demlt BARCODE [FASTQ]', 'Demultiplex fastq from STDIN by barcodes. '
12
12
  option 'output-dir', :aliases => '-o', :type => :string, :default => '.'
13
- option 'umi-length', :aliases => '-u', :type => :numeric, :default => 4
14
- option 'cdna-length', :aliases => '-c', :type => :numeric, :default => 37
13
+ option 'umi-length', :aliases => '-u', :type => :numeric, :default => 4, :desc => '0 is no umi, means no PCR-amplicon removal.'
14
+ option 'cdna-length', :aliases => '-c', :type => :numeric, :default => 37, :desc => '-1 is no trimming by length.'
15
+ option 'g-trimming', :aliases => '-g', :type => :boolean, :default => false, :desc => "Trimming of 5'-end poly-G. Length of the trimmed Gs attached after the read name. This sets cdna-length option to -1."
15
16
  def demlt(bcfile, fastq=:stdin)
16
17
 
17
18
  ofs = options['umi-length']
18
- len = options['cdna-length']
19
+ trim = options['g-trimming']
20
+ len = trim ? -1 : options['cdna-length']
19
21
 
20
22
  wells = Array.new
21
23
  bcs = Array.new
@@ -115,7 +117,7 @@ module Bio
115
117
  outpath = "#{options['output-dir']}/#{well}.fq.xz"
116
118
  pid = Kernel.fork {
117
119
  left = ofs+bclen
118
- right = ofs+bclen+len-1
120
+ right = trim ? -1 : ofs+bclen+len-1
119
121
  preprocess = ofs > 0 ? <<"DEDUPandFORMAT"
120
122
  ruby -F'\\t' -anle 'f1=$F[1][0..#{right}];f2=$F[2][0..#{right}];puts([f1+f2, $F[0], f2, f1].join("\\t"))' #{fifo3paths[i]} \\
121
123
  | sort -k 1 -r | cut -f 2- | uniq -f 2 \\
@@ -124,6 +126,9 @@ DEDUPandFORMAT
124
126
  : <<"FORMAT"
125
127
  ruby -F'\\t' -anle 'puts(["@"+$F[0], $F[1][#{left}..#{right}], "+", $F[2][#{left}..#{right}].rstrip].join("\\n"))' #{fifo3paths[i]} \\
126
128
  FORMAT
129
+
130
+ preprocess += '| ruby -e \'require "bio-faster";Bio::Faster.new(:stdin).each_record(:quality=>:raw){|v|s=v[1].gsub(/^G+/,"");l=v[1].length-s.length;puts("@#{v[0]}|-G#{l}\\n#{s}\\n+\\n#{v[2][l,s.length]}")}\'' if trim
131
+
127
132
  exec preprocess+"| xz -z -c -e > #{outpath}"
128
133
  }
129
134
  }
@@ -3,7 +3,7 @@ require 'thor'
3
3
  module Bio
4
4
  class Gadget < Thor
5
5
 
6
- VERSION = "0.4.0"
6
+ VERSION = "0.4.1"
7
7
 
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio-gadget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shintaro Katayama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-02 00:00:00.000000000 Z
11
+ date: 2013-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor