miga-base 1.2.13.4 → 1.2.14.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: cdb8e809ff19a09d50286683db9d524d203bc0d62ad90d2b760a1244d16cc484
4
- data.tar.gz: ca509e431f7c16cf924f895ac37ef33c94ce715460eab42fed0ff5c6c8aca2a8
3
+ metadata.gz: 6af49f95d3280cf3cbba4bfb12ee9987ce7af7515a329aad9112f3a2ba2357d8
4
+ data.tar.gz: 024d90b9f7eca754af3dbc13ca2aaa7ad51c5871ad531bffec9bd6c43350b218
5
5
  SHA512:
6
- metadata.gz: f118bac8e0588fc07666faf74f4c66d0b4f021dde71a6d75092442d09888ce95341cb3b6780a3143a03ea88598e51926965162be3a64717a69a74ed27cf85ef1
7
- data.tar.gz: be23d776d61bbad830d5bff139d725a22f2821eb23bc7a61da9c49c4eff89e560a38d4078a0f44c2d6e1185aea7555aeb1a81e50820e4c704ee11b5ed30c4453
6
+ metadata.gz: 2f9f66736037ab87ef93a83e08decf55813addc75151f28ac06e6c9d4ee54f21c450cbc2c6b681c90853e6b96974303ffe3ea2aac04d4fb4bbda79386af49b46
7
+ data.tar.gz: 99fae0ad085c5165bf5232c348b19f89adf3c4b21502ba09636e66e45faadfa2a2a4f4d833bb3878123ac0b11535e739dfbc394668bdb651d834e76b177844ae
@@ -25,7 +25,7 @@ module MiGA::Cli::Action::Download::Base
25
25
 
26
26
  def cli_save_actions(opt)
27
27
  cli.opt_flag(
28
- opt, '--only-metadata',
28
+ opt, 'only-metadata',
29
29
  'Create datasets without input data but retrieve all metadata',
30
30
  :only_md
31
31
  )
@@ -23,6 +23,9 @@ module MiGA::Cli::Action::Download::Gtdb
23
23
 
24
24
  def sanitize_cli
25
25
  cli.ensure_par(taxon: '-T')
26
+ unless cli[:taxon] =~ /^[a-z]__\S+$/
27
+ raise 'Taxon (-T) must be in GTDB format: s__Macondimonas_diazotrophica'
28
+ end
26
29
  cli[:save_every] = 1 if cli[:dry]
27
30
  end
28
31
 
@@ -31,6 +31,10 @@ class MiGA::Cli::Action::GtdbGet < MiGA::Cli::Action
31
31
  cli_name_modifiers(opt)
32
32
  cli_filters(opt)
33
33
  cli_save_actions(opt)
34
+ opt.on(
35
+ '--api-key STRING',
36
+ 'NCBI API key'
37
+ ) { |v| ENV['NCBI_API_KEY'] = v }
34
38
  end
35
39
  end
36
40
 
@@ -35,10 +35,18 @@ module MiGA::Cli::Action::Wf
35
35
  '-T', '--ncbi-taxon STRING',
36
36
  'Download all the genomes in NCBI classified as this taxon'
37
37
  ) { |v| cli[:ncbi_taxon] = v }
38
+ opt.on(
39
+ '-G', '--gtdb-taxon STRING',
40
+ 'Download all the genomes in GTDB classified as this taxon'
41
+ ) { |v| cli[:gtdb_taxon] = v }
38
42
  opt.on(
39
43
  '--no-draft',
40
- 'Only download complete genomes, not drafts'
44
+ 'Only download complete genomes, not drafts (requires -T)'
41
45
  ) { |v| cli[:ncbi_draft] = v }
46
+ opt.on(
47
+ '--gtdb-ref',
48
+ 'Only download reference anchor genomes in GTDB (requires -G)'
49
+ ) { |v| cli[:gtdb_ref] = v }
42
50
  opt.on(
43
51
  '--max-download INT', Integer,
44
52
  'Maximum number of genomes to download (by default: unlimited)'
@@ -136,7 +144,7 @@ module MiGA::Cli::Action::Wf
136
144
  p.set_option(i, cli[i])
137
145
  end
138
146
 
139
- # Download datasets
147
+ # Download datasets from NCBI
140
148
  unless cli[:ncbi_taxon].nil?
141
149
  what = cli[:ncbi_draft] ? '--all' : '--complete'
142
150
  cmd = ['ncbi_get', '-P', cli[:outdir], '-T', cli[:ncbi_taxon], what]
@@ -144,6 +152,14 @@ module MiGA::Cli::Action::Wf
144
152
  call_cli(cmd)
145
153
  end
146
154
 
155
+ # Download datasets from GTDB
156
+ unless cli[:gtdb_taxon].nil?
157
+ cmd = ['gtdb_get', '-P', cli[:outdir], '-T', cli[:gtdb_taxon]]
158
+ cmd << '--reference' if cli[:gtdb_ref]
159
+ cmd += ['--max', cli[:ncbi_max]] if cli[:ncbi_max]
160
+ call_cli(cmd)
161
+ end
162
+
147
163
  # Add datasets
148
164
  call_cli(
149
165
  [
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, 13, 4].freeze
15
+ VERSION = [1.2, 14, 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(2023, 1, 12)
23
+ VERSION_DATE = Date.new(2023, 1, 16)
24
24
 
25
25
  ##
26
26
  # References of MiGA
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.13.4
4
+ version: 1.2.14.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: 2023-01-12 00:00:00.000000000 Z
11
+ date: 2023-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daemons