bacterial-annotator 0.9.3 → 1.0.0

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
  SHA256:
3
- metadata.gz: e6b26cd37618fedd557b8d9f7fe2c27a3b95dee5404d7751a8fb10ddcb63edc8
4
- data.tar.gz: 2129f8372c3a48654cf3bdf6b75eccce3148b45f0e15191f3a555ff0769f9bd4
3
+ metadata.gz: 1dad9c41b499dc463758390648f19af38b55a660e0ac408303fca0383bbf9463
4
+ data.tar.gz: 3d58da07ceced3fabba23a685d8f7b25e0bddc511cd690a5e6b4e24666ad3c89
5
5
  SHA512:
6
- metadata.gz: 2400660df26bab507b5f9a3310105514d415a4950a06fdb7a3cbc9a4de2b4268d77c3725a13507e19c92fcdcc688f2bda4184aeadb88afd4a444addce1117fb9
7
- data.tar.gz: 9caef8af954e6de43ed3eb2cd5a729065bafd2451aa5c73e00e60b400cb849666a53fb1e39d549f4b33925edbfea33f209a966da7f64d91ac1aa3d8b75e5f4d2
6
+ metadata.gz: d860ebf490024dad6ec9a28c8b68a21cc8447b347236cff9938ebc372244fdcc3f414bb9f2280fa58bded32e221a5614d6b5d1e9e681837d8f8948c4a20dc3c2
7
+ data.tar.gz: 7ad1c1444c156679632129799120b303055e90316baceb2c17f3441afa58298aeaf7840f1bdc5989bb2931452cd76a26e723ed54a602d41f73efc781b23f5215
@@ -1,10 +1,10 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # author: maxime déraspe
3
3
  # email: maximilien1er@gmail.com
4
- # review:
4
+ # review:
5
5
  # date: 15-02-24
6
6
  # version: 0.0.1
7
- # licence:
7
+ # licence:
8
8
 
9
9
  require 'json'
10
10
  require 'zlib'
@@ -111,7 +111,7 @@ class SequenceSynteny
111
111
  system("#{@root}/diamond.linux makedb --db #{subject_file} --in #{subject_file} > /dev/null 2>&1")
112
112
  db_file = subject_file
113
113
  end
114
- system("#{@root}/diamond.linux blastp --db #{db_file} -q #{query_file} -o #{@outdir}/#{@name}.diamond.tsv -f 6 > /dev/null 2>&1")
114
+ system("#{@root}/diamond.linux blastp --masking none --db #{db_file} -q #{query_file} -o #{@outdir}/#{@name}.diamond.tsv -f 6 > /dev/null 2>&1")
115
115
  else
116
116
  # system("#{@root}/glsearch36.linux -b 3 -E 1e-25 -m 8 #{@subject_file} #{@query_file} > #{@outdir}/#{@name}.fasta36.tsv")
117
117
  end
@@ -45,6 +45,9 @@ class BacterialComparator
45
45
  min_pid = min_pid/100
46
46
  end
47
47
 
48
+ @min_cov = min_cov
49
+ @min_pid = min_pid
50
+
48
51
  @aln_opt = options[:align].downcase
49
52
  @run_phylo = 0
50
53
  if options[:phylogeny] == 1
@@ -592,8 +595,8 @@ class BacterialComparator
592
595
  query_prot_file,
593
596
  ref_prot_file,
594
597
  "Prot-Ref",
595
- 0.80,
596
- 0.80,
598
+ @min_cov,
599
+ @min_cov,
597
600
  "prot")
598
601
 
599
602
  print "# Running alignment with Reference Genome CDS (diamond).."
@@ -612,7 +615,10 @@ class BacterialComparator
612
615
  ref_synteny_prot.query_sequences.each do |prot, syn_val|
613
616
  next if ! syn_val.has_key? :homology
614
617
  next if syn_val[:homology][:assert_cutoff].inject(:+) < 3
615
- next if ref_annotated.has_key? syn_val[:homology][:hits][0] and ref_annotated[syn_val[:homology][:hits][0]][:partial] == 0
618
+ next if ref_annotated.has_key? syn_val[:homology][:hits][0] and
619
+ ref_annotated[syn_val[:homology][:hits][0]][:partial] == 0 and
620
+ ref_annotated[syn_val[:homology][:hits][0]][:score] > syn_val[:homology][:score]
621
+
616
622
  ref_annotated[syn_val[:homology][:hits][0]] = {
617
623
  key: prot,
618
624
  pId: syn_val[:homology][:pId],
@@ -622,6 +628,7 @@ class BacterialComparator
622
628
  length: syn_val[:homology][:length][0],
623
629
  partial: (syn_val[:partial] ? 1 : 0)
624
630
  }
631
+
625
632
  # ref_annotated[syn_val[:homology][:hits][0]] = {
626
633
  # key: prot,
627
634
  # pId: syn_val[:homology][:pId],
@@ -631,6 +638,7 @@ class BacterialComparator
631
638
  # length: syn_val[:homology][:length][0],
632
639
  # partial: (syn_val[:partial] ? 1 : 0)
633
640
  # }
641
+
634
642
  end
635
643
 
636
644
  # print ref_annotated
@@ -642,13 +650,21 @@ class BacterialComparator
642
650
  coverage_query = ""
643
651
  query_length = ""
644
652
  pId = ""
653
+
645
654
  if ref_annotated[ref_v[:protId]] != nil
646
- gene = ref_annotated[ref_v[:protId]][:key]
647
- coverage_ref = ref_annotated[ref_v[:protId]][:cov_subject]
648
- query_length = query_lengths[ref_annotated[ref_v[:protId]][:key]]
649
- coverage_query = ref_annotated[ref_v[:protId]][:cov_query]
650
- pId = ref_annotated[ref_v[:protId]][:pId]
651
- partial = ref_annotated[ref_v[:protId]][:partial]
655
+
656
+ if ref_annotated[ref_v[:protId]][:pId] >= @min_pid and
657
+ ref_annotated[ref_v[:protId]][:cov_query] >= @min_cov and
658
+ ref_annotated[ref_v[:protId]][:cov_subject] >= @min_cov
659
+
660
+ gene = ref_annotated[ref_v[:protId]][:key]
661
+ coverage_ref = ref_annotated[ref_v[:protId]][:cov_subject]
662
+ query_length = query_lengths[ref_annotated[ref_v[:protId]][:key]]
663
+ coverage_query = ref_annotated[ref_v[:protId]][:cov_query]
664
+ pId = ref_annotated[ref_v[:protId]][:pId]
665
+ partial = ref_annotated[ref_v[:protId]][:partial]
666
+ end
667
+
652
668
  end
653
669
 
654
670
  _locus_tag = ref_v[:locustag] || ""
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.9.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxime Deraspe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-19 00:00:00.000000000 Z
11
+ date: 2024-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bio