nextclade
nextclade copied to clipboard
ENH: Add convenience flag to Nextclade CLI that auto-downloads and uses latest dataset
In most situations, users will want to automatically use the latest dataset version.
Right now, that means one has to run two commands:
nextclade dataset get [...]
nextclade run --input-dataset [...]
We could add a convenience flag to nextclade to invoke the dataset command automatically after invokation, like:
nextclade run --input-sequences in.fa --download-dataset sars-cov-2 ...
This would download the latest version of the specified dataset to a temporary folder and use it directly followed by deletion.
@corneliusroemer Where would be the temporary folder located? Is it not too risky to delete things?
Doesn't this work: tempdir from tempfile crate? https://crates.io/crates/tempfile
use tempfile::tempdir;
use std::fs::File;
use std::io::{self, Write};
// Create a directory inside of `std::env::temp_dir()`
let dir = tempdir()?;
let file_path = dir.path().join("my-temporary-note.txt");
let mut file = File::create(file_path)?;
writeln!(file, "Brian was here. Briefly.")?;
// `tmp_dir` goes out of scope, the directory as well as
// `tmp_file` will be deleted here.
drop(file);
dir.close()?;
Might work! (if it also works with docker and other weird things). Maybe we could just dump it to the current dir, with some predefined dir name?
In any case, a bit scary to delete stuff.
Yes, create a temp-dir in the current directory. Should work - don't see why not. Not a priority, just think this could make it more usable without being too difficult to implement (I hope).
We've completed this! One can auto-download a dataset with -d