dirseq 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 84e91d3823af5395053c2104197b68223d3e4d96
4
- data.tar.gz: 7488e7557cd4005dcfc8b6f3c504d4e250434e5b
3
+ metadata.gz: 7b2362c43bff2a2cd43f0dc727bf8d713e4ab3c4
4
+ data.tar.gz: 7a56c16b7bfe38543c8d217d9307dc4f18ea5d21
5
5
  SHA512:
6
- metadata.gz: f21a59e7fc5bf7e9cf77721ed50935a85a3123cb4fcc74a0a556666721d13449de00c93464e3defb8f3552f1872b7c2df49ea2168810354dd89946eaa5035205
7
- data.tar.gz: e202cb7e0f00eb15b76cb91ccafb55b00fbe1269b617088f8d601b7f94d55b56fd900ecef578584fbaebacebaffe3c5e999e56a069b9a5c672921435e9bfb7b7
6
+ metadata.gz: 526abeb2d9b53cc0b0d26b3688d9b01ed44dea5d9b010d575b64922c8b3ae3d7097134db5fe23cff29855aa05f46449563ce7fcc575601a30e901782d90aaf7d
7
+ data.tar.gz: 8702f8ba681c9e161f97f76cfd763593ad266a77acf813a194ecbc7390ef08d46d6c0a68d6b60bebe46f2b9d86bc6bb0a1dbf51c0f1ae3861d33b27e775b1e59
data/Gemfile CHANGED
@@ -15,4 +15,5 @@ group :development do
15
15
  gem "jeweler", "~> 2.0"
16
16
  gem "bundler", "~> 1.6"
17
17
  gem "rspec", "~> 2.99"
18
+ gem 'pry', '~>0.10'
18
19
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.1.0
data/bin/dirseq CHANGED
@@ -4,7 +4,6 @@ require 'optparse'
4
4
  require 'bio-logger'
5
5
  require 'bio'
6
6
  require 'bio-commandeer'
7
- #require 'pry'
8
7
  require 'set'
9
8
  require 'tempfile'
10
9
 
@@ -95,12 +94,12 @@ end
95
94
  # Remove the ##FASTA and afterwards from the GFF file as this makes bedtools <2.25 fail
96
95
  # https://github.com/arq5x/bedtools2/issues/235#issuecomment-103776618
97
96
  no_fasta_gff = Tempfile.new('dirseq')
98
- Bio::Commandeer.run "sed '/^##FASTA$/,$d' #{gff_file.inspect} > #{no_fasta_gff.path}"
97
+ Bio::Commandeer.run "sed '/^##FASTA$/,$d' #{gff_file.inspect} > #{no_fasta_gff.path}", :log => log
99
98
  gff_file = no_fasta_gff.path
100
99
 
101
100
  covs_fwd = nil
102
101
  if options[:ignore_directions]
103
- cmd1 = "bedtools coverage -abam #{bam_file.inspect} -b #{gff_file.inspect} -hist"
102
+ cmd1 = "bedtools coverage -b #{bam_file.inspect} -a #{gff_file.inspect} -hist"
104
103
  cov_lines_fwd = Bio::Commandeer.run cmd1, :log => log
105
104
  log.info "Parsing coverage profiles"
106
105
  covs_fwd = get_covs.call(cov_lines_fwd)
@@ -109,10 +108,10 @@ else
109
108
  # fwd read 1
110
109
  read1_flag = '-F128' #account for read1 in pair, as well as single reads mapping
111
110
  read2_flag = '-f128'
112
- cmdf1 = "samtools view -u #{read1_flag} #{bam_file.inspect} |bedtools coverage -abam /dev/stdin -b #{gff_file.inspect} -hist -s"
113
- cmdf2 = "samtools view -u #{read2_flag} #{bam_file.inspect} |bedtools coverage -abam /dev/stdin -b #{gff_file.inspect} -hist -s"
114
- cmdr1 = "samtools view -u #{read1_flag} #{bam_file.inspect} |bedtools coverage -abam /dev/stdin -b #{gff_file.inspect} -hist -S"
115
- cmdr2 = "samtools view -u #{read2_flag} #{bam_file.inspect} |bedtools coverage -abam /dev/stdin -b #{gff_file.inspect} -hist -S"
111
+ cmdf1 = "samtools view -u #{read1_flag} #{bam_file.inspect} |bedtools coverage -b /dev/stdin -a #{gff_file.inspect} -hist -s"
112
+ cmdf2 = "samtools view -u #{read2_flag} #{bam_file.inspect} |bedtools coverage -b /dev/stdin -a #{gff_file.inspect} -hist -s"
113
+ cmdr1 = "samtools view -u #{read1_flag} #{bam_file.inspect} |bedtools coverage -b /dev/stdin -a #{gff_file.inspect} -hist -S"
114
+ cmdr2 = "samtools view -u #{read2_flag} #{bam_file.inspect} |bedtools coverage -b /dev/stdin -a #{gff_file.inspect} -hist -S"
116
115
 
117
116
  command_to_parsed = lambda do |cmds, name|
118
117
  covs_lines_initial = cmds.collect do |cmd|
@@ -122,7 +121,6 @@ else
122
121
  log.info "Parsing #{name}"
123
122
  get_covs.call(lines)
124
123
  end
125
- #binding.pry
126
124
  covs = covs_initial[0]
127
125
  covs_initial[1].each do |cov_key, cov|
128
126
  covs[cov_key] += cov
@@ -0,0 +1,3 @@
1
+ ##gff-version 3
2
+ ##sequence-region contig_100 1 42207
3
+ contig_100 Prodigal_v2.60 CDS 2 127 0.5 + 0 ID=PROKKA_00001;eC_number=2.1.1.-;gene=ycgJ_1;inference=ab initio prediction:Prodigal:2.60,similar to AA sequence:UniProtKB:O31474;locus_tag=PROKKA_00001;product=putative methyltransferase YcgJ
data/spec/script_spec.rb CHANGED
@@ -39,4 +39,16 @@ describe 'script' do
39
39
 
40
40
  found.should == answer
41
41
  end
42
+
43
+ it 'should print annotation out properly' do
44
+ answer = %w(
45
+ contig type start end strand forward_average_coverage reverse_average_coverage annotation
46
+ ).join("\t")+"\n"+%w(
47
+ contig_100 CDS 2 127 + 0.0 1.1428571428571428 putative
48
+ ).join("\t")+" methyltransferase YcgJ\n"
49
+
50
+ found = Bio::Commandeer.run "#{path_to_script} --bam #{data_dir}/eg.bam --gff #{data_dir}/realer.gff -q"
51
+
52
+ found.should == answer
53
+ end
42
54
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dirseq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben J. Woodcroft
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-09 00:00:00.000000000 Z
11
+ date: 2016-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bio-commandeer
@@ -142,6 +142,20 @@ dependencies:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
144
  version: '2.99'
145
+ - !ruby/object:Gem::Dependency
146
+ name: pry
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '0.10'
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: '0.10'
145
159
  description: FPKG (gene expression metric) calculator for metatranscriptomics
146
160
  email: donttrustben near gmail.com
147
161
  executables:
@@ -164,6 +178,7 @@ files:
164
178
  - spec/data/eg.bam
165
179
  - spec/data/eg.gff
166
180
  - spec/data/eg_with_fasta.gff
181
+ - spec/data/realer.gff
167
182
  - spec/script_spec.rb
168
183
  - spec/spec_helper.rb
169
184
  homepage: http://github.com/wwood/dirseq
@@ -186,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
201
  version: '0'
187
202
  requirements: []
188
203
  rubyforge_project:
189
- rubygems_version: 2.2.2
204
+ rubygems_version: 2.4.5.1
190
205
  signing_key:
191
206
  specification_version: 4
192
207
  summary: FPKG calculator for metatranscriptomics