miga-base 1.2.11.0 → 1.2.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bca3141b79964a880f22ba6e4e724b4821466321942a02f6443dcb1e5ba3b6cc
4
- data.tar.gz: 45af5251d8bced591ba493ca7b9cac5ae45d2c527f19902773a122f436b93808
3
+ metadata.gz: 176a9a20427a4b14db0418fb1140025d2a5dc3737e4e6c55926524bd4d0f4d32
4
+ data.tar.gz: 4d1dca0ba71ea2ad86f4a4ffe5fbda8a8146f91464f092efe780ba92598bfd36
5
5
  SHA512:
6
- metadata.gz: 7e648e5f3068348bd0064f8c3f8e3691c9c978aa9c06bb35bcf1b9a3b9a8d8eb0d1d67b5520e52537cf3ef6940414f88d24602cfaa47129fa39face66a95b375
7
- data.tar.gz: aab0fb4e5764d76eb78a908e6997761e346d8027323bf305528ccf5abcd258b3b84d6ef356352a270b2e273e8563a28e6e9e0f6993bd7bd648ac28c4a6bce6d7
6
+ metadata.gz: 521cb14499220bcf5cec8d5a532f7e8fe2708eac6ca7bdd53e5ca5472857d0a57f08750a232cbbd2cf704b082295a6668ec275e0956fc08a783dda13b0cc0471
7
+ data.tar.gz: 451d7f35d2e1666b3125fa58a85c171eb89310379a6acd67c1fd19bb0e1274e1cfe0a93775ccf42e93f03ea5f0e85b6045147fc8272b0d26e57bfdb97ecfa623
@@ -28,7 +28,6 @@ module MiGA::Cli::Action::Download::Gtdb
28
28
 
29
29
  def remote_list
30
30
  cli.say 'Downloading genome list'
31
- ds = {}
32
31
  extra = ['sp_reps_only=' + cli[:reference].to_s]
33
32
  json = MiGA::RemoteDataset.download(
34
33
  :gtdb, :taxon, cli[:taxon], :genomes, nil, extra
@@ -49,7 +48,7 @@ module MiGA::Cli::Action::Download::Gtdb
49
48
  end
50
49
 
51
50
  def remote_row_name(asm)
52
- acc = "#{asm}"
51
+ acc = asm.to_s
53
52
  acc.gsub!(/\.\d+\Z/, '') unless cli[:add_version]
54
53
  acc.miga_name
55
54
  end
@@ -99,6 +99,9 @@ module MiGA::Cli::ObjectsHelper
99
99
  when 'true'; v = true
100
100
  when 'false'; v = false
101
101
  when 'nil'; v = nil
102
+ when /^(Int|Float)\(.*\)$/
103
+ tr = v =~ /^Int/ ? :to_i : :to_f
104
+ v = v.gsub(/.*\((.*)\)/, '\1').send(tr)
102
105
  end
103
106
  if k == '_step'
104
107
  obj.metadata["_try_#{v}"] ||= 0
@@ -384,7 +384,10 @@ module MiGA::Dataset::Result
384
384
  ##
385
385
  # Add result type +:stats+ at +base+ (no +_opts+ supported)
386
386
  def add_result_stats(base, _opts)
387
- MiGA::Result.new("#{base}.json")
387
+ add_files_to_ds_result(
388
+ MiGA::Result.new("#{base}.json"), name,
389
+ trna_list: '.trna.txt'
390
+ )
388
391
  end
389
392
 
390
393
  ##
data/lib/miga/taxonomy.rb CHANGED
@@ -63,6 +63,8 @@ class MiGA::Taxonomy < MiGA::MiGA
63
63
  @ranks[rank.to_sym]
64
64
  end
65
65
 
66
+ alias :fetch :[]
67
+
66
68
  ##
67
69
  # Get the alternative taxonomies.
68
70
  # - If +which+ is nil (default), returns all alternative taxonomies as Array
data/lib/miga/version.rb CHANGED
@@ -12,7 +12,7 @@ module MiGA
12
12
  # - String indicating release status:
13
13
  # - rc* release candidate, not released as gem
14
14
  # - [0-9]+ stable release, released as gem
15
- VERSION = [1.2, 11, 0].freeze
15
+ VERSION = [1.2, 12, 1].freeze
16
16
 
17
17
  ##
18
18
  # Nickname for the current major.minor version.
@@ -20,7 +20,7 @@ module MiGA
20
20
 
21
21
  ##
22
22
  # Date of the current gem relese.
23
- VERSION_DATE = Date.new(2022, 12, 28)
23
+ VERSION_DATE = Date.new(2022, 12, 30)
24
24
 
25
25
  ##
26
26
  # References of MiGA
data/scripts/stats.bash CHANGED
@@ -9,7 +9,32 @@ DIR="$PROJECT/data/90.stats"
9
9
  cd "$DIR"
10
10
 
11
11
  # Initialize
12
- miga date > "$DATASET.start"
12
+ miga date > "${DATASET}.start"
13
+
14
+ # tRNAscan-SE
15
+ fa="../05.assembly/${DATASET}.LargeContigs.fna"
16
+ if [[ -s "$fa" ]] ; then
17
+ d="$(miga ls -P "$PROJECT" -D "$DATASET" -m tax:d | awk '{print $2}')"
18
+ if [[ "$d" == "Bacteria" || "$d" == "Archaea" || "$d" == "Eukaryota" ]] ; then
19
+ dom_opt="-$(echo "$d" | perl -pe 's/(\S).*/$1/')"
20
+ out="${DATASET}.trna.txt"
21
+ # `echo O` is to avoid a hang from a pre-existing output file.
22
+ # This is better than pre-checking (and removing), because it avoids
23
+ # the (unlikely) scenario of a file racing (e.g., a file created right
24
+ # before tRNAscan-SE starts, or a `rm` failure).
25
+ #
26
+ # The trailing `|| true` is to treat failure as non-fatal
27
+ echo O | tRNAscan-SE $dom_opt -o "$out" -q "$fa" || true
28
+ if [[ -s "$out" ]] ; then
29
+ cnt=$(tail -n +4 "$out" | wc -l | awk '{print $1}')
30
+ aa="$(tail -n +4 "$out" | grep -v 'pseudo$' | awk '{print $5}' \
31
+ | grep -v 'Undet' | perl -pe 's/^f?([A-Za-z]+)[0-9]?/$1/' \
32
+ | sort | uniq | wc -l | awk '{print $1}')"
33
+ miga edit -P "$PROJECT" -D "$DATASET" \
34
+ -m "trna_count=Int($cnt),trna_aa=Int($aa)"
35
+ fi
36
+ fi
37
+ fi
13
38
 
14
39
  # Calculate statistics
15
40
  for i in raw_reads trimmed_fasta assembly cds essential_genes ssu distances taxonomy ; do
@@ -20,3 +20,4 @@ Fastp (reads) fastp https://github.com/OpenGene/fastp
20
20
  Temurin (rdp) java https://adoptium.net/ Any Java VM would work
21
21
  MyTaxa (mytaxa) MyTaxa http://enve-omics.ce.gatech.edu/mytaxa
22
22
  Krona (mytaxa) ktImportText https://github.com/marbl/Krona/wiki
23
+ tRNAscan-SE tRNAscan-SE http://trna.ucsc.edu/tRNAscan-SE/ Required version: 2+
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: 1.2.11.0
4
+ version: 1.2.12.1
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: 2022-12-28 00:00:00.000000000 Z
11
+ date: 2022-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daemons