Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding download geneset cli tutorial #28

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions docs/tutorial/downloading_geneset_command_line.md
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading