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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 27f8cdf5e843b97030798ac29fc23bf1cc54bb5a
4
- data.tar.gz: 77592401985aa2e22cb683c9561f63ef3d23d329
3
+ metadata.gz: 8ab5e91d3ae7a0f2f62ca3ea90de6e84b0686130
4
+ data.tar.gz: c0df480e3019afc0d152e25134f3b73a2a57c970
5
5
  SHA512:
6
- metadata.gz: 15550bd245a460a16507132cf8cec2524b4724cffa909da983f46ce9531c957fbe5e22456973323fe1e2b0af2d0323333642c9c741fa5b614e482a2d0d3afb6a
7
- data.tar.gz: 309de7383bbffe46cf68ab5436fc02b095e6069ec769e47b17a5c2e632fa7532e76e4ae399cbcfade0495b633f2fb07da9b77b8590693c9f63f5454e791cfa3a
6
+ metadata.gz: bea8cc8a8a8ffc3ccda0a2dc222046be507d8fba2e95a17ee84e93330b974584e5562658f8cfd8e512384ba615b40800258628588d0f3b5ed34af3aa587f398d
7
+ data.tar.gz: 26b0cbeff8c9142c6585bd73ff03fbafeb0cb8be953a846b2ed6ffdad80e355cf78cdeb131ac91624e85bf83e9a6cda049eb5a6983e5ff36c91c5d47ad4209f2
@@ -196,70 +196,81 @@ class SequenceAnnotation
196
196
 
197
197
  hit = nil
198
198
 
199
- next if ! synteny_prot.has_key? prot_id or
200
- ! synteny_prot[prot_id].has_key? :homology
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
- # hit = annotations[synteny_prot[prot_id][:homology][:hits][0]]
220
+ hit = annotations[synteny_prot[prot_id][:homology][:hits][0]]
212
221
 
213
- if synteny_prot.has_key? prot_id
222
+ if synteny_prot.has_key? prot_id
214
223
 
215
- locus, gene, product, note, inference = nil
216
- locus = hit[:locustag]
217
- gene = hit[:gene]
218
- product = hit[:product]
219
- note = hit[:note]
220
- inference = hit[:inference]
221
- pId = synteny_prot[prot_id][:homology][:pId]
222
- cov_query = (synteny_prot[prot_id][:homology][:cov_query]*100).round(2)
223
- cov_subject = (synteny_prot[prot_id][:homology][:cov_subject]*100).round(2)
224
- reference_prot_id = synteny_prot[prot_id][:homology][:hits][0]
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
- qLocusTag = Bio::Feature::Qualifier.new('locus_tag', "#{prot_id}")
227
- ftArray.push(qLocusTag)
235
+ qLocusTag = Bio::Feature::Qualifier.new('locus_tag', "#{prot_id}")
236
+ ftArray.push(qLocusTag)
228
237
 
229
- if gene != nil
230
- qGene = Bio::Feature::Qualifier.new('gene', gene)
231
- ftArray.push(qGene)
232
- end
238
+ if gene != nil
239
+ qGene = Bio::Feature::Qualifier.new('gene', gene)
240
+ ftArray.push(qGene)
241
+ end
233
242
 
234
- if product != nil
235
- qProd = Bio::Feature::Qualifier.new('product', product)
236
- ftArray.push(qProd)
237
- end
243
+ if product != nil
244
+ qProd = Bio::Feature::Qualifier.new('product', product)
245
+ ftArray.push(qProd)
246
+ end
238
247
 
239
- # check if there is a reference genome.. reference_locus shouldn't be nil in that case
240
- if locus != nil
241
- qNote = Bio::Feature::Qualifier.new('note', "corresponds to #{locus} locus (AA identity: #{pId}%; coverage(q,s): #{cov_query}%,#{cov_subject}%) from #{ref_genome}")
242
- ftArray.push(qNote)
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
- end
264
+ if note != nil
265
+ qNote = Bio::Feature::Qualifier.new('note', note)
266
+ ftArray.push(qNote)
267
+ end
254
268
 
255
- if note != nil
256
- qNote = Bio::Feature::Qualifier.new('note', note)
257
- ftArray.push(qNote)
258
- end
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
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-07 00:00:00.000000000 Z
11
+ date: 2017-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bio