miga-base 1.2.11.0 → 1.2.12.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: bca3141b79964a880f22ba6e4e724b4821466321942a02f6443dcb1e5ba3b6cc
4
- data.tar.gz: 45af5251d8bced591ba493ca7b9cac5ae45d2c527f19902773a122f436b93808
3
+ metadata.gz: 44cd40923e839969a12a0111a071a405d8cab376a0fa6e7102a21cafd33774a9
4
+ data.tar.gz: 5d1d0af6324b8c125a178b316a54e90eff2472aa7731407fc4d315a8b3fe9a36
5
5
  SHA512:
6
- metadata.gz: 7e648e5f3068348bd0064f8c3f8e3691c9c978aa9c06bb35bcf1b9a3b9a8d8eb0d1d67b5520e52537cf3ef6940414f88d24602cfaa47129fa39face66a95b375
7
- data.tar.gz: aab0fb4e5764d76eb78a908e6997761e346d8027323bf305528ccf5abcd258b3b84d6ef356352a270b2e273e8563a28e6e9e0f6993bd7bd648ac28c4a6bce6d7
6
+ metadata.gz: 8f70cb028127bd30f5293005afaf73cf10c02a003cef1e027d85b3c6a2f61377e95be5962c03f6dd199f63da252160b21b7142c135a305aacb7f46b6551c90cf
7
+ data.tar.gz: 50a8676d741894e58a1b4c9b5f53ee665ff938e2814bf4570e204f26d38de7952aab1ee36c01a458021af3bba166432572d79f84f1b5fb430684bf9034506e97
@@ -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
@@ -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, 0].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.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: 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