Command Line Examples
The Cirro command-line interface (CLI) provides an easy way to access your Cirro data from the command prompt. The most common uses of the CLI are to upload new datasets or to download either partial or entire datasets. To get started with the CLI, first learn about installing the Cirro client and then see the examples below.
Quick Hint: Uploading and Downloading Large Files from the Command Line
# Install the CLI
pip install cirro
# Upload
cirro upload -i
# or Download
cirro download -i
Automated Uploading Datasets
To automate the process of dataset upload, cirro
can be used in non-interactive mode. To use this method, run:
cirro upload [OPTIONS]
[OPTIONS]:
--name TEXT Name of the dataset
--description TEXT Description of the dataset (optional)
--project TEXT Name or ID of the project
--process TEXT Name or ID of the ingest process (indicating the dataset type)
--data-directory TEXT Directory you wish to upload
-i, --interactive Gather arguments interactively
--help Show this message and exit.
Interactive Uploading Datasets
To start the interactive upload process, run:
cirro upload --interactive
enter
after each of the following:
- Select the project which the new dataset should be uploaded to using the arrow keys.
E.g. Test Project
- Enter the path to the directory on your filesystem which should be uploaded.
E.g. /shared/biodata/test
- Confirm the number and size of files to upload.
E.g. Yes
- Select the dataset type using the arrow keys.
E.g. RNAseq (FASTQ)
- Enter the dataset name.
E.g. Test Dataset
- Enter the dataset description (optional).
E.g. Test data for practice
After providing all of the required information, the files will be uploaded into the new dataset. Once the upload process is complete, the dataset will become visible in Cirro.
Automated Downloading Datasets
To automate the process of dataset download, cirro
can be used in non-interactive mode. To use this method, run the command:
cirro download [OPTIONS]
[OPTIONS]:
--project TEXT Name or ID of the project
--dataset TEXT ID of the dataset
--data-directory TEXT Directory to store the files
-i, --interactive Gather arguments interactively
--help Show this message and exit.
Interactive Downloading Datasets
To interactively download a dataset (or part of a dataset) from Cirro to your local hard drive, run:
cirro download --interactive
You will be prompted to enter the following information. Follow the directions in the command line and hit enter
after each of the following:
- Select the project which contains the dataset of interest
- Select the dataset to download. Here you can paste your full dataset name and ID and hit
enter
. You can also start typing your dataset name, then pressTAB
and once you see your dataset, you can use the arrows keys to walk through the options and hitenter
to select a dataset. Or pressingTAB
immediately will provide a list of all available options, and you can arrow down to your selection and hitenter
. - Edit the local folder to use as the destination of the download if necessary
- Select if you want to download the entire dataset, only some of the files by choosing from a list of file names, or only some of the files by providing a glob naming pattern (e.g.
*.fastq.gz
)- If you choose to download some of the files by selecting them, use the up/down arrows keys to walk through the list and hit
space
to select a file andspace
again to deselect it. If you want to select all the files, you can hita
. If it is easier, you can also select the files you don't want to download and then hiti
to switch all the selected and unselected files. When you are happy with your selection, hitenter
. - If you choose to download some of the files using a pattern, type the glob naming pattern and hit
enter
. Then you will see a list of the files you've selected and you can choosey
to continue downloading orn
to go back and re-enter your naming pattern.
- If you choose to download some of the files by selecting them, use the up/down arrows keys to walk through the list and hit
All files from the dataset will be downloaded to a folder named data/
in your selected destination.
Listing Datasets in a Project
To list all the datasets available in a project (often used before downloading files), you can run:
cirro list-datasets [OPTIONS]
[OPTIONS]:
--project TEXT ID of the project
-i, --interactive Gather arguments interactively
--help Show this message and exit.