viral_seq 1.0.10 → 1.0.11

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: 14d880e9f39b2b87892bec9d4377b358643c880cf32c81872cff51e1007bc23b
4
- data.tar.gz: 6ee1c3293e2b0403a2eac033335f7575625b2d35f32127b5b57be53e94b4ec7d
3
+ metadata.gz: eb5906a2a3f0c98fa84a15f7fd4b35160f766317a6603b18c62e2e2476af01fd
4
+ data.tar.gz: 435a32d9ce5078b18b633c14c1585c30835b48d3f013d24bc6b9cc98fef51a55
5
5
  SHA512:
6
- metadata.gz: 951b75ced84aa21cf5650baa6970f60a617d3f29d20c14acadacefabea23d6b584f25990453c2008f30197aaef055a94edbdbb45494bb12b6343d90bc6bd45fb
7
- data.tar.gz: 68ac69b4ebd5438a8f73780db823c94aa5a78c7c26d02cfd6bec979244dd1d6452c3698ade0606ddbbaccc480ad85e603171c11648dbb0110c2f5dbb3355bb35
6
+ metadata.gz: a65fcfe551b59d2f022f96d009f089941a3bd293545e840ba294ce43b3cb087b2f3a7fef26829fe3b229c9469ca4e5c907362bbf05a5384947af97a12409a5aa
7
+ data.tar.gz: e4283b03e33aa67feb1dcf623d2613440bcc7299ab33ff77b7dce1ef9617b46e1763d17dda64d54b5fb3c6de37da66880abe43baae932ac36b70d0e2b0cc88d1
data/README.md CHANGED
@@ -78,9 +78,17 @@ Examine for drug resistance mutations for HIV PR region
78
78
  ```ruby
79
79
  qc_seqhash.sdrm_hiv_pr(cut_off)
80
80
  ```
81
+ ## Known issues
82
+
83
+ 1. have a conflict with rails.
81
84
 
82
85
  ## Updates
83
86
 
87
+ ### Version 1.1.1-03022021
88
+
89
+ 1. Fixed a issue when calculating Poisson cutoff for minority mutations `ViralSeq::SeqHash.pm`.
90
+ 2. fixed an issue loading class 'OptionParser'in some ruby environments.
91
+
84
92
  ### Version 1.1.0-11112020:
85
93
 
86
94
  1. Modularize TCS pipeline. Move key functions into /viral_seq/tcs_core.rb
@@ -88,7 +96,7 @@ qc_seqhash.sdrm_hiv_pr(cut_off)
88
96
  3. consensus model now includes a true simple majority model, where no nt needs to be over 50% to be called.
89
97
  4. a few optimizations.
90
98
  5. TCS 2.1.0 delivered.
91
- 6. Tried parallel processing. Cannot achieve the goal because `parallel` gem by default can't pool data from memory of child processors and `in_threads` does not help with the speed.
99
+ 6. Tried parallel processing. Cannot achieve the goal because `parallel` gem by default can't pool data from memory of child processors and `in_threads` does not help with the speed.
92
100
 
93
101
  ### Version 1.0.9-07182020:
94
102
 
data/bin/tcs CHANGED
@@ -28,7 +28,7 @@
28
28
  require 'viral_seq'
29
29
  require 'json'
30
30
  require 'colorize'
31
- require 'OptionParser'
31
+ require 'optparse'
32
32
 
33
33
  options = {}
34
34
 
@@ -317,8 +317,12 @@ primers.each do |primer|
317
317
  f1 = File.open(outfile_r1, 'w')
318
318
  f2 = File.open(outfile_r2, 'w')
319
319
  primer_id_in_use = {}
320
- r1_seq_length = consensus_filtered.values[0][0].size
321
- r2_seq_length = consensus_filtered.values[0][1].size
320
+ if n_con > 0
321
+ r1_seq_length = consensus_filtered.values[0][0].size
322
+ r2_seq_length = consensus_filtered.values[0][1].size
323
+ else
324
+ next
325
+ end
322
326
  log.puts Time.now.to_s + "\t" + "R1 sequence #{r1_seq_length} bp"
323
327
  log.puts Time.now.to_s + "\t" + "R1 sequence #{r2_seq_length} bp"
324
328
  consensus_filtered.each do |seq_name,seq|
@@ -1,7 +1,11 @@
1
1
  module ViralSeq
2
-
2
+
3
3
  # array for all amino acid one letter abbreviations
4
4
 
5
5
  AMINO_ACID_LIST = ["A", "C", "D", "E", "F", "G", "H", "I", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "V", "W", "Y", "*"]
6
6
 
7
+ SDRM_HIV_PR_LIST = {}
8
+ SDRM_HIV_RT_LIST = {}
9
+ SDRM_HIV_IN_LIST = {}
10
+
7
11
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
  module ViralSeq
3
- class SeqHash
3
+ class SDRM
4
4
 
5
5
  # functions to identify SDRMs from a ViralSeq::SeqHash object at HIV PR region.
6
6
  # works for MPID-DR protocol (dx.doi.org/10.17504/protocols.io.useewbe)
@@ -0,0 +1,43 @@
1
+ module ViralSeq
2
+ class DRMs
3
+ def initialize (mutation_list = {})
4
+ @mutation_list = mutation_list
5
+ end
6
+
7
+ attr_accessor :mutation_list
8
+ end
9
+
10
+ def self.sdrm_hiv_pr(seq_hash)
11
+ end
12
+
13
+ def self.sdrm_hiv_rt(seq_hash)
14
+ end
15
+
16
+ def self.sdrm_hiv_in(seq_hash)
17
+ end
18
+
19
+ def self.list_from_json(file)
20
+ end
21
+
22
+ def self.list_from_csv(file)
23
+ end
24
+
25
+ def self.export_list_hiv_pr(file, format = :json)
26
+ if foramt == :json
27
+
28
+ end
29
+ end
30
+
31
+ def self.export_list_hiv_rt(file, format = :json)
32
+
33
+ end
34
+
35
+ def self.export_list_hiv_in(file, format = :json)
36
+
37
+ end
38
+
39
+ def drm_analysis(seq_hash)
40
+ mutation_list = self.mutation_list
41
+
42
+ end
43
+ end
@@ -549,7 +549,7 @@ module ViralSeq
549
549
  if sequences.size == 0
550
550
  return 0
551
551
  else
552
- cut_off = 1
552
+ cut_off = Float::INFINITY
553
553
  l = sequences[0].size
554
554
  rate = sequences.size * error_rate
555
555
  count_mut = variant_for_poisson(sequences)
@@ -558,7 +558,7 @@ module ViralSeq
558
558
 
559
559
  poisson_hash.each do |k,v|
560
560
  cal = l * v
561
- obs = count_mut[k] ? count_mut[k] : 0
561
+ obs = count_mut[k] ? count_mut[k] : 1
562
562
  if obs >= fold_cutoff * cal
563
563
  cut_off = k
564
564
  break
@@ -104,14 +104,16 @@ module ViralSeq
104
104
  # sort array of file names to determine if there is potential errors
105
105
  # input name_array array of file names
106
106
  # output hash { }
107
-
107
+ # need to change for each file name have an error code. and a bool to show if all pass
108
108
  def validate_file_name(name_array)
109
- errors = { file_type_error: [] ,
109
+ errors = {
110
+ file_type_error: [] ,
110
111
  missing_r1_file: [] ,
111
112
  missing_r2_file: [] ,
112
113
  extra_r1_r2_file: [],
113
114
  no_region_tag: [] ,
114
- multiple_region_tag: []}
115
+ multiple_region_tag: []
116
+ }
115
117
 
116
118
  passed_libs = {}
117
119
 
@@ -2,6 +2,6 @@
2
2
  # version info and histroy
3
3
 
4
4
  module ViralSeq
5
- VERSION = "1.0.10"
6
- TCS_VERSION = "2.1.0"
5
+ VERSION = "1.0.11"
6
+ TCS_VERSION = "2.1.1"
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: viral_seq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shuntai Zhou
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-11-12 00:00:00.000000000 Z
12
+ date: 2021-03-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -114,6 +114,7 @@ files:
114
114
  - lib/viral_seq/pid.rb
115
115
  - lib/viral_seq/ref_seq.rb
116
116
  - lib/viral_seq/rubystats.rb
117
+ - lib/viral_seq/sdrm.rb
117
118
  - lib/viral_seq/seq_hash.rb
118
119
  - lib/viral_seq/seq_hash_pair.rb
119
120
  - lib/viral_seq/sequence.rb
@@ -142,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
143
  version: '0'
143
144
  requirements:
144
145
  - R required for some functions
145
- rubygems_version: 3.1.2
146
+ rubygems_version: 3.2.2
146
147
  signing_key:
147
148
  specification_version: 4
148
149
  summary: A Ruby Gem containing bioinformatics tools for processing viral NGS data.