miga-base 0.7.19.0 → 0.7.20.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: bc5df224531c2f5e902304b478aabe0ba18c02b836c5bab66a675257a3739a08
4
- data.tar.gz: 438b9f2cefad3ecc3b65e17f81d5708f6a589c8b34f22b63235cf4123a156922
3
+ metadata.gz: de9486ffe4bff4fd61295c004f36af331ce5a50645f4aa706076a38d3523ee38
4
+ data.tar.gz: 60ded180b92cfb27729a4844c00713b4e78bf08b6a1f8ebf30f6bdccd24eb769
5
5
  SHA512:
6
- metadata.gz: 506dd5c19259071abd5cf0a130a70557967833edc520fada73030372d7736f2fe114ce4879bc224e37bcbe407a566bbd3cef39a5bc8ec9669c9c4cd1e63edb74
7
- data.tar.gz: 4edb685f9a4adb69339e5ef477d4a0a332da606b402d380e3eab77a055ab94582be3be90f904e9403bc20d3f81c3753ed85df8a43bd9afc3e97b41f88cfd9fb1
6
+ metadata.gz: 7a5e89cf299d72c2b3fb9a267923caef0ecfc399cabfec71011e9ebc3c37d874cb8a93e16d169db7c3bbda1f54d3ab5863ba889341295339b69673d3457edef7
7
+ data.tar.gz: 4ac7cf2785e42afd17f19749632e1deda80cecfa10103f64d4bc366a29e4a8acf9ead5e8a412ae1b11ba966c6dc9501017cb7dbee2572ebcbc835e9db0341a7b
@@ -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, 19, 0]
11
+ VERSION = [0.7, 20, 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(2021, 1, 2)
19
+ VERSION_DATE = Date.new(2021, 1, 7)
20
20
 
21
21
  ##
22
22
  # Reference of MiGA.
@@ -4,10 +4,10 @@ set -e
4
4
  SCRIPT="aai_distances"
5
5
  # shellcheck source=scripts/miga.bash
6
6
  . "$MIGA/scripts/miga.bash" || exit 1
7
- cd "$PROJECT/data/09.distances/02.aai"
7
+ DIR="$PROJECT/data/09.distances/02.aai"
8
8
 
9
9
  # Initialize
10
- miga date > "miga-project.start"
10
+ miga_start_project_step "$DIR"
11
11
 
12
12
  echo -n "" > miga-project.log
13
13
  DS=$(miga ls -P "$PROJECT" --ref --no-multi --active)
@@ -39,5 +39,4 @@ if(sum(aai[,'a'] != aai[,'b']) > 0){
39
39
  " | R --vanilla
40
40
 
41
41
  # Finalize
42
- miga date > "miga-project.done"
43
- miga add_result -P "$PROJECT" -r "$SCRIPT" -f
42
+ miga_end_project_step "$DIR"
@@ -4,10 +4,10 @@ set -e
4
4
  SCRIPT="ani_distances"
5
5
  # shellcheck source=scripts/miga.bash
6
6
  . "$MIGA/scripts/miga.bash" || exit 1
7
- cd "$PROJECT/data/09.distances/03.ani"
7
+ DIR="$PROJECT/data/09.distances/03.ani"
8
8
 
9
9
  # Initialize
10
- miga date > "miga-project.start"
10
+ miga_start_project_step "$DIR"
11
11
 
12
12
  echo -n "" > miga-project.log
13
13
  DS=$(miga ls -P "$PROJECT" --ref --no-multi --active)
@@ -38,5 +38,4 @@ if(sum(ani[,'a'] != ani[,'b']) > 0){
38
38
  " | R --vanilla
39
39
 
40
40
  # Finalize
41
- miga date > "miga-project.done"
42
- miga add_result -P "$PROJECT" -r "$SCRIPT" -f
41
+ miga_end_project_step "$DIR"
@@ -4,14 +4,13 @@ set -e
4
4
  SCRIPT="clade_finding"
5
5
  # shellcheck source=scripts/miga.bash
6
6
  . "$MIGA/scripts/miga.bash" || exit 1
7
- cd "$PROJECT/data/10.clades/01.find"
7
+ DIR="$PROJECT/data/10.clades/01.find"
8
8
 
9
9
  # Initialize
10
- miga date > "miga-project.start"
10
+ miga_start_project_step "$DIR"
11
11
 
12
12
  # Run
13
13
  ruby -I "$MIGA/lib" "$MIGA/utils/subclades.rb" "$PROJECT" "$SCRIPT"
14
14
 
15
15
  # Finalize
16
- miga date > "miga-project.done"
17
- miga add_result -P "$PROJECT" -r "$SCRIPT" -f
16
+ miga_end_project_step "$DIR"
@@ -4,10 +4,10 @@ set -e
4
4
  SCRIPT="haai_distances"
5
5
  # shellcheck source=scripts/miga.bash
6
6
  . "$MIGA/scripts/miga.bash" || exit 1
7
- cd "$PROJECT/data/09.distances/01.haai"
7
+ DIR="$PROJECT/data/09.distances/01.haai"
8
8
 
9
9
  # Initialize
10
- miga date > "miga-project.start"
10
+ miga_start_project_step "$DIR"
11
11
 
12
12
  # Cleanup databases
13
13
  ruby -I "$MIGA/lib" "$MIGA/utils/cleanup-databases.rb" "$PROJECT" "$CORES"
@@ -42,5 +42,4 @@ if(sum(haai[,'a'] != haai[,'b']) > 0){
42
42
  " | R --vanilla
43
43
 
44
44
  # Finalize
45
- miga date > "miga-project.done"
46
- miga add_result -P "$PROJECT" -r "$SCRIPT" -f
45
+ miga_end_project_step "$DIR"
@@ -9,6 +9,24 @@ SCRIPT=${SCRIPT:-$(basename "$0" .bash)}
9
9
 
10
10
  function exists { [[ -e "$1" ]] ; }
11
11
  function fx_exists { [[ $(type -t "$1") == "function" ]] ; }
12
+ function miga_start_project_step {
13
+ local dir="$1"
14
+ local dir_r="${dir}.running"
15
+ mkdir -p "$dir"
16
+ mkdir -p "$dir_r"
17
+ cd "$dir_r"
18
+ miga date > "miga-project.start"
19
+ }
20
+ function miga_end_project_step {
21
+ local dir="$1"
22
+ local dir_r="${dir}.running"
23
+ cd "$dir"
24
+ rm -rf miga-project.*
25
+ mv "$dir_r"/miga-project.* .
26
+ rmdir "$dir_r" &>/dev/null || true
27
+ miga date > "miga-project.done"
28
+ miga add_result -P "$PROJECT" -r "$SCRIPT" -f
29
+ }
12
30
 
13
31
  if [[ "$SCRIPT" != "d" && "$SCRIPT" != "p" ]] ; then
14
32
  echo ""
@@ -4,10 +4,10 @@ set -e
4
4
  SCRIPT="ogs"
5
5
  # shellcheck source=scripts/miga.bash
6
6
  . "$MIGA/scripts/miga.bash" || exit 1
7
- cd "$PROJECT/data/10.clades/03.ogs"
7
+ DIR="$PROJECT/data/10.clades/03.ogs"
8
8
 
9
9
  # Initialize
10
- miga date > "miga-project.start"
10
+ miga_start_project_step "$DIR"
11
11
 
12
12
  DS=$(miga ls -P "$PROJECT" --ref --no-multi)
13
13
 
@@ -51,5 +51,4 @@ else
51
51
  fi
52
52
 
53
53
  # Finalize
54
- miga date > "miga-project.done"
55
- miga add_result -P "$PROJECT" -r "$SCRIPT" -f
54
+ miga_end_project_step "$DIR"
@@ -13,7 +13,7 @@ while true ; do
13
13
  let k=$k+1
14
14
  if [[ $k -gt 10 ]] ; then
15
15
  miga new --update -P "$PROJECT" \
16
- -m "run_$res=false,warn=Too many failed attempts to run $res."
16
+ -m "run_$res=false,warn=Too many failed attempts to run $res"
17
17
  fi
18
18
  else
19
19
  k=0
@@ -5,11 +5,9 @@ SCRIPT="project_stats"
5
5
  # shellcheck source=scripts/miga.bash
6
6
  . "$MIGA/scripts/miga.bash" || exit 1
7
7
  DIR="$PROJECT/data/90.stats"
8
- [[ -d "$DIR" ]] || mkdir -p "$DIR"
9
- cd "$DIR"
10
8
 
11
9
  # Initialize
12
- miga date > "miga-project.start"
10
+ miga_start_project_step "$DIR"
13
11
 
14
12
  # Execute doctor
15
13
  echo "# Doctor"
@@ -25,5 +23,4 @@ ruby -I "$MIGA/lib" \
25
23
  "$MIGA/utils/index_metadata.rb" "$PROJECT" "miga-project.metadata.db"
26
24
 
27
25
  # Finalize
28
- miga date > "miga-project.done"
29
- miga add_result -P "$PROJECT" -r "$SCRIPT" -f
26
+ miga_end_project_step "$DIR"
@@ -4,14 +4,13 @@ set -e
4
4
  SCRIPT="subclades"
5
5
  # shellcheck source=scripts/miga.bash
6
6
  . "$MIGA/scripts/miga.bash" || exit 1
7
- cd "$PROJECT/data/10.clades/02.ani"
7
+ DIR="$PROJECT/data/10.clades/02.ani"
8
8
 
9
9
  # Initialize
10
- miga date > "miga-project.start"
10
+ miga_start_project_step "$DIR"
11
11
 
12
- # Run R code
12
+ # Run
13
13
  ruby -I "$MIGA/lib" "$MIGA/utils/subclades.rb" "$PROJECT" "$SCRIPT"
14
14
 
15
15
  # Finalize
16
- miga date > "miga-project.done"
17
- miga add_result -P "$PROJECT" -r "$SCRIPT" -f
16
+ miga_end_project_step "$DIR"
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.19.0
4
+ version: 0.7.20.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: 2021-01-02 00:00:00.000000000 Z
11
+ date: 2021-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daemons