bacterial-annotator 0.5.2 → 0.5.3

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: 7ccf904ff27565f88102eb137eadd2103b8e13a5
4
- data.tar.gz: 51d6b4c6092e9e7bee7319759de3485c09be8b7c
3
+ metadata.gz: 48eb79f1ebdf63ad829fe850b9b32db0d89fb3e5
4
+ data.tar.gz: b0ab93f6623dd6f42fce8dc928b190fda4a1f683
5
5
  SHA512:
6
- metadata.gz: 12956c4a2c7573735df00228ee645033ebd4a241fca7609342b5cc79f22878c04d4c511d96d05fd9ace582c9f8121090cd85153733b003691156e389ae4c8858
7
- data.tar.gz: 417d927324031db3417270df515b2a8d6e346a068c061de2ef346498c785818733921811dff3a8c91e6647f405d19f8e9640cc6c971ed1113d7d66618c756bc8
6
+ metadata.gz: 17756ba0df70b305ee13deefc9e7f1443858a40deb3f1a9b22f561ca3fb0af5dab82257c809cabd5e255c97b4acf4eace32b61b5536a5651da5efc1a0221aa1a
7
+ data.tar.gz: d46c6b211ea1674b55dbf7b2a8077e7806b8379951fbe962c2ccc5e8f820eba8742ba04d25e6b840dbf04cd3008ed570a8dd4ad756a20886d9e7c1c5c58aa81e
@@ -76,6 +76,7 @@ class SequenceAnnotation
76
76
  bioseq_gene: dnaBioSeq,
77
77
  bioseq_len: pepBioSeq.length
78
78
  }
79
+
79
80
  end
80
81
 
81
82
  end
@@ -164,7 +164,7 @@ class SequenceFasta
164
164
  prot_ids[contig] << prot_id
165
165
 
166
166
  # puts "Prodigal length : " + entry.seq.length.to_s
167
- prot_length[prot_id] = entry.seq.length-1 # minus the stop codon
167
+ prot_length[prot_id] = entry.seq.length
168
168
 
169
169
  end
170
170
 
@@ -128,7 +128,7 @@ class BacterialAnnotator
128
128
 
129
129
  remaining_cds = cumulate_annotation_stats_reference contig
130
130
 
131
- if ! remaining_cds.empty?
131
+ if remaining_cds != []
132
132
  @contig_foreign_cds[contig] = remaining_cds
133
133
  end
134
134
 
@@ -503,6 +503,19 @@ class BacterialAnnotator
503
503
  synteny_file = File.open("#{@options[:outdir]}/Prot-Synteny.tsv","w")
504
504
  synteny_file.write("RefLocusTag\tRefProtID\tRefLength\tRefCoverage\tIdentity\tQueryGene\tQueryLength\tQueryCoverage\n")
505
505
  ref_annotated = {}
506
+
507
+ @prot_synteny_refgenome.query_sequences.each do |prot, syn_val|
508
+ next if ! syn_val.has_key? :homology
509
+ ref_annotated[syn_val[:homology][:hits][0]] = {
510
+ key: prot,
511
+ pId: syn_val[:homology][:pId],
512
+ cov_query: syn_val[:homology][:cov_query],
513
+ cov_subject: syn_val[:homology][:cov_subject],
514
+ assert_cutoff: syn_val[:homology][:assert_cutoff],
515
+ length: syn_val[:homology][:length][0]
516
+ }
517
+ end
518
+
506
519
  @contig_annotations.each do |contig, prot_annotations|
507
520
  prot_annotations.each do |key,prot|
508
521
  ref_annotated[prot[:protId]] = {key: key, length: prot[:length], pId: prot[:pId]} if prot != nil
@@ -518,9 +531,9 @@ class BacterialAnnotator
518
531
  pId = ""
519
532
  if ref_annotated[ref_v[:protId]] != nil
520
533
  gene = ref_annotated[ref_v[:protId]][:key]
521
- coverage_ref = (ref_annotated[ref_v[:protId]][:length].to_f/ref_v[:bioseq].seq.length.to_f).round(2)
534
+ coverage_ref = ref_annotated[ref_v[:protId]][:cov_subject]
522
535
  query_length = @query_fasta.annotation_files[:prot_ids_length][gene]
523
- coverage_query = (ref_annotated[ref_v[:protId]][:length].to_f/query_length.to_f).round(2)
536
+ coverage_query = ref_annotated[ref_v[:protId]][:cov_query]
524
537
  pId = ref_annotated[ref_v[:protId]][:pId]
525
538
  end
526
539
 
@@ -535,6 +548,7 @@ class BacterialAnnotator
535
548
  synteny_file.write("\n")
536
549
 
537
550
  end
551
+
538
552
  synteny_file.close
539
553
 
540
554
  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.2
4
+ version: 0.5.3
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-05-31 00:00:00.000000000 Z
11
+ date: 2017-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bio