miga-base 0.7.12.2 → 0.7.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/miga/cli/action/derep_wf.rb +19 -10
- data/lib/miga/daemon.rb +2 -1
- data/lib/miga/version.rb +2 -2
- data/scripts/aai_distances.bash +11 -11
- data/scripts/ani_distances.bash +10 -10
- data/scripts/haai_distances.bash +11 -11
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 964b803e09887476153335589fad3d5aee2861ea
|
4
|
+
data.tar.gz: ee0d34a4a7c8569d39bea4855a6054c57de78c81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b84efbc94fbfc848b85ae7c3cca7e26f2baea74c5f066a63cf1ede7fb26ed6c634f4c2e2cbe1c2752e54624cf48d6597b933474d4b4d6083cb505a3b17063cf5
|
7
|
+
data.tar.gz: 0c7cfc6a149cab5fa1cfc5e386de789f84c132d227ad8ebbbc42dee2b076010bfe06b6697e69efe00a6639283c472f9ca3793a1e113506e691e50a182cfee2c6
|
@@ -27,10 +27,13 @@ class MiGA::Cli::Action::DerepWf < MiGA::Cli::Action
|
|
27
27
|
'--threshold FLOAT', Float,
|
28
28
|
"Metric threshold (%) to dereplicate. By default: #{cli[:threshold]}"
|
29
29
|
) { |v| cli[:threshold] = v }
|
30
|
+
opt.on(
|
31
|
+
'--quality',
|
32
|
+
'Use genome with highest quality as clade representatives (default)'
|
33
|
+
) { |v| cli[:criterion] = :quality }
|
30
34
|
opt.on(
|
31
35
|
'--medoids',
|
32
|
-
'Use medoids as clade representatives'
|
33
|
-
'By default: Use genome with the highest quality'
|
36
|
+
'Use medoids as clade representatives'
|
34
37
|
) { |v| cli[:criterion] = :medoids }
|
35
38
|
opt.on(
|
36
39
|
'--no-collection',
|
@@ -47,12 +50,18 @@ class MiGA::Cli::Action::DerepWf < MiGA::Cli::Action
|
|
47
50
|
|
48
51
|
def perform
|
49
52
|
# Input data
|
50
|
-
p = create_project(
|
51
|
-
|
52
|
-
|
53
|
-
|
53
|
+
p = create_project(
|
54
|
+
:assembly,
|
55
|
+
{
|
56
|
+
run_project_stats: false,
|
57
|
+
run_clades: false,
|
58
|
+
gsp_metric: cli[:metric],
|
59
|
+
:"gsp_#{cli[:metric]}" => cli[:threshold]
|
60
|
+
},
|
61
|
+
{ run_mytaxa_scan: false, run_ssu: false }
|
62
|
+
)
|
54
63
|
unless cli[:threshold] >= 0.0 && cli[:threshold] <= 100.0
|
55
|
-
raise
|
64
|
+
raise 'The threshold of identity must be in the range [0,100]'
|
56
65
|
end
|
57
66
|
|
58
67
|
# Run
|
@@ -65,8 +74,8 @@ class MiGA::Cli::Action::DerepWf < MiGA::Cli::Action
|
|
65
74
|
private
|
66
75
|
|
67
76
|
def dereplicate(p)
|
68
|
-
cli.say
|
69
|
-
r = p.result(:clade_finding) or raise
|
77
|
+
cli.say 'Extracting genomospecies clades'
|
78
|
+
r = p.result(:clade_finding) or raise 'Result unavailable: run failed'
|
70
79
|
c_f = r.file_path(:clades_gsp) or raise 'Result incomplete: run failed'
|
71
80
|
clades = File.readlines(c_f).map { |i| i.chomp.split("\t") }
|
72
81
|
rep = representatives(p)
|
@@ -87,7 +96,7 @@ class MiGA::Cli::Action::DerepWf < MiGA::Cli::Action
|
|
87
96
|
end
|
88
97
|
|
89
98
|
def representatives(p)
|
90
|
-
cli.say
|
99
|
+
cli.say 'Identifying representatives'
|
91
100
|
f = File.expand_path('representatives.txt', cli[:outdir])
|
92
101
|
if cli[:criterion] == :medoids
|
93
102
|
FileUtils.cp(p.result(:clade_finding).file_path(:medoids_gsp), f)
|
data/lib/miga/daemon.rb
CHANGED
data/lib/miga/version.rb
CHANGED
@@ -8,7 +8,7 @@ module MiGA
|
|
8
8
|
# - Float representing the major.minor version.
|
9
9
|
# - Integer representing gem releases of the current version.
|
10
10
|
# - Integer representing minor changes that require new version number.
|
11
|
-
VERSION = [0.7,
|
11
|
+
VERSION = [0.7, 13, 0]
|
12
12
|
|
13
13
|
##
|
14
14
|
# Nickname for the current major.minor version.
|
@@ -16,7 +16,7 @@ module MiGA
|
|
16
16
|
|
17
17
|
##
|
18
18
|
# Date of the current gem release.
|
19
|
-
VERSION_DATE = Date.new(2020, 7,
|
19
|
+
VERSION_DATE = Date.new(2020, 7, 31)
|
20
20
|
|
21
21
|
##
|
22
22
|
# Reference of MiGA.
|
data/scripts/aai_distances.bash
CHANGED
@@ -13,17 +13,20 @@ echo -n "" > miga-project.log
|
|
13
13
|
DS=$(miga ls -P "$PROJECT" --ref --no-multi --active)
|
14
14
|
|
15
15
|
# Extract values
|
16
|
-
|
17
|
-
|
18
|
-
echo "
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
16
|
+
rm -f miga-project.txt
|
17
|
+
(
|
18
|
+
echo "metric a b value sd n omega" | tr " " "\\t"
|
19
|
+
for i in $DS ; do
|
20
|
+
echo "SELECT CASE WHEN omega!=0 THEN 'AAI' ELSE 'hAAI_AAI' END," \
|
21
|
+
" seq1, seq2, aai, sd, n, omega from aai;" \
|
22
|
+
| sqlite3 "$i.db" | tr "\\|" "\\t"
|
23
|
+
echo "$i" >> miga-project.log
|
24
|
+
done
|
25
|
+
) | gzip -9c > miga-project.txt.gz
|
23
26
|
|
24
27
|
# R-ify
|
25
28
|
echo "
|
26
|
-
aai <- read.table('miga-project.txt', sep='\\t', h=T, as.is=TRUE);
|
29
|
+
aai <- read.table(gzfile('miga-project.txt.gz'), sep='\\t', h=T, as.is=TRUE);
|
27
30
|
save(aai, file='miga-project.Rdata');
|
28
31
|
if(sum(aai[,'a'] != aai[,'b']) > 0){
|
29
32
|
h <- hist(aai[aai[,'a'] != aai[,'b'], 'value'], breaks=100, plot=FALSE);
|
@@ -35,9 +38,6 @@ if(sum(aai[,'a'] != aai[,'b']) > 0){
|
|
35
38
|
}
|
36
39
|
" | R --vanilla
|
37
40
|
|
38
|
-
# Gzip
|
39
|
-
gzip -9 -f miga-project.txt
|
40
|
-
|
41
41
|
# Finalize
|
42
42
|
miga date > "miga-project.done"
|
43
43
|
miga add_result -P "$PROJECT" -r "$SCRIPT" -f
|
data/scripts/ani_distances.bash
CHANGED
@@ -13,16 +13,19 @@ echo -n "" > miga-project.log
|
|
13
13
|
DS=$(miga ls -P "$PROJECT" --ref --no-multi --active)
|
14
14
|
|
15
15
|
# Extract values
|
16
|
-
|
17
|
-
|
18
|
-
echo "
|
19
|
-
|
20
|
-
|
21
|
-
|
16
|
+
rm -f miga-project.txt
|
17
|
+
(
|
18
|
+
echo "metric a b value sd n omega" | tr " " "\\t"
|
19
|
+
for i in $DS ; do
|
20
|
+
echo "SELECT 'ANI', seq1, seq2, ani, sd, n, omega from ani ;" \
|
21
|
+
| sqlite3 "$i.db" | tr "\\|" "\\t"
|
22
|
+
echo "$i" >> miga-project.log
|
23
|
+
done
|
24
|
+
) | gzip -9c > miga-project.txt.gz
|
22
25
|
|
23
26
|
# R-ify
|
24
27
|
echo "
|
25
|
-
ani <- read.table('miga-project.txt', sep='\\t', h=T, as.is=TRUE);
|
28
|
+
ani <- read.table(gzfile('miga-project.txt.gz'), sep='\\t', h=T, as.is=TRUE);
|
26
29
|
save(ani, file='miga-project.Rdata');
|
27
30
|
if(sum(ani[,'a'] != ani[,'b']) > 0){
|
28
31
|
h <- hist(ani[ani[,'a'] != ani[,'b'], 'value'], breaks=100, plot=FALSE);
|
@@ -34,9 +37,6 @@ if(sum(ani[,'a'] != ani[,'b']) > 0){
|
|
34
37
|
}
|
35
38
|
" | R --vanilla
|
36
39
|
|
37
|
-
# Gzip
|
38
|
-
gzip -9 -f miga-project.txt
|
39
|
-
|
40
40
|
# Finalize
|
41
41
|
miga date > "miga-project.done"
|
42
42
|
miga add_result -P "$PROJECT" -r "$SCRIPT" -f
|
data/scripts/haai_distances.bash
CHANGED
@@ -17,30 +17,30 @@ echo -n "" > miga-project.log
|
|
17
17
|
DS=$(miga ls -P "$PROJECT" --ref --no-multi --active)
|
18
18
|
|
19
19
|
# Extract values
|
20
|
-
|
21
|
-
|
22
|
-
echo "
|
23
|
-
|
24
|
-
|
25
|
-
|
20
|
+
rm -f miga-project.txt
|
21
|
+
(
|
22
|
+
echo "metric a b value sd n omega" | tr " " "\\t"
|
23
|
+
for i in $DS ; do
|
24
|
+
echo "SELECT 'hAAI', seq1, seq2, aai, sd, n, omega from aai ;" \
|
25
|
+
| sqlite3 "$i.db" | tr "\\|" "\\t"
|
26
|
+
echo "$i" >> miga-project.log
|
27
|
+
done
|
28
|
+
) | gzip -9c > miga-project.txt.gz
|
26
29
|
|
27
30
|
# R-ify
|
28
31
|
echo "
|
29
|
-
haai <- read.table('miga-project.txt', sep='\\t', h=T, as.is=TRUE);
|
32
|
+
haai <- read.table(gzfile('miga-project.txt.gz'), sep='\\t', h=T, as.is=TRUE);
|
30
33
|
save(haai, file='miga-project.Rdata');
|
31
34
|
if(sum(haai[,'a'] != haai[,'b']) > 0){
|
32
35
|
h <- hist(haai[haai[,'a'] != haai[,'b'], 'value'], breaks=100, plot=FALSE);
|
33
36
|
write.table(
|
34
37
|
cbind(h[['breaks']][-length(h[['breaks']])],
|
35
|
-
h[['breaks']][-1],h[['counts']]),
|
38
|
+
h[['breaks']][-1], h[['counts']]),
|
36
39
|
file='miga-project.hist', quote=FALSE, sep='\\t',
|
37
40
|
col.names=FALSE, row.names=FALSE);
|
38
41
|
}
|
39
42
|
" | R --vanilla
|
40
43
|
|
41
|
-
# Gzip
|
42
|
-
gzip -9 -f miga-project.txt
|
43
|
-
|
44
44
|
# Finalize
|
45
45
|
miga date > "miga-project.done"
|
46
46
|
miga add_result -P "$PROJECT" -r "$SCRIPT" -f
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miga-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luis M. Rodriguez-R
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: daemons
|
@@ -560,7 +560,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
560
560
|
- !ruby/object:Gem::Version
|
561
561
|
version: '0'
|
562
562
|
requirements: []
|
563
|
-
|
563
|
+
rubyforge_project:
|
564
|
+
rubygems_version: 2.5.2.3
|
564
565
|
signing_key:
|
565
566
|
specification_version: 4
|
566
567
|
summary: MiGA
|