Permalink
Browse files

Added CLI support for API Keys

  • Loading branch information...
lmrodriguezr committed Dec 10, 2018
1 parent 07d3622 commit 46281f59136d6237b8629ae9f5017a63d9bfbe72
Showing with 36 additions and 1 deletion.
  1. +5 −1 actions/get.rb
  2. +1 −0 actions/ncbi_get.rb
  3. +15 −0 manual/part4/deploy-clade.md
  4. +15 −0 manual/part4/deploy-refseq.md
@@ -39,10 +39,11 @@
opt.on('--get-metadata',
'Only download and update metadata for existing datasets'
){ |v| o[:get_md] = v }
opt.on('--api-key STRING',
'API key for the given universe.'){ |v| o[:api_key] = v }
opt_common(opt, o)
end.parse!


##=> Main <=
glob = [o]
unless o[:file].nil?
@@ -66,6 +67,9 @@

glob.each do |o_i|
opt_require(o_i, project: '-P', dataset: '-D', ids: '-I')
unless o_i[:api_key].nil?
ENV["#{o_i[:universe].to_s.upcase}_API_KEY"] = o_i[:api_key]
end

$stderr.puts "Dataset: #{o_i[:dataset]}" unless o_i[:q]
$stderr.puts 'Loading project.' unless o_i[:q]
@@ -50,6 +50,7 @@
opt.on('-R', '--remote-list PATH',
'Path to an output file with the list of all datasets listed remotely.'
){ |v| o[:remote_list]=v }
opt.on('--api-key STRING', 'NCBI API key.'){ |v| ENV['NCBI_API_KEY'] = v }
opt_common(opt, o)
end.parse!

@@ -39,6 +39,21 @@ miga ncbi_get -T "Escherichia coli" -P . --complete --chromosome -v
Note that you can change the value of `-T` from `"Escherichia coli"` to any
other species name, or even taxa of any rank such as genus or family.

It is strongly recommended to use an
[NCBI API Key](https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/)
to increase the number of allowed requests. Once you obtain one, you can pass it
as an argument:

```bash
miga ncbi_get -T "Escherichia coli" -P . --complete --chromosome --api-key ABCD123 -v
```

Or you can set it globally as an environmental variable before running `miga`:

```bash
export NCBI_API_KEY=ABCD123
```

## 2. Add your own genomes

If you have any unreleased genomes, you can simply add them to the same project
@@ -22,6 +22,21 @@ take it from where it failed.
miga ncbi_get -P . --reference -v
```

It is strongly recommended to use an
[NCBI API Key](https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/)
to increase the number of allowed requests. Once you obtain one, you can pass it
as an argument:

```bash
miga ncbi_get -P . --reference --api-key ABCD123 -v
```

Or you can set it globally as an environmental variable before running `miga`:

```bash
export NCBI_API_KEY=ABCD123
```

## 2. Launch the daemon

Now that your data is ready, you can fire up the daemon to start processing the

0 comments on commit 46281f5

Please sign in to comment.