diff --git a/docs/tutorial/downloading_geneset_command_line.md b/docs/tutorial/downloading_geneset_command_line.md new file mode 100644 index 0000000..8c54fbf --- /dev/null +++ b/docs/tutorial/downloading_geneset_command_line.md @@ -0,0 +1,69 @@ +# Downloading a Geneset From the Command Line +This guide will walk you through how to download a geneset from Geneweaver on the +command line. This can be useful if you want to automate the downloading of genesets +from Geneweaver, or if you want to use the geneset data in a local analysis tool, +or if you want to access Geneweaver data from somewhere without a web browser. + +### Step 0: Install the `gweave` Command Line Tool + +##### Optional (But Recommended) +Create a virtual environment for the `geneweaver-client` package. +``` +python3 -m venv geneweaver-client +source geneweaver-client/bin/activate +``` + +``` +pip install geneweaver-client +``` + +### Step 1: Login to Geneweaver +``` +gweaver beta auth login --reauth +``` + + +### Step 2: Download Geneset Data +``` +gweave -p alpha api genesets get 1234 --gene-id-type=Wormbase +``` + +The `-p` flag will format the results in a way that is easier to read. + +#### Pretty Printing +You can save the results to a file by using the `>` operator. +``` +gweave -p alpha api genesets get 1234 --gene-id-type=Wormbase > geneset_123.json +``` + +#### Specifying Gene ID Type +The `--gene-id` flag is optional. If you do not specify a gene ID type, the default +will be whatever the geneset was originally uploaded as. + +You can specify any gene ID type that is available in Geneweaver, specifically any of the +`GeneIdentifier` types available in the geneweaver.core.enum module +(`geneweaver-core` package). + +##### GeneIdentifier Types + +!!! warning + The `GeneIdentifier` types are reproduced here for convenience, but the most + up-to-date list can be found in the `geneweaver-core` package by using the + `geneweaver.core.enum.GeneIdentifier` class. + +- "Entrez" +- "Ensemble Gene" +- "Ensemble Protein" +- "Ensemble Transcript" +- "Unigene" +- "Gene Symbol" +- "Unannotated" +- "MGI" +- "HGNC" +- "RGD" +- "ZFIN" +- "FlyBase" +- "Wormbase" +- "SGD" +- "miRBase" +- "CGNC" \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 08b54d2..c8bcce8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -81,7 +81,8 @@ nav: - tutorial/index.md - Client Login: tutorial/geneweaver_client_login.ipynb - NCI-60 Example Workflow: tutorial/nci_60_example_01.ipynb - - Download Genesets: tutorial/download_genesets.ipynb + - Download Geneset (CLI): tutorial/download_geneset_command_line.md +# - Download Genesets: tutorial/download_genesets.ipynb # - Accessing Geneweaver Data: tutorial/accessing-geneweaver-data.md # - Running a Local Database: tutorial/running-a-local-database.md # - Creating New Tools: tutorial/creating-new-tools.md