Download files from projects across multiple basespace accounts.
- Easy syntax
basespace-dl PROJECT
- Multiple accounts (one time config file setup)
- Fast (concurrent fetching and downloading)
- Only download what you need (using regex patterns)
Demo data from Basespace's "Public Data"
List ALL projects
basespace-dl ALL
Download all files from a project
basespace-dl project17890
Download files that match a regex pattern
basespace-dl project17890 -p "(A01|B02|F10)"
Include Undetermined files
basespace-dl project17890 -U
List files from a specific project
basespace-dl project17890 -F
For some more advanced examples of what you can do, check out the cookbook.
Using macOS Homebrew or Linuxbrew
brew install dweb0/all/basespace-dl
To upgrade to the latest version
brew update
brew upgrade basespace-dl
Using cargo (for rust developers)
cargo install --git https://github.com/dweb0/basespace-dl
Or you can download a pre-built binary for Mac, Windows, or Linux on the releases page.
After installation, you will need to set up your config file. The format is a simple key-value toml stored in ~/.config/basespace-dl/default.toml.
# UserID = "access_token"
11111111 = "youraccesstokenforaccount1goeshere"
22222222 = "youraccesstokenforaccount2goeshere"
33333333 = "youraccesstokenforaccount3goeshere"
To link an account, we need to retrieve two things: the access token and its respective userID.
- Go to the developer dashboard.
- Create a new app.
- Navigate to the "Credentials" tab, and copy the "Access Token".
Now that you have your token, we can run a curl command to get your user ID. Look for the "Id" field in the output.
TOKEN="STORE_YOUR_TOKEN_HERE"
curl "https://api.basespace.illumina.com/v1pre3/users/current/" -H "x-access-token: $TOKEN"
You can also go to https://api.basespace.illumina.com/v1pre3/users/current while logged in to see the same thing.
Add the "user_id = access_token" pair to the config file. Do this for each account you would like to link.
Note: It's a good idea to set the file permissions as readable / writeable by only you.
chmod 600 ~/.config/basespace-dl/default.toml
Now you're ready to go!
Try running a command to see if it works (assuming you have projects in your account).
basespace-dl ALL