viral_seq 1.2.0 → 1.2.1
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 +4 -4
- data/README.md +43 -1
- data/bin/tcs_sdrm +9 -2
- data/lib/viral_seq/constant.rb +7 -0
- data/lib/viral_seq/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f3316ff7e72ca84c6eb2fa861a9fdad14fbcb3ab3c0053ade843ee13cc9ce82e
|
|
4
|
+
data.tar.gz: df1035ea5934b794ef8c64a04085f407bcd4dffc0888bf81a569a7ccfba3560a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a3ec35b3a40ee9cf66131416a1c20eda38bf8bde818aa41af285c099ddd2b49e4f31fe1d011c95def77fd5c6653d96f4295142fd543444f249242154bb2b671b
|
|
7
|
+
data.tar.gz: daa6e694a841cc615cfde850bf2d98ca7467cb1d27502daf398ab0204e55c4d477f34aafce0149c765a931755fc3a3f7dbdf425964904d0199efb0651b9a09a6
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ViralSeq
|
|
2
2
|
|
|
3
|
-
[](https://rubygems.org/gems/viral_seq)
|
|
4
4
|

|
|
5
5
|

|
|
6
6
|

|
|
@@ -69,6 +69,44 @@ Example command:
|
|
|
69
69
|
$ tcs_log batch_tcs_jobs
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
+
---
|
|
73
|
+
### `tcs_sdrm`
|
|
74
|
+
|
|
75
|
+
Use `tcs_sdrm` pipeline for HIV-1 drug resistance mutation and recency.
|
|
76
|
+
|
|
77
|
+
Example command:
|
|
78
|
+
```bash
|
|
79
|
+
$ tcs_sdrm libs_dir
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
lib_dir file structure:
|
|
83
|
+
```
|
|
84
|
+
libs_dir/
|
|
85
|
+
├── lib1
|
|
86
|
+
├── lib1_RT
|
|
87
|
+
├── lib1_PR
|
|
88
|
+
├── lib1_IN
|
|
89
|
+
├── lib1_V1V3
|
|
90
|
+
├── lib2
|
|
91
|
+
├── lib1_RT
|
|
92
|
+
├── lib1_PR
|
|
93
|
+
├── lib1_IN
|
|
94
|
+
├── lib1_V1V3
|
|
95
|
+
├── ...
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Output data in a new dir as 'libs_dir_SDRM'
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
**Note: [R](https://www.r-project.org/) and the following R libraries are required:**
|
|
102
|
+
- phangorn
|
|
103
|
+
- ape
|
|
104
|
+
- scales
|
|
105
|
+
- ggforce
|
|
106
|
+
- cowplot
|
|
107
|
+
- magrittr
|
|
108
|
+
- gridExtra
|
|
109
|
+
|
|
72
110
|
---
|
|
73
111
|
|
|
74
112
|
### `locator`
|
|
@@ -137,6 +175,10 @@ qc_seqhash.sdrm_hiv_pr(cut_off)
|
|
|
137
175
|
|
|
138
176
|
## Updates
|
|
139
177
|
|
|
178
|
+
### Version 1.2.1-05172021
|
|
179
|
+
|
|
180
|
+
1. Added a function in R to check and install missing R packages for `tcs_sdrm` pipeline.
|
|
181
|
+
|
|
140
182
|
### Version 1.2.0-05102021
|
|
141
183
|
|
|
142
184
|
1. Added `tcs_sdrm` pipeline as an excutable.
|
data/bin/tcs_sdrm
CHANGED
|
@@ -32,6 +32,14 @@ unless ARGV[0] && File.directory?(ARGV[0])
|
|
|
32
32
|
abort "No sequence data provided. `tcs_sdrm` pipeline aborted. "
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
+
begin
|
|
36
|
+
r_version = `R --version`.split("\n")[0]
|
|
37
|
+
r_check = `R -e '#{ViralSeq::R_SCRIPT_CHECK_PACKAGES}' > /dev/null 2>&1`
|
|
38
|
+
rescue Errno::ENOENT
|
|
39
|
+
abort '"R" is not installed. Install R at https://www.r-project.org/' +
|
|
40
|
+
"\n`tcs_sdrm` pipeline aborted."
|
|
41
|
+
end
|
|
42
|
+
|
|
35
43
|
def abstract_line(data)
|
|
36
44
|
return_data = data[3] + data[2] + data[4] + ":" +
|
|
37
45
|
(data[6].to_f * 100).round(2).to_s + "(" +
|
|
@@ -45,7 +53,6 @@ log = []
|
|
|
45
53
|
log << { time: Time.now }
|
|
46
54
|
log << { viral_seq_version: ViralSeq::VERSION }
|
|
47
55
|
log << { tcs_version: ViralSeq::TCS_VERSION }
|
|
48
|
-
r_version = `R --version`.split("\n")[0]
|
|
49
56
|
log << { R_version: r_version}
|
|
50
57
|
sdrm_list = {}
|
|
51
58
|
sdrm_list[:nrti] = ViralSeq::DRMs.sdrm_json(:nrti)
|
|
@@ -395,7 +402,7 @@ libs.each do |lib|
|
|
|
395
402
|
end
|
|
396
403
|
end
|
|
397
404
|
|
|
398
|
-
log_file = indir
|
|
405
|
+
log_file = File.join(File.dirname(indir), "sdrm_log.json")
|
|
399
406
|
|
|
400
407
|
File.open(log_file, 'w') { |f| f.puts JSON.pretty_generate(log) }
|
|
401
408
|
|
data/lib/viral_seq/constant.rb
CHANGED
|
@@ -3,6 +3,13 @@ module ViralSeq
|
|
|
3
3
|
# array for all amino acid one letter abbreviations
|
|
4
4
|
AMINO_ACID_LIST = ["A", "C", "D", "E", "F", "G", "H", "I", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "V", "W", "Y", "*"]
|
|
5
5
|
|
|
6
|
+
# R script to check if the required libraries are installed, if not, install the missing libraries
|
|
7
|
+
|
|
8
|
+
R_SCRIPT_CHECK_PACKAGES = 'dir.create(path = Sys.getenv("R_LIBS_USER"), showWarnings = FALSE, recursive = TRUE);' +
|
|
9
|
+
'packages <- c("ggplot2", "phangorn", "ape", "scales", "ggforce", "cowplot", "magrittr", "gridExtra");' +
|
|
10
|
+
'install.packages(setdiff(packages, rownames(installed.packages())), lib = Sys.getenv("R_LIBS_USER"), repos = "https://cran.rstudio.com/")'
|
|
11
|
+
|
|
12
|
+
|
|
6
13
|
# R script for tcs_sdrm script
|
|
7
14
|
|
|
8
15
|
R_SCRIPT = 'setwd("PATH_TO_FASTA")
|
data/lib/viral_seq/version.rb
CHANGED
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.
|
|
4
|
+
version: 1.2.1
|
|
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-05-
|
|
12
|
+
date: 2021-05-17 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bundler
|