viral_seq 1.2.6 → 1.3.0

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
  SHA256:
3
- metadata.gz: aee2536198f5579951f7c5f5f1b97ed27fb0bf5459e6dbfe79137a030951d443
4
- data.tar.gz: 9ab9b69adf228d3429e02e5d47674ce0a0d137fa6231d940ef8d6cc9abfa1cdf
3
+ metadata.gz: a6ff64bcbe0e019c4e6842feae4c775e5975307a51ca111ea6629de5f918a163
4
+ data.tar.gz: 464d2eeacc49243722c8f8121df7a118c9a433da8df0e2f02e6c5195aa03e1a9
5
5
  SHA512:
6
- metadata.gz: d9b5def3e29f819b6d83902676e80fa2d81531cb44132942244125f6b63110d66389e7f9c61d6e9ea3d80ece57d22d95d5c3948c3f7f71d48835b2714794ffe0
7
- data.tar.gz: 44b996d9caf9029f2ef522d9058410cdc3b4ec253ccc7bacca5d9ecf66f487624b0b6d18c960b6c7a0af7bfcd2bc72c8c02df59d3c4c7834ab80d4a9eed2a424
6
+ metadata.gz: 9b0da2b42f7c1fb039995fa017cd6535a1253c6352be2f502ecf3ef25cbdc4bcdd7b8497e68ed00eab82e67007751be9474cc8a6f06ace3386a81456dae19a4e
7
+ data.tar.gz: df93fd5689cfc8e6b5248febd0a57961cb6773b0e939cb3c980b9b13cae60ca9177209f24acd13e94748733c6c7dee165b89a86c4505f961618d68c4a05782d2
data/README.md CHANGED
@@ -179,6 +179,25 @@ qc_seqhash.sdrm_hiv_pr(cut_off)
179
179
 
180
180
  ## Updates
181
181
 
182
+ ### Version 1.3.0-08302021
183
+
184
+ 1. Fixed a bug in the `tcs` pipeline.
185
+
186
+ ### Version 1.2.9-08022021
187
+
188
+ 1. Fixed a bug when reading the input primer sequences in lowercases.
189
+ 2. Fix a bug in the method ViralSeq::Math::RandomGaussian
190
+
191
+ ### Version 1.2.8-07292021
192
+
193
+ 1. Fixed an issue when reading .fastq files containing blank_lines.
194
+
195
+ ### Version 1.2.7-07152021
196
+
197
+ 1. Optimzed the workflow of the `tcs` pipeline on raw data with uneven lengths.
198
+ `tcs` version to v2.3.6.
199
+
200
+
182
201
  ### Version 1.2.6-07122021
183
202
 
184
203
  1. Optimized the workflow of the `tcs` pipeline in the "end-join/QC/Trimming" section.
data/bin/tcs CHANGED
@@ -152,8 +152,8 @@ begin
152
152
  primer[:region] ? region = primer[:region] : region = "region"
153
153
  summary_json[:primer_set_name] = region
154
154
 
155
- cdna_primer = primer[:cdna]
156
- forward_primer = primer[:forward]
155
+ cdna_primer = primer[:cdna].upcase
156
+ forward_primer = primer[:forward].upcase
157
157
 
158
158
  export_raw = primer[:export_raw]
159
159
  limit_raw = primer[:limit_raw]
@@ -353,7 +353,8 @@ begin
353
353
  r1_seq_length = consensus_filtered.values[0][0].size
354
354
  r2_seq_length = consensus_filtered.values[0][1].size
355
355
  else
356
- next
356
+ r1_seq_length = "n/a"
357
+ r2_seq_length = "n/a"
357
358
  end
358
359
  log.puts Time.now.to_s + "\t" + "R1 sequence #{r1_seq_length} bp"
359
360
  log.puts Time.now.to_s + "\t" + "R1 sequence #{r2_seq_length} bp"
@@ -400,7 +401,11 @@ begin
400
401
  when 4
401
402
  joined_sh = shp.join2(model: :indiv)
402
403
  end
403
- return joined_sh
404
+ if joined_sh
405
+ return joined_sh
406
+ else
407
+ joined_sh = ViralSeq::SeqHash.new
408
+ end
404
409
  end
405
410
 
406
411
  if primer[:end_join]
@@ -426,7 +431,7 @@ begin
426
431
  if ref_end == 0
427
432
  ref_end = 0..(ViralSeq::RefSeq.get(ref_genome).size - 1)
428
433
  end
429
- if primer[:end_join_option] == 1 and primer[:overlap] == 0
434
+ if primer[:end_join_option] == 1
430
435
  r1_sh = ViralSeq::SeqHash.fa(outfile_r1)
431
436
  r2_sh = ViralSeq::SeqHash.fa(outfile_r2)
432
437
  r1_sh = r1_sh.hiv_seq_qc(ref_start, (0..(ViralSeq::RefSeq.get(ref_genome).size - 1)), indel, ref_genome)
@@ -31,7 +31,7 @@ module ViralSeq
31
31
  def rand
32
32
  if (@compute_next_pair = !@compute_next_pair)
33
33
  theta = 2 * ::Math::PI * @rng.call
34
- scale = @sd * ::Math.sqrt(-2 * Math.log(1 - @rng.call))
34
+ scale = @sd * ::Math.sqrt(-2 * ::Math.log(1 - @rng.call))
35
35
  @g1 = @mean + scale * ::Math.sin(theta)
36
36
  @g0 = @mean + scale * ::Math.cos(theta)
37
37
  else
@@ -116,6 +116,8 @@ module ViralSeq
116
116
 
117
117
  File.open(fastq_file,'r') do |file|
118
118
  file.readlines.collect do |line|
119
+ line.tr!("\u0000","")
120
+ next if line == "\n"
119
121
  count +=1
120
122
  count_m = count % 4
121
123
  if count_m == 1
@@ -397,7 +399,9 @@ module ViralSeq
397
399
  (0..(seq_length - 1)).each do |position|
398
400
  all_base = []
399
401
  seq_array.each do |seq|
400
- all_base << seq[position]
402
+ if seq[position]
403
+ all_base << seq[position]
404
+ end
401
405
  end
402
406
  base_count = all_base.count_freq
403
407
  max_base_list = []
@@ -305,7 +305,8 @@ module ViralSeq
305
305
  end
306
306
 
307
307
  def general_filter(seq)
308
- if seq.size < $platform_sequencing_length
308
+ return false unless seq
309
+ if seq.size < ($platform_sequencing_length - 10)
309
310
  return false
310
311
  elsif seq[1..-2] =~ /N/ # sequences with ambiguities except the 1st and last position removed
311
312
  return false
@@ -2,6 +2,6 @@
2
2
  # version info and histroy
3
3
 
4
4
  module ViralSeq
5
- VERSION = "1.2.6"
6
- TCS_VERSION = "2.3.5"
5
+ VERSION = "1.3.0"
6
+ TCS_VERSION = "2.3.8"
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.2.6
4
+ version: 1.3.0
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: 2021-07-12 00:00:00.000000000 Z
12
+ date: 2021-08-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler