bacterial-annotator 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bacterial-annotator/sequence-annotation.rb +61 -50
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ab5e91d3ae7a0f2f62ca3ea90de6e84b0686130
|
4
|
+
data.tar.gz: c0df480e3019afc0d152e25134f3b73a2a57c970
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bea8cc8a8a8ffc3ccda0a2dc222046be507d8fba2e95a17ee84e93330b974584e5562658f8cfd8e512384ba615b40800258628588d0f3b5ed34af3aa587f398d
|
7
|
+
data.tar.gz: 26b0cbeff8c9142c6585bd73ff03fbafeb0cb8be953a846b2ed6ffdad80e355cf78cdeb131ac91624e85bf83e9a6cda049eb5a6983e5ff36c91c5d47ad4209f2
|
@@ -196,70 +196,81 @@ class SequenceAnnotation
|
|
196
196
|
|
197
197
|
hit = nil
|
198
198
|
|
199
|
-
|
200
|
-
|
199
|
+
if ! synteny_prot.has_key? prot_id or
|
200
|
+
! synteny_prot[prot_id].has_key? :homology or
|
201
|
+
! annotations.has_key? synteny_prot[prot_id][:homology][:hits][0] or
|
202
|
+
synteny_prot[prot_id][:homology][:assert_cutoff].inject(:+) < 3
|
203
|
+
|
204
|
+
qLocusTag = Bio::Feature::Qualifier.new('locus_tag', "#{prot_id}")
|
205
|
+
qProd = Bio::Feature::Qualifier.new('product', "hypothetical protein")
|
206
|
+
|
207
|
+
ftArray.push(qLocusTag)
|
208
|
+
ftArray.push(qProd)
|
209
|
+
|
210
|
+
if synteny_prot.has_key? prot_id and
|
211
|
+
synteny_prot[prot_id].has_key? :homology and
|
212
|
+
synteny_prot[prot_id][:homology][:assert_cutoff] == [1,1,0]
|
213
|
+
hit = annotations[synteny_prot[prot_id][:homology][:hits][0]]
|
214
|
+
qNote = Bio::Feature::Qualifier.new('note', "possible pseudo gene of #{hit[:locustag]} from #{ref_genome}")
|
215
|
+
ftArray.push(qNote)
|
216
|
+
end
|
201
217
|
|
202
|
-
# puts "#{annotations.keys}"
|
203
|
-
if annotations.has_key? synteny_prot[prot_id][:homology][:hits][0]
|
204
|
-
hit = annotations[synteny_prot[prot_id][:homology][:hits][0]]
|
205
|
-
# puts hit
|
206
218
|
else
|
207
|
-
puts "no hit for #{prot_id}"
|
208
|
-
next
|
209
|
-
end
|
210
219
|
|
211
|
-
|
220
|
+
hit = annotations[synteny_prot[prot_id][:homology][:hits][0]]
|
212
221
|
|
213
|
-
|
222
|
+
if synteny_prot.has_key? prot_id
|
214
223
|
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
224
|
+
locus, gene, product, note, inference = nil
|
225
|
+
locus = hit[:locustag]
|
226
|
+
gene = hit[:gene]
|
227
|
+
product = hit[:product]
|
228
|
+
note = hit[:note]
|
229
|
+
inference = hit[:inference]
|
230
|
+
pId = synteny_prot[prot_id][:homology][:pId]
|
231
|
+
cov_query = (synteny_prot[prot_id][:homology][:cov_query]*100).round(2)
|
232
|
+
cov_subject = (synteny_prot[prot_id][:homology][:cov_subject]*100).round(2)
|
233
|
+
reference_prot_id = synteny_prot[prot_id][:homology][:hits][0]
|
225
234
|
|
226
|
-
|
227
|
-
|
235
|
+
qLocusTag = Bio::Feature::Qualifier.new('locus_tag', "#{prot_id}")
|
236
|
+
ftArray.push(qLocusTag)
|
228
237
|
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
238
|
+
if gene != nil
|
239
|
+
qGene = Bio::Feature::Qualifier.new('gene', gene)
|
240
|
+
ftArray.push(qGene)
|
241
|
+
end
|
233
242
|
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
243
|
+
if product != nil
|
244
|
+
qProd = Bio::Feature::Qualifier.new('product', product)
|
245
|
+
ftArray.push(qProd)
|
246
|
+
end
|
238
247
|
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
248
|
+
# check if there is a reference genome.. reference_locus shouldn't be nil in that case
|
249
|
+
if locus != nil
|
250
|
+
qNote = Bio::Feature::Qualifier.new('note', "corresponds to #{locus} locus (AA identity: #{pId}%; coverage(q,s): #{cov_query}%,#{cov_subject}%) from #{ref_genome}")
|
251
|
+
ftArray.push(qNote)
|
252
|
+
|
253
|
+
db_source = "[DBSource]"
|
254
|
+
if reference_prot_id.include? "_"
|
255
|
+
db_source = "RefSeq"
|
256
|
+
else
|
257
|
+
db_source = "INSD"
|
258
|
+
end
|
259
|
+
qInference = Bio::Feature::Qualifier.new('inference', "similar to AA sequence:#{db_source}:#{reference_prot_id}")
|
260
|
+
ftArray.push(qInference)
|
243
261
|
|
244
|
-
db_source = "[DBSource]"
|
245
|
-
if reference_prot_id.include? "_"
|
246
|
-
db_source = "RefSeq"
|
247
|
-
else
|
248
|
-
db_source = "INSD"
|
249
262
|
end
|
250
|
-
qInference = Bio::Feature::Qualifier.new('inference', "similar to AA sequence:#{db_source}:#{reference_prot_id}")
|
251
|
-
ftArray.push(qInference)
|
252
263
|
|
253
|
-
|
264
|
+
if note != nil
|
265
|
+
qNote = Bio::Feature::Qualifier.new('note', note)
|
266
|
+
ftArray.push(qNote)
|
267
|
+
end
|
254
268
|
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
269
|
+
if inference != nil
|
270
|
+
qInference = Bio::Feature::Qualifier.new('inference', inference)
|
271
|
+
ftArray.push(qInference)
|
272
|
+
end
|
259
273
|
|
260
|
-
if inference != nil
|
261
|
-
qInference = Bio::Feature::Qualifier.new('inference', inference)
|
262
|
-
ftArray.push(qInference)
|
263
274
|
end
|
264
275
|
|
265
276
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bacterial-annotator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxime Deraspe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bio
|