Skip to content
Open
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
2 changes: 2 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# Manual
* [gget 8cube](en/8cube.md)
* [gget alliance](en/alliance.md)
* [gget alphafold](en/alphafold.md)
* [gget archs4](en/archs4.md)
* [gget bgee](en/bgee.md)
Expand Down Expand Up @@ -53,6 +54,7 @@

# Manuál
* [gget 8cube](es/8cube.md)
* [gget alliance](es/alliance.md)
* [gget alphafold](es/alphafold.md)
* [gget archs4](es/archs4.md)
* [gget bgee](es/bgee.md)
Expand Down
72 changes: 72 additions & 0 deletions docs/src/en/alliance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[<kbd> View page source on GitHub </kbd>](https://github.com/scverse/gget/blob/main/docs/src/en/alliance.md)

> Python arguments are equivalent to long-option arguments (`--arg`), unless otherwise specified. Flags are True/False arguments in Python. The manual for any gget tool can be called from the command-line using the `-h` `--help` flag.
# gget alliance 🧬
Query the [Alliance of Genome Resources](https://www.alliancegenome.org/), which integrates data from the major model organism databases (human, mouse, rat, zebrafish, fly, worm, yeast, and more).
`gget alliance` has two modes, chosen automatically from the input:
- If the input is an Alliance **gene ID** (e.g. `HGNC:1101`, `MGI:109337`, `RGD:2219`, `ZFIN:...`, `FB:...`, `WB:...`, `SGD:...`), the gene's details are returned.
- Otherwise, the input is used as a **free-text search** and the matching objects of the given `--category` are returned.

Return format: JSON (command-line) or data frame/CSV (Python).

**Positional argument**
`search_term`
Alliance gene ID (e.g. `HGNC:1101`) or a free-text search term.

**Optional arguments**
`-c` `--category`
Category for free-text searches: one of `gene`, `allele`, `disease`, `go`, `variant`, `model`, or `all` for no filter. Default: `gene`.

`-l` `--limit`
Maximum number of results for free-text searches. Default: 10.

`-o` `--out`
Path to the file the results will be saved in, e.g. path/to/directory/results.csv (or .json). Default: Standard out.
Python: `save=True` will save the output in the current working directory.

**Flags**
`-csv` `--csv`
Command-line only. Returns results in CSV format.
Python: Use `json=True` to return output in JSON format.

`-q` `--quiet`
Command-line only. Prevents progress information from being displayed.
Python: Use `verbose=False` to prevent progress information from being displayed.

### Examples
**Search for genes across model organisms:**
```bash
gget alliance brca2
```
```python
# Python
gget.alliance("brca2")
```
&rarr; Returns a table of genes matching the search term across Alliance member databases.

| id | symbol | name | species | category | so_term_name |
| --- | --- | --- | --- | --- | --- |
| HGNC:1101 | BRCA2 | BRCA2 DNA repair associated | Homo sapiens | gene_search_result | protein_coding_gene |
| MGI:109337 | Brca2 | breast cancer 2 | Mus musculus | gene_search_result | protein_coding_gene |

<br/><br/>
**Fetch a single gene by its Alliance ID:**
```bash
gget alliance HGNC:1101
```
```python
# Python
gget.alliance("HGNC:1101")
```
&rarr; Returns the gene's details.

| id | symbol | name | species | taxon | gene_type | synonyms | data_provider |
| --- | --- | --- | --- | --- | --- | --- | --- |
| HGNC:1101 | BRCA2 | BRCA2 DNA repair associated | Homo sapiens | NCBITaxon:9606 | protein_coding_gene | ['FAD', ...] | RGD |

# References
If you use `gget alliance` in a publication, please cite the following articles:

- Alliance of Genome Resources Consortium. (2024). Updates to the Alliance of Genome Resources central infrastructure. Genetics. [https://doi.org/10.1093/genetics/iyae049](https://doi.org/10.1093/genetics/iyae049)

- Luebbert, L., & Pachter, L. (2023). Efficient querying of genomic reference databases with gget. Bioinformatics. [https://doi.org/10.1093/bioinformatics/btac836](https://doi.org/10.1093/bioinformatics/btac836)
1 change: 1 addition & 0 deletions docs/src/en/updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#### *gget* officially became part of [*scverse*](https://scverse.org/) on June 9, 2026. 🥳🥳🥳

**Version ≥ 0.30.9** (XXX XX, 2026):
- [`gget alliance`](alliance.md): **New module** to query the [Alliance of Genome Resources](https://www.alliancegenome.org/). Pass an Alliance gene ID (e.g. `HGNC:1101`, `MGI:109337`, `RGD:2219`) to fetch the gene's details, or a free-text term to search genes/alleles/diseases/GO/variants/models across the member model-organism databases (selectable with `category`). Available in the Python API and on the command line.

**Version ≥ 0.30.8** (Jun 28, 2026):
- [`gget g2p`](g2p.md): Either `gene` or `--uniprot_id` is now sufficient — whichever is missing is resolved via UniProt and cached. Gene→UniProt picks the canonical reviewed human Swiss-Prot entry; the resolution and its limitations are logged. The canonical pair is **always** prepended to the result as `gene_name` / `uniprot_id` columns (and stored on `df.attrs`), so the output schema is invariant regardless of input mode. Existing call sites continue to work.
Expand Down
72 changes: 72 additions & 0 deletions docs/src/es/alliance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[<kbd> Ver el codigo fuente de la pagina en GitHub </kbd>](https://github.com/scverse/gget/blob/main/docs/src/es/alliance.md)

> Parámetros de Python són iguales a los parámetros largos (`--parámetro`) de Terminal, si no especificado de otra manera. Banderas son parámetros de verdadero o falso (True/False) en Python. El manuál para cualquier modulo de gget se puede llamar desde la Terminal con la bandera `-h` `--help`.
# gget alliance 🧬
Consulte la [Alliance of Genome Resources](https://www.alliancegenome.org/), que integra datos de las principales bases de datos de organismos modelo (humano, ratón, rata, pez cebra, mosca, gusano, levadura, y más).
`gget alliance` tiene dos modos, elegidos automáticamente según la entrada:
- Si la entrada es un **identificador de gen** de Alliance (p. ej. `HGNC:1101`, `MGI:109337`, `RGD:2219`, `ZFIN:...`, `FB:...`, `WB:...`, `SGD:...`), se devuelven los detalles del gen.
- De lo contrario, la entrada se usa como una **búsqueda de texto libre** y se devuelven los objetos coincidentes de la `--category` indicada.

Regresa: Resultados en formato JSON (Terminal) o Dataframe/CSV (Python).

**Parámetro posicional**
`search_term`
Identificador de gen de Alliance (p. ej. `HGNC:1101`) o un término de búsqueda de texto libre.

**Parámetros opcionales**
`-c` `--category`
Categoría para las búsquedas de texto libre: una de `gene`, `allele`, `disease`, `go`, `variant`, `model`, o `all` para no filtrar. Por defecto: `gene`.

`-l` `--limit`
Número máximo de resultados para las búsquedas de texto libre. Por defecto: 10.

`-o` `--out`
Ruta al archivo en el que se guardarán los resultados, p. ej. path/to/directory/results.csv (o .json). Por defecto: salida estándar.
Python: `save=True` guardará los resultados en el directorio de trabajo actual.

**Banderas**
`-csv` `--csv`
Solo Terminal. Devuelve los resultados en formato CSV.
Python: Use `json=True` para devolver los resultados en formato JSON.

`-q` `--quiet`
Solo Terminal. Impide que se muestre la información de progreso.
Python: Use `verbose=False` para impedir que se muestre la información de progreso.

### Ejemplos
**Buscar genes en distintos organismos modelo:**
```bash
gget alliance brca2
```
```python
# Python
gget.alliance("brca2")
```
&rarr; Devuelve una tabla de genes que coinciden con el término de búsqueda en las bases de datos miembro de Alliance.

| id | symbol | name | species | category | so_term_name |
| --- | --- | --- | --- | --- | --- |
| HGNC:1101 | BRCA2 | BRCA2 DNA repair associated | Homo sapiens | gene_search_result | protein_coding_gene |
| MGI:109337 | Brca2 | breast cancer 2 | Mus musculus | gene_search_result | protein_coding_gene |

<br/><br/>
**Obtener un solo gen por su identificador de Alliance:**
```bash
gget alliance HGNC:1101
```
```python
# Python
gget.alliance("HGNC:1101")
```
&rarr; Devuelve los detalles del gen.

| id | symbol | name | species | taxon | gene_type | synonyms | data_provider |
| --- | --- | --- | --- | --- | --- | --- | --- |
| HGNC:1101 | BRCA2 | BRCA2 DNA repair associated | Homo sapiens | NCBITaxon:9606 | protein_coding_gene | ['FAD', ...] | RGD |

# Referencias
Si utiliza `gget alliance` en una publicación, por favor cite los siguientes artículos:

- Alliance of Genome Resources Consortium. (2024). Updates to the Alliance of Genome Resources central infrastructure. Genetics. [https://doi.org/10.1093/genetics/iyae049](https://doi.org/10.1093/genetics/iyae049)

- Luebbert, L., & Pachter, L. (2023). Efficient querying of genomic reference databases with gget. Bioinformatics. [https://doi.org/10.1093/bioinformatics/btac836](https://doi.org/10.1093/bioinformatics/btac836)
1 change: 1 addition & 0 deletions gget/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from importlib.metadata import PackageNotFoundError, version

from .gget_8cube import gene_expression, psi_block, specificity
from .gget_alliance import alliance
from .gget_alphafold import alphafold
from .gget_archs4 import archs4
from .gget_bgee import bgee
Expand Down
3 changes: 3 additions & 0 deletions gget/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# strategy avoid hanging indefinitely on slow upstreams.
DEFAULT_REQUESTS_TIMEOUT = (10, 60)

# Alliance of Genome Resources REST API for gget alliance
ALLIANCE_URL = "https://www.alliancegenome.org/api"

# Ensembl REST API server for gget seq and info
ENSEMBL_REST_API = "http://rest.ensembl.org/"
ENSEMBL_FTP_URL = "http://ftp.ensembl.org/pub/"
Expand Down
Loading
Loading