Skip to content

Commit

Permalink
149 update docs to show python api (#157)
Browse files Browse the repository at this point in the history
* included gruvbox theme for highlight for highlight.js

* moved blat to separate ucsc submodule

* added blat to ucsc submodule

* used new format for archs4

* using new format for docs with table for args plus added in all python interface usages where applicable

* fix capitalization typo in docs

* ignore book outputs
  • Loading branch information
noamteyssier authored Nov 1, 2022
1 parent 7bd4761 commit 242fa4c
Show file tree
Hide file tree
Showing 29 changed files with 593 additions and 368 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ Cargo.lock

**__pycache__**
*DS_Store*

# Ignore docs book
docs/book/**
1 change: 1 addition & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- [Info](./info.md)
- [Seq](./seq.md)
- [UCSC](./ucsc.md)
- [BLAT](./ucsc/blat.md)
- [PDB](./pdb.md)
- [Structure](./pdb/structure.md)
- [Info](./pdb/info.md)
Expand Down
40 changes: 25 additions & 15 deletions docs/src/archs4/correlate.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
# Correlate

## Help
Performs a gene-correlation analysis using [ARCHS4](https://maayanlab.cloud/archs4).

```text
Performs a gene-correlation analysis
## Arguments

Usage: ggetrs archs4 correlate [OPTIONS] <GENE_NAME>
| Name | Short | Long | Description |
|------|-------|------|-------------|
| Count | `-c` | `--count` | number of values to recover [default: 100] |
| Output | `-o` | `--output` | optional filepath to write output to [default=stdout] |

Arguments:
<GENE_NAME> Gene name to query for correlation
Options:
-c, --count <COUNT> number of values to recover [default: 100]
-o, --output <OUTPUT> output filepath to write to [default=stdout]
-h, --help Print help information
-V, --version Print version information
```

## Usage
## Command Line Interface

```bash
# Perform a gene-correlation analysis with ARCHS4
ggetrs archs4 correlate AP2S1

# Perform a gene-correlation analysis with ARCHS4
# But only return the top 10 results
ggetrs archs4 correlate -c 10 AP2S1
```

## Python

```python
import ggetrs

# Perform a gene-correlation analysis for AP2S1
# and return the top 10 results
ggetrs.archs4.correlate("AP2S1", 10)

# Perform a gene-correlation analysis for AP2S1
# and return the top 100 results
ggetrs.archs4.correlate("AP2S1", 100)
```
38 changes: 23 additions & 15 deletions docs/src/archs4/tissue.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
# Tissue

## Help
Performs a tissue-correlation analysis using [ARCHS4](https://maayanlab.cloud/archs4).

```text
Perform a tissue-enrichment analysis
## Arguments

Usage: ggetrs archs4 tissue [OPTIONS] <GENE_NAME>
| Name | Short | Long | Description |
|------|-------|------|-------------|
| Species | `-s` | `--species` | species of organism to recover [default: human] [possible values: human, mous] |
| Output | `-o` | `--output` | optional filepath to write output to [default=stdout] |

Arguments:
<GENE_NAME> Gene name to query for tissue

Options:
-s, --species <SPECIES> number of values to recover [default: human] [possible values: human, mouse]
-o, --output <OUTPUT> output filepath to write to [default=stdout]
-h, --help Print help information
-V, --version Print version information
```

## Usage
## Command Line Interface

```bash
# Find tissue-level expression using ARCHS4
# Find tissue-level expression for AP2S1 in Humans
ggetrs archs4 tissue AP2S1

# Find tissue-level expression for AP2S1 in Mice
ggetrs archs4 tissue -s mouse AP2S1
```

## Python

```python
import ggetrs

# perform a tissue-correlation analysis for AP2S1 in Humans
ggetrs.archs4.tissue("AP2S1", "human")

# perform a tissue-correlation analysis for AP2S1 in Mice
ggetrs.archs4.tissue("AP2S1", "mouse")
```
17 changes: 5 additions & 12 deletions docs/src/autocomplete.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,13 @@

This is used to generate autocomplete information for your terminal shell.

## Help
## Arguments

```text
Set up autocomplete for various shells
| Name | Short | Long | Description |
|------|-------|------|-------------|
| Shell | `-s` | `--shell` | Shell to generate autocompletions for [possible values: bash, elvish, fish, powershell, zsh]|

Usage: ggetrs autocomplete --shell <SHELL>
Options:
-s, --shell <SHELL> Shell to generate autocompletions for [possible values: bash, elvish, fish, powershell, zsh]
-h, --help Print help information
-V, --version Print version information
```

## Usage
## Command Line Interface

```bash
# generate autocompletions for the fish shell
Expand Down
62 changes: 42 additions & 20 deletions docs/src/blast.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,19 @@ You may override these though by using their argument flags.
Keep in mind that there is no logic built into validating your inputs.
All non-default arguments will be passed to the BLAST API as is.

```text
Performs a BLAST query for a given sequence
Usage: ggetrs blast [OPTIONS] <QUERY>
Arguments:
<QUERY> query sequence to BLAST
Options:
-p, --program <PROGRAM> blast program to use [possible values: blastn, blastp, blastx, tblastn, tblastx]
-d, --database <DATABASE> blast database to use [possible values: nt, nr, refseq-rna, refseq-protein, swissprot, pdbaa, pdbnt]
-l, --limit <LIMIT> Number of hits to return [default: 50]
-e, --expect <EXPECT> Minimum expected value to consider [default: 10.0]
-f, --low-comp-filter Whether to use a complexity filter (default = false)
-m, --megablast Whether to use MEGABLAST (default = true)
-o, --output <OUTPUT> optional filepath to write output to [default=stdout]
-h, --help Print help information
-V, --version Print version information
```
## Arguments

| Name | Short | Long | Description |
|------|-------|------|-------------|
| Program | `-p` | `--program` | blast program to use [possible values: blastn, blastp, blastx, tblastn, tblastx] |
| Database | `-d` | `--database` | blast database to use [possible values: nt, nr, refseq-rna, refseq-protein, swissprot, pdbaa, pdbnt] |
| Limit | `-l` | `--limit` | Number of hits to return [default: 50] |
| Expect | `-e` | `--expect` | Minimum expected value to consider [default: 10.0] |
| Low Complexity Filter | `-f` | `--low-comp-filter` | Include flag to use a complexity filter [default = false] |
| MEGABLAST | `-m` | `--megablast` | Whether to use MEGABLAST (default = false) |
| Output | `-o` | `--output` | optional filepath to write output to [default=stdout] |

## Usage
## Command Line Interface

```bash
# Perform BLAST with a nucleotide sequence
Expand All @@ -42,3 +34,33 @@ ggetrs blast MIRFILIQNRAGKTRLAKWYMQFDDDEKQKLIEEVHAVVTVRDAKHTNFVEFRNFKIIYRRYAGLYF
# Perform BLAST with an amino acid sequence using the PDBAA database
ggetrs blast -d pdbaa MIRFILIQNRAGKTRLAKWYMQFDDDEKQKLIEEVHAVVTVRDAKHTNFVEFRNFKIIYRRYAGLYFCICVDVNDNNLAYLEAIHNFVEVLNEYFHNVCELDLVFNFYKVYTVVDEMFLAGEIRETSQTKVLKQLLMLQSLE
```

## Python

```python
import ggetrs

# Perform BLAST with a nucleotide sequence
ggetrs.blast(
"ATACTCAGTCACACAAGCCATAGCAGGAAACAGCGAGCTTGCAGCCTCACCGACGAGTCTCAACTAAAAGGGACTCCCGGAGCTAGGGGTGGGGACTCGGCCTCACACAGTGAGTGCCGG"
)

# Perform BLAST with an amino acid sequence
ggetrs.blast(
"MIRFILIQNRAGKTRLAKWYMQFDDDEKQKLIEEVHAVVTVRDAKHTNFVEFRNFKIIYRRYAGLYFCICVDVNDNNLAYLEAIHNFVEVLNEYFHNVCELDLVFNFYKVYTVVDEMFLAGEIRETSQTKVLKQLLMLQSLE"
)

# Perform BLAST with an amino acid sequence using the PDBAA database
ggetrs.blast(
"MIRFILIQNRAGKTRLAKWYMQFDDDEKQKLIEEVHAVVTVRDAKHTNFVEFRNFKIIYRRYAGLYFCICVDVNDNNLAYLEAIHNFVEVLNEYFHNVCELDLVFNFYKVYTVVDEMFLAGEIRETSQTKVLKQLLMLQSLE",
database = "pdbaa"
)

# Perform BLAST with an amino acid sequence using the PDBAA database with a low complexity filter and a limit
ggetrs.blast(
"MIRFILIQNRAGKTRLAKWYMQFDDDEKQKLIEEVHAVVTVRDAKHTNFVEFRNFKIIYRRYAGLYFCICVDVNDNNLAYLEAIHNFVEVLNEYFHNVCELDLVFNFYKVYTVVDEMFLAGEIRETSQTKVLKQLLMLQSLE",
database = "pdbaa",
limit = 10,
low_comp_filter=True,
)
```
23 changes: 9 additions & 14 deletions docs/src/chembl/activity.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
# Activity

## Help
Queries chemical bioactivity for a provided protein target and return all small molecules.

```text
Queries chemical activity for a provided item
## Arguments

Usage: ggetrs chembl activity [OPTIONS] <QUERY>
Arguments:
<QUERY> Query to retrieve bioactivity
Options:
-l, --limit <LIMIT> Number of results to return [default: 500]
-o, --output <OUTPUT> Optional filepath to write output to [default=stdout]
-h, --help Print help information
-V, --version Print version information
```
| Name | Short | Long | Description |
|------|-------|------|-------------|
| Limit | `-l` | `--limit` | Number of results to return [default: 500] |
| Output | `-o` | `--output` | optional filepath to write output to [default=stdout] |

## Usage

```bash
# Query the Chembl database for small molecules with bioactivity targeting NSD1
ggetrs chembl activity NSD1

# Query the Chembl database for the top 20 bioactive molecules for NSD1
ggetrs chembl activity -l 20 NSD1
```
1 change: 0 additions & 1 deletion docs/src/database.md

This file was deleted.

52 changes: 29 additions & 23 deletions docs/src/enrichr/enrichr.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,29 @@ Perform an enrichment analysis on a list of genes using [Enrichr](https://maayan
This requires at minimum a database name (listed [here](https://maayanlab.cloud/Enrichr/#libraries))
and any number of gene symbols to perform enrichment analysis on.

## Help
## Library Shorthands

```text
Usage: ggetrs enrichr enrichr [OPTIONS] --library <LIBRARY> <GENE_LIST>...
Some shorthands for the library are built into the program for convenience.
These can be used in the command line interface or in the python interface.

Arguments:
<GENE_LIST>... list of gene symbols to perform enrichment analysis on
| Alias | Library |
|-------|---------|
| pathway | KEGG_2021_Human |
| transcription | ChEA_2016 |
| ontology | GO_Biological_Processes_2021 |
| diseases_drugs | GWAS_Catalog_2019 |
| celltypes | PangloaDB_Augmented_2021 |
| kinase_interactions | KEA_2015 |

Options:
-l, --library <LIBRARY> any database listed at: https://maayanlab.cloud/Enrichr/#libraries some shorthands include: pathway, transcription, ontology, diseases_drugs, celltypes, and kinase_interactions
-o, --output <OUTPUT> optional filepath to write output to [default=stdout]
-h, --help Print help information
-V, --version Print version information
```

### Library Shorthands
## Arguments

Some shorthands for the library are built into the program for convenience:
| Name | Short | Long | Description |
|------|-------|------|-------------|
| Library | `-l` | `--library` | a [library shorthand](#library-shorthands) or any [Enrichr library](https://maayanlab.cloud/Enrichr/#libraries) |
| Output | `-o` | `--output` | optional filepath to write output to [default=stdout] |

```text
pathway KEGG_2021_Human
transcription ChEA_2016
ontology GO_Biological_Processes_2021
diseases_drugs GWAS_Catalog_2019
celltypes PangloaDB_Augmented_2021
kinase_interactions KEA_2015
```

## Usage
## Command Line Interface

```bash
# Perform an enrichment analysis using Enrichr
Expand All @@ -46,3 +40,15 @@ ggetrs enrichr enrichr -l ontology AP2S1 NSD1 RFX3
# Perform an enrichment analysis on pathway
ggetrs enrichr enrichr -l pathway AP2S1 NSD1 RFX3
```

## Python

```python
import ggetrs

# Search using the ontology shorthand
ggetrs.enrichr("ontology", ["AP2S1", "RFX3", "NSD1"])

# Search using the kinase_interactions shorthand
ggetrs.enrichr("kinase_interactions", ["AP2S1", "RFX3", "NSD1"])
```
23 changes: 8 additions & 15 deletions docs/src/enrichr/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,14 @@

Lists available libraries and their statistics available on [Enrichr](https://maayanlab.cloud/Enrichr).

## Help

```text
List all available libraries and their descriptions
Usage: ggetrs enrichr list [OPTIONS]
Options:
-m, --minimal Return library names in plaintext
-t, --list-categories List the categorization of libraries
-c, --category <CATEGORY> Filter to a category ID
-o, --output <OUTPUT> optional filepath to write output to [default=stdout]
-h, --help Print help information
-V, --version Print version information
```
## Arguments

| Name | Short | Long | Description |
|------|-------|------|-------------|
| Minimal | `-m` | `--minimal` | Return only library names in results |
| List Categories | `-t` | `--list-categories` | List the categorization of libraries |
| Categories | `-c` | `--category` | Filter libraries with a specified category ID |
| Output | `-o` | `--output` | optional filepath to write output to [default=stdout] |

## Usage

Expand Down
34 changes: 21 additions & 13 deletions docs/src/ensembl/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,14 @@ Prints all available databases on Ensembl's SQL server.

This is used if you are interested in querying a specific database and can be passed into [`ggetrs search`](./search.md).

## Help
## Arguments

```text
Prints all available databases on Ensembl's SQL database
| Name | Short | Long | Description |
|------|-------|------|-------------|
| Filter | `-f` | `--filter` | Provides a substring filter to only return databases which contain the substring |
| Output | `-o` | `--output` | optional filepath to write output to [default=stdout] |

Usage: ggetrs ensembl database [OPTIONS]
Options:
-f, --filter <FILTER> Provides a substring filter to only return databases which contain the substring
-o, --output <OUTPUT> optional filepath to write output to [default=stdout]
-h, --help Print help information
-V, --version Print version information
```

## Usage
## Command Line Interface

```bash
# show all databases in the SQL server
Expand All @@ -30,3 +23,18 @@ ggetrs ensembl database -f sapiens
# filter for databases with the `cerevisiae` substring
ggetrs ensembl database -f cerevisiae
```

## Python

```python
import ggetrs

# show all databases in the SQL server
ggetrs.ensembl.database()

# filter for databases with the `sapiens` substring
ggetrs.ensembl.database("sapiens")

# filter for databases with the `cerevisiae` substring
ggetrs.ensembl.database("cerevisiae")
```
Loading

0 comments on commit 242fa4c

Please sign in to comment.