Skip to content

Commit f2eccc5

Browse files
lauraluebbertgithub-actions[bot]Elarwei001claudepre-commit-ci[bot]
authored
Dev -> main (#260)
* Bump dev version * Add space for new udpates * CI: update pytest results (dev) * feat(pdb): support PDBx/mmCIF format with automatic fallback (#178, #177) (#222) * feat(pdb): support PDBx/mmCIF format and auto-fallback (#178, #177) The legacy PDB format is being phased out by RCSB and is unavailable for large structures (e.g. 6Q38, 7A01), causing `gget pdb` to fail with "not found" — the bug reported in #177. - Add `resource="mmcif"` to download the structure in PDBx/mmCIF (.cif). - `resource="pdb"` (default) now automatically falls back to PDBx/mmCIF when the legacy PDB file is unavailable, logging a warning. Saved files use the correct extension (.cif vs .pdb) based on the format fetched. - Backward compatible: existing commands that already worked are unchanged. - Tests: explicit mmcif download + legacy->mmcif fallback regression (6Q38). - Docs + updates.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: ruff lint errors flagged by pre-commit.ci - gget_g2p.py: collapse the multi-line docstring summary into a single line + blank line (ruff D205). - main.py: add the missing # noqa: E402 to the 6 new import lines (g2p, ref, search, seq, setup, virus). All earlier imports already carry this noqa because dt_string is computed at module top before the import block, so E402 fires on any unmarked later import. Also drops the stray "# Module functions" comment that was splitting one alphabetical import list into two. --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Laura Luebbert <laura.lbt60@gmail.com> * feat(bgee): identify gget in outbound Bgee API requests (#224) Send `User-Agent: gget/<version> (+https://github.com/scverse/gget)` on all Bgee API calls so the upstream service can attribute traffic to gget and reach the project if needed. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> * CI: update pytest results (dev) * CI: update pytest results (dev) * feat(types): pay down mypy errors (var-annotated + json overloads) (#225) * feat(types): pay down 67 mypy errors (var-annotated + json overloads) mypy baseline: 613 → 546 (−67, ~11%). No behavior changes — every edit is annotation-only and verified with python -m py_compile + `import gget` smoke test + `pytest --collect-only` (400 tests, 0 collection errors). Resolves part of #216. Two passes: 1. var-annotated quick wins (−21 errors, → 0 remaining) - Added explicit type annotations to 13 empty container literals across utils.py, gget_ref.py, gget_info.py, gget_blat.py, gget_muscle.py, gget_virus.py. Inferred element type from surrounding code (list[str], dict[str, Any], etc.) — fell back to Any only when the type was genuinely dynamic. 2. typing.overload for the json= flag pattern (−~20 union-attr, plus ~26 other category errors that depended on the narrowed return type) - Added @typing.overload signatures for the 12 modules with `def f(..., json: bool = False, ...) -> DataFrame | dict`: gget_8cube, gget_archs4, gget_bgee, gget_blast, gget_blat, gget_cosmic, gget_diamond, gget_elm, gget_enrichr, gget_info, gget_opentargets, gget_search. - Now `f(...)` returns DataFrame and `f(..., json=True)` returns dict at the type-check level. Implementation signature unchanged. Why only 67 and not the predicted ~150: - Most remaining [union-attr] errors come from BeautifulSoup (`Tag | None` from `.find()`) and `str | None` checks, not the json= flag pattern. Those need per-callsite None-guards, which is the next batch. Remaining categories (sorted, top 6): [index] ~157 (pandas df["col"] indexing — needs cast() or # type: ignore) [union-attr] 115 (BeautifulSoup / str|None — needs None-guards) [attr-defined] 68 (dynamic JSON response shapes) [call-overload] 58 (pandas/numpy stubs) [assignment] ~56 [arg-type] ~53 * fix(bgee): restore Literal + overload imports lost in dev merge The merge of dev into feat/mypy-cleanup (925f66d) collided on gget_bgee.py's typing import line. Git auto-resolved by taking dev's version (`from typing import TYPE_CHECKING, Any` — added by the bgee user-agent PR #224) and silently dropped the `Literal, overload` additions from this branch, while keeping the @overload decorators at lines 183/192 that use them. Result: module-load NameError that broke test collection for every test file that imports gget. Restore the full import: TYPE_CHECKING, Any, Literal, overload. * ci: re-trigger pre-commit.ci * fix(pre-commit): exclude .github/badges/*.json from formatting The badge JSON is regenerated by ci.yml's "Generate tests badge JSON" step using json.dumps() with no `indent` parameter — single-line compact output. biome's default JSON formatter wants multi-line tab- indented output. So every CI run writes the compact form, and every pre-commit.ci run reformats it back, and we get a permanent biome-format failure that never resolves. Same fix as the tests/pytest_results.txt entry: just exclude the auto-generated file from formatting hooks. * CI: update pytest results (dev) * CI: update pytest results (dev) * fix(types): allow tuple request timeouts in http_json (#253) * fix(types): annotate pdb URL fallback list (#255) * CI: update pytest results (dev) * fix(ci): repair archs4 + ELM live-data test failures (#252) * fix(opentargets): give drug synonyms a GraphQL sub-selection (HTTP 400 fix) OpenTargets changed the Drug 'synonyms' and 'tradeNames' fields from [String!]! to the object type [DrugLabelAndSource!]!, which now requires a sub-selection. The bare-scalar selection caused every drug query to fail with HTTP 400. Request '{ label }' for both fields and flatten the response objects back to a list of label strings so downstream output stays backward-compatible (a list of strings). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(archs4): tolerate missing 'color' column in tissue expression (#dev-drift) ARCHS4's tissue-expression CSV intermittently omits the 'color' column, which made `gget archs4 --which tissue` crash with `KeyError: "['color'] not found in axis"`. The 'color' column is only used for plotting upstream and is dropped (never used) by gget, so a missing column should not be fatal. Use `drop(columns=["color"], errors="ignore")` so the request degrades gracefully when the column is absent. Adds network-free regression tests covering both the present-color and missing-color responses. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(opentargets): use baselineExpression for the expression resource OpenTargets retired the `target.expressions` field (it now returns an empty list for every gene), so `gget opentargets -r expression` returned nothing. Baseline expression data moved to the paginated `target.baselineExpression` field with a new per-biosample data model. - Repoint the expression query to `baselineExpression(page:{index:0,size:250}) { rows {...} }` and update rows_path to ["baselineExpression","rows"]. - Output columns change accordingly (per-biosample summary stats: median/min/ q1/q3/max/unit + tissueBiosample/celltypeBiosample ids + datasource/datatype), because the upstream data model changed and the old shape no longer exists. - Remove the two now-invalid live exact-match fixtures and replace them with network-free mocked tests; update docs (example, resource table, updates.md). Verified live: http_json with the new query returns 1409 rows in ~0.6s and the parsing pipeline yields the documented columns. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * test(opentargets): loosen live-data assertions to structural/invariant (data drifts across releases) OpenTargets is a live database re-released regularly; several opentargets tests pinned exact current values (disease ids/scores, result hashes, interaction partner ids, genotypes) that legitimately change every release, so they failed on unrelated PRs even though gget returns correct current data. Replace the exact-value/hash assertions for test_opentargets, _diseases, _depmap, _depmap_filter, _interactions, _interactions_no_limit and _pharmacogenetics with structural/invariant assertions (expected columns present, numeric dtypes, value-format patterns — ontology-curie disease/tissue ids, ENSG interaction partners, ACH DepMap ids, score in [0,1], nucleotide genotypes — and the depmap filter invariant). The fixture entries are marked `code_defined`; the structural methods live in tests/test_opentargets.py. These stay meaningful (they break on wrong columns, malformed ids, non-numeric scores, broken filtering, or empty-where-guaranteed) without pinning drifting data. Verified live against current OpenTargets data. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * test: assert live-data contracts for CI repair * test: retry ELM live setup downloads * test: keep OpenTargets expression semantics out of CI repair * test(opentargets): add semantic anchors + score tolerance to live-data tests (#249) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * test(opentargets): rewrite live-data tests as explicit IL13 assertions (#249) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * test(opentargets): read gene from fixture + guard to IL13; drop duplicate test_opentargets (#249) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * test(archs4): rewrite live tissue tests as concrete fixture-driven checks (#249) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(archs4): deterministic tissue sort via id tiebreaker; restore exact-snapshot tests (#249) Sort tissue rows by [median desc, id asc] so output is reproducible when medians tie (ARCHS4 returns tied rows in varying order). Revert the live tissue tests to exact assert_equal snapshots (re-sorted to the deterministic order); keep the network-free color regression tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Drop opentargets fixes from this PR (now covered by #256) Strip back the opentargets-related changes so this PR is focused on the archs4 + ELM CI-stability fixes only. The opentargets work (synonyms HTTP 400 fix, fixture refresh, expression skip) is being handled in a separate PR (#256), per maintainer preference for one-module-per-PR review. Reverted to origin/dev: - gget/gget_opentargets.py - tests/test_opentargets.py - tests/fixtures/test_opentargets.json Trimmed updates.md: - Removed the opentargets bullet (lives in #256) - Added an archs4 bullet explaining the color-column + deterministic- sort fix (user-visible behavior change, was missing here) Remaining scope: - gget_archs4.py: graceful handling of missing color column, deterministic median-then-id sort - tests/test_archs4.py: TestArchs4MissingColor regression test - tests/fixtures/test_archs4.json: refreshed for the deterministic sort - tests/test_elm.py: retry ELM setup on transient download failure Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * test(archs4): drop the redundant with-color companion test test_tissue_with_color_still_dropped tested the "happy path" that both the old and the new code already handle the same way (column present → column dropped from output). It can't catch any plausible regression of the actual fix (which is the errors="ignore" kwarg, exercised by the sibling test_tissue_missing_color_does_not_crash). Removing it tightens the test suite without weakening the regression guard around the actual bug. _CSV_WITH_COLOR class attribute removed along with it (no other references). --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Laura Luebbert <laura.lbt60@gmail.com> * fix(opentargets): adapt to upstream API drift + skip deprecated expressions field (#256) * fix(opentargets): adapt to upstream API drift + skip deprecated expressions field 11 opentargets tests were failing across all Python versions due to three distinct upstream changes: 1. GraphQL schema change (real bug) The Drug type's `synonyms` and `tradeNames` fields are now `[DrugLabelAndSource!]!` (was scalar list[str]). Querying without a sub-selection returns HTTP 400. Updated QUERY_STRING_DRUGS to query `synonyms { label }` and `tradeNames { label }`. The existing _collapse_singletons() post-processor flattens each {label: "X"} back to "X" automatically, so the public DataFrame shape is preserved. 2. Data drift (8 tests, fixtures refreshed) Open Targets re-indexed disease ontology IDs (EFO → MONDO), gene protein IDs, allele frequencies, depmap entries, and interaction data. Per the project convention (refresh fixtures, don't normalize) the expected_result blocks for test_opentargets, *_diseases, *_drugs, *_interactions, *_pharmacogenetics, *_depmap, *_depmap_filter, and *_interactions_no_limit were re-captured from the current upstream output via a one-shot helper script. 3. expressions field deprecated (2 tests, skipped) The Target.expressions field now returns [] for all queries; Open Targets replaced it with Target.baselineExpression which has a completely different schema (tissueBiosample, q1/q3/median/min/max instead of tissue/rna sub-objects). Migrating gget_opentargets to the new field is a user-facing API change and out of scope for this PR; the two affected tests are now marked as skipped with a reason field. Also adds a `skip` test type to tests/from_json.py so JSON-defined tests can be marked as known-skipped (with a reason message) without needing a separate Python test file or fixture deletion. Verified locally: 15 passed, 2 skipped, 0 failed. * docs: add 0.30.8 entries for opentargets fixes - Drugs resource: HTTP 400 fix (synonyms/tradeNames sub-selection). Surfaces both the upstream cause and reassures users that the DataFrame column shape is unchanged. - Expression resource: known limitation pointing at the baselineExpression migration as the next step. Flags that the tests for this path are skipped in the meantime. * opentargets(expression): warn user about upstream deprecation Without this, gget opentargets resource="expression" silently returns an empty DataFrame, which looks identical to "your gene has no expression data" and gives the user no signal that the upstream field is actually retired. Now emits a logger.warning naming the deprecated field, the planned baselineExpression replacement, and the tracking issue (#247) so users can subscribe / contribute. Updated the 0.30.8 entry in updates.md to mention the warning. * docs(contributing): add PR-scope and upstream-flake guidance (#257) * docs(contributing): add PR-scope and upstream-flake guidance Two new subsections under "Contribute through pull requests": - "Keep PRs small and focused" — explicitly states the one-module-per-PR preference. Codifies what's been a verbal/case-by-case practice into written guidance so contributors don't ship multi-module PRs and then have to re-split them on reviewer request. - "Failing tests for modules you didn't touch" — explains that gget's test suite hits real upstream databases and those services drift, so a CI red in a module your PR doesn't touch is almost certainly not your bug and shouldn't block you. Avoids the common new-contributor trap of assuming they have to fix unrelated failures to merge. CONTRIBUTING.md is the single source of truth (docs/src/en/contributing.md is an mdbook include of this file), so the gget docs site picks up the change automatically. The Spanish translation will follow on the next auto-translate workflow run after this merges. * Revise CONTRIBUTING.md for clarity and completeness Updated self-review checklist for PRs to include biological relevance and clarified testing instructions. Adjusted language for consistency and improved clarity. * Update CONTRIBUTING.md * CI: update pytest results (dev) * feat(alphafold): add custom jackhmmer save directory option (#49) (#234) * feat(alphafold): add custom jackhmmer save directory option (#49) Add a jackhmmer_savedir parameter (Python) / -jhd, --jackhmmer_savedir flag (CLI) to gget alphafold so users can choose where the temporary jackhmmer files (~2 GB) are stored instead of the hardcoded ~/tmp/jackhmmer/ folder in the home directory. The new get_jackhmmer_dir() helper centralizes the path resolution and clean_up() now operates on the resolved directory. Default behavior is unchanged (backward compatible). Resolves #49. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * test(alphafold): cover clean_up default dir (#49) Add a network-free test for the clean_up(None) default-directory branch: it patches get_jackhmmer_dir so the None default resolves to a temporary folder (never the real ~/tmp) and asserts clean_up() resolves and removes it. Covers the previously-uncovered default-resolution line. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Update CONTRIBUTING.md * CI: update pytest results (dev) * feat(g2p): make g2p useful for variant-interpretation workflows + bug fixes (#258) * fix(g2p): make gene optional, fix silent failure on JSON error bodies - gene is now optional and resolved from uniprot_id via the UniProt REST entry endpoint (cached with lru_cache). A UniProt accession alone is sufficient identification; the old API required both. - Fix silent failure where G2P returns HTTP 200 with a JSON {"status":"failure",...} body on unknown gene/UniProt pairs. The response was being parsed as a single TSV column header and a 0-row DataFrame returned with no error. Now detected, logged, and returns None. - All failure modes return None (previously a mix of None and empty DataFrame). - Retry transient failures (5xx, connection errors, timeouts) with exponential backoff. - URL-encode gene/uniprot_id/isoform path segments. - New `out=` Python argument to write to an explicit CSV path (takes precedence over `save`). - Docs: list g2p in SUMMARY.md (was hidden from the published site); advertise PFES, MaveDB, pocket and interaction columns; note that variant overlays (gnomAD/ClinVar/HGMD) are portal-only. Backward-compatible: existing CLI (`gget g2p BRCA1 -u P38398`) and Python (`gget.g2p("BRCA1", uniprot_id="P38398")`) call sites continue to work unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * feat(g2p): residues filter, symmetric resolution, parsed PDB list - Symmetric resolution: `--uniprot_id` is now optional too, resolved from `gene` via UniProt (canonical reviewed human Swiss-Prot entry) when omitted. Limitations are spelled out in a prominent log message (synonyms, paralogues, non-human, unreviewed, isoforms — pass uniprot_id to override). The resolved pair travels with the data both as df.attrs["gene"]/["uniprot_id"] and as leading `Resolved Gene` / `Resolved UniProt` columns whenever resolution happened — so CSV/JSON saved files also record what was queried. - `residues=` argument filters `features`/`alignment` results to specific positions (int / list / tuple / range / set in Python; comma-separated list and/or inclusive ranges on the CLI: `--residues 100-200,300,400`). - `map` results gain a parsed `PDB Ids List` column (list[str]) alongside the comma-joined `PDB Ids` string, ready to feed into `gget pdb`. - `alignment` now requires `uniprot_id` explicitly (gene→UniProt returns the base accession and cannot disambiguate isoforms). Backward-compatible. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update g2p.md * refactor(g2p): invariant schema with gene_name/uniprot_id columns The previous behavior added "Resolved Gene" / "Resolved UniProt" columns only when one of the identifiers was looked up. That meant the output schema differed depending on input mode, which is awkward for downstream code that should not care whether the caller supplied gene, uniprot_id, or both. Now the canonical pair is *always* prepended as `gene_name` and `uniprot_id` columns, populated with whichever values were used for the query. The same keys are also set on `df.attrs`. Output schema is now identical across all three input modes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Update g2p.md --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(opentargets): repoint expression to baselineExpression (upstream retired target.expressions) (#248) * fix(opentargets): use baselineExpression for the expression resource OpenTargets retired the `target.expressions` field (it now returns an empty list for every gene), so `gget opentargets -r expression` returned nothing. Baseline expression data moved to the paginated `target.baselineExpression` field with a new per-biosample data model. - Repoint the expression query to `baselineExpression(page:{index:0,size:250}) { rows {...} }` and update rows_path to ["baselineExpression","rows"]. - Output columns change accordingly (per-biosample summary stats: median/min/ q1/q3/max/unit + tissueBiosample/celltypeBiosample ids + datasource/datatype), because the upstream data model changed and the old shape no longer exists. - Remove the two now-invalid live exact-match fixtures and replace them with network-free mocked tests; update docs (example, resource table, updates.md). Verified live: http_json with the new query returns 1409 rows in ~0.6s and the parsing pipeline yields the documented columns. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(opentargets): drive expression page size by limit; warn on truncation Review follow-up to the baselineExpression migration. Two issues: 1. Silent truncation. The query hard-capped at size:250, but a gene can have far more biosamples (IL13 has 1409: 51 GTEx + 1343 Tabula Sapiens + 15 DICE). Users got 250 of 1409 with no signal, and an explicit limit>250 was also silently capped (limit was only applied post-hoc via df.head). Now the page size is a GraphQL variable driven by limit: min(limit, 3000) when limit is set, else 3000 (the API max). IL13 with no limit now returns all 1409 rows. If a gene exceeds the 3000-per-page API max and no limit is set, a warning is logged pointing the user to --filters. 2. Stale docstring. The Python docstring still described the old model ("by tissues, organs, and anatomical systems"); updated to the per-biosample summary-statistics model. Docs note updated to drop the "up to 250" wording. Verified live: no limit -> 1409 rows; limit=5 -> 5; datasourceId=gtex filter -> 51. Mocked tests pass, ruff clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(opentargets): add prominent top-of-page note for expression output change resource="expression" returns a different output shape as of v0.30.8 (baselineExpression per-biosample summary stats, replacing the retired per-tissue z-score columns). This is a meaningful breaking change for anyone parsing the expression output, so surface it at the top of the module docs rather than only in the example section. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Laura Luebbert <laura.lbt60@gmail.com> * CI: update pytest results (dev) * docs(opentargets): correct all example tables/filters + clarify diseases score & IDs (#240) * docs(opentargets): clarify diseases score meaning and EFO/MONDO IDs (#168) Clarify in the documentation that the `diseases` resource `score` is OpenTargets' single overall target–disease association score (0–1) aggregated across all data types/sources (not a per-data-source score), and that the returned `disease.id` values are EFO-mapped traits that include not only MONDO diseases but also HP phenotypes and EFO measurements (e.g. "blood protein measurement"). gget returns the associations exactly as OpenTargets reports them; documented how to filter to MONDO terms only. Also updated the diseases example table to the current post-rewrite column names. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs(opentargets): replace stale EFO example with generic phrasing The diseases-score note cited `EFO_0007937` "blood protein measurement" as an example of an EFO measurement trait surfacing as a "disease". That ID is stale — copied verbatim from the 2024-era issue #168 (gget 0.29.0). Against the current Open Targets API: - EFO_0007937 no longer resolves (direct lookup + search both empty) - "blood protein measurement" is no longer a standalone term (closest current ID is EFO_0004536 "total blood protein measurement") - it no longer appears in LILRA4's associations Rather than swap in another exact ID that will rot the same way, replace it with generic phrasing ("biomarker or blood-measurement traits"). The conceptual point — EFO measurement traits appear among the results — is verified correct: LILRA4 currently returns a mix of MONDO/HP/EFO/Orphanet IDs. The rest of the note (overall-score semantics, the MONDO_0004980 atopic-eczema example, the MONDO filter recipe) was fact-checked against the live API and is accurate. * docs(opentargets): correct all example tables to actual 0.30.5+ output Verified every resource example against live API output. Only the `diseases` table (fixed earlier in this PR) was correct; the other six example tables and the resource "Valid Filters" column still showed pre-0.30.5 column names that no longer exist, so anyone copying them (especially into --filter) would get wrong results or a "Filter key not found" ValueError. Corrected against real output for ENSG00000169194 (IL13): - drugs: id/name/type/... -> drug.id/drug.name/drug.drugType/ drug.mechanismsOfAction.rows/.../drug.indications.rows - tractability: label/modality -> modality/label/value (value was missing) - pharmacogenetics: rs_id/genotype_id/... -> variantId/genotypeId/.../ variantFunctionalConsequence.id/.label - expression: reordered to actual column order, added celltypeBiosample.* columns + a single-cell example row - depmap: depmap_id/effect/tissue_id/... -> tissueId/tissueName/ cellLineName/expression/diseaseFromSource/depmapId/geneEffect - interactions: evidence_score/source_db/protein_a_id/... -> score/ sourceDatabase/intA/.../targetB.approvedSymbol (taxonId is 134, not 9606) Replaced the two interactions filter examples, which documented a removed API (filter_mode/OR and -fpa/--filter_gene_b shortcuts removed in 0.30.5; protein_a_id/gene_b_id keys are not real columns), with one working example using the generic --filter key=value on real column names. Updated the resource table's "Valid Filters" column accordingly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Laura Luebbert <laura.lbt60@gmail.com> * docs(updates): add missing 0.30.8 entries (bgee User-Agent; expression truncation) Comprehensiveness pass on the 0.30.8 changelog: - Added the gget bgee User-Agent change (#224), which was merged but undocumented. - Expanded the opentargets expression entry to note the limit-driven page size, the 3000-row API cap, and the truncation warning (#248 follow-up). Verified all other 0.30.8 entries against merged PRs and confirmed the 0.30.7 vs 0.30.8 split matches the v0.30.7 tag contents. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * CI: update pytest results (dev) * ci(mypy): adopt mypy-baseline so pre-commit only fails on new type errors The mypy hook had ~553 pre-existing errors and exited non-zero, so it failed on every PR (pre-commit.ci runs --all-files, so per-file diffing doesn't help). Switch to mypy-baseline: - .mypy-baseline.txt grandfathers the existing errors (line numbers normalized to 0 so they survive line shifts). - The pre-commit hook now runs `mypy gget | mypy-baseline filter`, which fails only on NEW errors not in the baseline. Verified: a clean tree passes; a freshly introduced type error fails. - Works on pre-commit.ci because the baseline filters by error identity, not by file. - Added mypy-baseline to the test dependency group; excluded the generated baseline file from the hygiene hooks. Refresh the baseline after fixing errors with: mypy gget | mypy-baseline sync Tracked in #216. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * CI: update pytest results (dev) * docs(contributing): note what runs automatically on PRs Brief section so contributors know pre-commit.ci (ruff/biome/hygiene + mypy), the test matrix, and the build check run automatically — and that pre-commit.ci auto-fixes formatting and mypy only flags new errors (existing baseline grandfathered). Pairs with the existing upstream-flake note. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Update CONTRIBUTING.md * docs(archs4): clarify legacy endpoint vs archs4.org data source (#254) (#259) * docs(archs4): document legacy endpoint + archs4.org data-source situation Addresses #254. gget archs4 uses the legacy maayanlab.cloud HTTP endpoints, which are lightweight and still maintained. The newer archs4.org dataset has no equivalent lightweight HTTP API — programmatic access there is only via archs4py + multi-GB HDF5 downloads, which doesn't fit gget's lightweight-query design. Documented this so users know where the data comes from, how it differs from archs4.org, and how to get the newer data (archs4py) if they need it. Migration remains tracked in #254. Docs-only; no code change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Update updates.md * Update archs4.md * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * CI: update pytest results (dev) * fix(ci): clear dev-wide pre-commit failures (ruff D205 + pin mypy stubs) Two pre-commit.ci failures were hitting every PR (it runs --all-files), unrelated to the PRs themselves: 1. ruff D205 in gget_g2p.py — the g2p() docstring summary spanned two lines with no blank line before the body. Collapsed to a single-line summary. (#258 reintroduced this; ruff now passes on all of gget/.) 2. mypy exit 4 on pre-commit.ci while passing locally — the mypy hook's stub dependencies (pandas-stubs, types-*) and mypy-baseline were unpinned, so pre-commit.ci installed newer stubs that inferred different types and surfaced "new" errors absent from the baseline. Pinned all type-affecting deps (mypy 1.13.0, mypy-baseline 0.7.4, and the four stub packages) in both the pre-commit hook and the test dependency group so the baseline is reproducible. Verified the pinned set reproduces exactly the 553 baselined errors (0 new) in a fresh hook env. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Elarwei <168552401+Elarwei001@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Qiaoli Li <67373873+Qiaoli-Li-Res@users.noreply.github.com>
1 parent f057d12 commit f2eccc5

42 files changed

Lines changed: 2872 additions & 1997 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/badges/tests.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"schemaVersion": 1, "label": "tests", "message": "386/400 passing", "color": "yellow"}
1+
{"schemaVersion": 1, "label": "tests", "message": "419/422 passing", "color": "brightgreen"}

.mypy-baseline.txt

Lines changed: 725 additions & 0 deletions
Large diffs are not rendered by default.

.pre-commit-config.yaml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ exclude: |
2626
| gget/constants/
2727
| tests/fixtures/
2828
| tests/pytest_results.*\.txt
29+
| \.github/badges/.*\.json
30+
| \.mypy-baseline\.txt
2931
)
3032
repos:
3133
- repo: https://github.com/biomejs/pre-commit
@@ -44,16 +46,32 @@ repos:
4446
args: [--fix, --exit-non-zero-on-fix]
4547
- id: ruff-format
4648
types_or: [python, pyi, jupyter]
47-
- repo: https://github.com/pre-commit/mirrors-mypy
48-
rev: v1.13.0
49+
# mypy is run through mypy-baseline: the ~550 pre-existing type errors are
50+
# grandfathered in .mypy-baseline.txt, so this hook only fails on NEW type
51+
# errors introduced by a change. Works on pre-commit.ci (which runs
52+
# --all-files) because the baseline filters by error identity, not by file.
53+
# To refresh the baseline after fixing errors:
54+
# mypy gget | mypy-baseline sync
55+
# See https://github.com/scverse/gget/issues/216
56+
- repo: local
4957
hooks:
50-
- id: mypy
51-
files: ^gget/
58+
- id: mypy-baseline
59+
name: mypy (new errors only, baseline-filtered)
60+
entry: bash -c 'mypy gget | mypy-baseline filter'
61+
language: python
62+
pass_filenames: false
63+
always_run: true
64+
# Pin everything that affects mypy's output so the baseline stays
65+
# reproducible across machines and pre-commit.ci (unpinned stubs drift
66+
# and surface "new" errors that aren't real). Bump deliberately and
67+
# re-sync the baseline when you do.
5268
additional_dependencies:
53-
- pandas-stubs
54-
- types-requests
55-
- types-tqdm
56-
- types-beautifulsoup4
69+
- mypy==1.13.0
70+
- mypy-baseline==0.7.4
71+
- pandas-stubs==3.0.3.260530
72+
- types-requests==2.33.0.20260518
73+
- types-tqdm==4.68.0.20260608
74+
- types-beautifulsoup4==4.12.0.20250516
5775
- repo: https://github.com/pre-commit/pre-commit-hooks
5876
rev: v6.0.0
5977
hooks:

CONTRIBUTING.md

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,37 +38,60 @@ Commit the changes once you are happy with them.
3838

3939
### ‼️ Self-review the following before creating a Pull Request ‼️
4040

41-
1. Review the content for technical accuracy.
41+
1. Review the content for technical accuracy and biological relevance (who are your target users and is this useful to them?).
4242
2. Copy-edit the changes/comments for grammar, spelling, and adherence to the general style of existing gget code.
43-
3. Format and lint your code with [pre-commit](https://pre-commit.com/) (powered by [ruff](https://docs.astral.sh/ruff/)). Install the hooks once with `prek install` (or `pre-commit install`) so they run automatically on every commit, or run them on demand with `prek run --all-files` (or `pre-commit run --all-files`).
44-
4. Make sure the unit tests pass:
45-
- The tested environments are defined in `pyproject.toml` under `[tool.hatch.envs.hatch-test]` (the single source of truth used by CI). Run the full matrix with `uvx hatch test`.
46-
- For a quick single-environment run, install the test dependencies with `uv sync --group test` and run `uv run pytest -ra -v --cov=gget --cov-report=term-missing tests`. To also exercise the `gget cellxgene` module, install its extra (`uv sync --group test --extra cellxgene`) on Python 3.12/3.13 — its dependency has no wheels for newer Python versions yet, and that test skips itself when the dependency is absent.
47-
5. Add new unit tests if applicable:
48-
- Arguments and expected results are stored in json files in ./tests/fixtures/
49-
- Unit tests can be added to ./tests/test_*.py and will be automatically detected
50-
6. Make sure the edits are compatible with both the Python and the command line interface
43+
3. **Command line interface:** Make sure edits keep the Python function and the command-line interface in sync. Any change to a function's arguments must be reflected in both the Python signature and the CLI argument parser.
5144
- The command line interface and arguments are defined in ./gget/main.py
52-
8. Add new modules/arguments to the documentation if applicable:
45+
4. **Documentation:** Add new modules/arguments to the documentation if applicable:
5346
- The manual for each module can be added/edited in `./docs/src/en/*.md` (the Spanish version of the docs in `./docs/src/es/*.md` is automatically generated/updated, and does not need to be edited manually)
54-
- List all edits in `./docs/src/en/updates.md`
47+
- **Document all edits in `./docs/src/en/updates.md`.** Keep this brief and succinct.
48+
5. **Add unit tests:** Add new unit tests if applicable:
49+
- Arguments and expected results are stored in json files in ./tests/fixtures/
50+
- Unit tests can be added to ./tests/test_*.py and will be automatically detected
51+
6. **Run unit tests:** Make sure the unit tests pass:
52+
- The tested environments are defined in `pyproject.toml` under `[tool.hatch.envs.hatch-test]` (the single source of truth used by CI). Run the full matrix with `uvx hatch test`.
53+
- For a quick single-environment run, install the test dependencies with `uv sync --group test` and run `uv run pytest -ra -v --cov=gget --cov-report=term-missing tests`. To also exercise the `gget cellxgene` module, install its extra (`uv sync --group test --extra cellxgene`) on Python 3.12/3.13 — its dependency has no wheels for newer Python versions yet, and that test skips itself when the dependency is absent.
5554

5655
If you have any questions, feel free to start a [discussion](https://github.com/scverse/gget/discussions) or create an issue as described above.
5756

57+
### Keep PRs small and focused
58+
59+
Reviewers move faster on small, focused PRs. Whenever possible:
60+
61+
- **Scope each PR to a single `gget` module or issue**. If you find yourself changing more than one module to address several distinct concerns, please open them as separate PRs — one per module. Bug fixes and small refactors inside one module can be combined; cross-module work should be split.
62+
- **Don't bundle unrelated changes** (e.g. a bug fix plus a new feature plus a refactor) in the same PR.
63+
5864
### Pull Request
5965

6066
When you're finished with the changes, [create a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request), also known as a PR.
6167

68+
‼️ Please DO NOT commit AI-generated code without careful review.
69+
6270
‼️ Please make all PRs against the `dev` branch of the gget repository.
6371

6472
- Don't forget to [link PR to issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if you are solving one.
6573
- Enable the checkbox to [allow maintainer edits](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork) so the branch can be updated for a merge.
6674
- If you run into any merge issues, checkout this [git tutorial](https://github.com/skills/resolve-merge-conflicts) to help you resolve merge conflicts and other issues.
6775

68-
Once you submit your PR, a gget team member will review your proposal. We may ask questions or request additional information.
76+
Once you submit your PR, a `gget` team member will review your proposal. We may ask questions or request additional information.
77+
78+
### What runs automatically on your PR
79+
80+
When you open a PR, a few checks run automatically — you don't need to set anything up:
81+
82+
- **Linting & formatting** ([pre-commit.ci](https://pre-commit.ci)): runs [ruff](https://docs.astral.sh/ruff/) (lint + format), [biome](https://biomejs.dev/), and basic hygiene hooks. It **auto-fixes** formatting issues by pushing a commit to your branch; it only fails the check for problems it can't fix automatically (e.g. lint errors).
83+
- **Type checking** (mypy, via pre-commit.ci): newly introduced type errors fail this check.
84+
- **Unit tests** (`CI - tests`): the complete test suite for all modules runs on Python 3.12, 3.13, and 3.14.
85+
- **Build check**: confirms the package still builds and is publishable.
86+
87+
Optional: You can run these manually first (especially `uvx hatch test` and `prek run --all-files`) to catch most issues before creating the PR.
88+
89+
### Failing tests for modules you didn't touch
90+
91+
The `gget` test suite hits real upstream databases (Ensembl, UniProt, NCBI, ARCHS4, Open Targets, ELM, etc.). When those services change their data or schemas — which they do regularly — tests for the affected modules can start failing without anyone changing `gget` itself. **If automated CI tests fail in your PR for a module you did not touch, you can safely ignore those failures** when judging whether your PR is ready to merge. The maintainers track upstream-drift failures separately and do not expect contributors to fix unrelated breakages as a condition of merging.
6992

70-
### Your PR is merged!
93+
### Your PR gets merged!
7194

72-
Congratulations! 🎉 The gget team thanks you. ✨
95+
Congratulations! 🎉 The `gget` team thanks you. ✨
7396

7497
Once your PR is merged, your contributions will be publicly visible on the [gget repo](https://github.com/scverse/gget).

docs/src/SUMMARY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* [gget diamond](en/diamond.md)
2222
* [gget elm](en/elm.md)
2323
* [gget enrichr](en/enrichr.md)
24-
* [gget g2p](en/g2p.md)
24+
* [gget g2p](en/g2p.md)
2525
* [gget gpt](en/gpt.md)
2626
* [gget info](en/info.md)
2727
* [gget muscle](en/muscle.md)
@@ -64,7 +64,7 @@
6464
* [gget diamond](es/diamond.md)
6565
* [gget elm](es/elm.md)
6666
* [gget enrichr](es/enrichr.md)
67-
* [gget g2p](es/g2p.md)
67+
* [gget g2p](es/g2p.md)
6868
* [gget gpt](es/gpt.md)
6969
* [gget info](es/info.md)
7070
* [gget muscle](es/muscle.md)

docs/src/en/alphafold.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ For higher accuracy, at the potential cost of longer inference times, set this t
3333
`-o` `--out`
3434
Path to folder to save prediction results in (str). Default: "./[date_time]_gget_alphafold_prediction".
3535

36+
`-jhd` `--jackhmmer_savedir`
37+
Path to a parent directory in which to store the temporary jackhmmer files (str). By default, `gget alphafold` creates a "tmp" folder in your home directory (`~/tmp/jackhmmer/`), which can take up to ~2 GB of disk space. Use this argument to place these temporary files elsewhere, e.g. on a disk with more free space. Default: None.
38+
3639
**Flags**
3740
`-mfm` `--multimer_for_monomer`
3841
Use multimer model for a monomer.

docs/src/en/archs4.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
Find the most correlated genes to a gene of interest or find the gene's tissue expression atlas using [ARCHS4](https://maayanlab.cloud/archs4/).
66
Return format: JSON (command-line) or data frame/CSV (Python).
77

8+
> **Note on the data source:** `gget archs4` queries the legacy ARCHS4 HTTP endpoints at `maayanlab.cloud`, which are lightweight and still maintained. ARCHS4 has since launched a new site ([archs4.org](https://archs4.org)) with a larger, more up-to-date dataset, but its programmatic access is provided only via the [`archs4py`](https://github.com/MaayanLab/archs4py) package and multi-GB HDF5 downloads (there is currently no equivalent lightweight HTTP API to query). `gget archs4` therefore continues to use the legacy endpoints. A possible future migration is tracked in [issue 254](https://github.com/scverse/gget/issues/254).
9+
810
**Positional argument**
911
`gene`
1012
Short name (gene symbol) of gene of interest, e.g. STAT4.

docs/src/en/g2p.md

Lines changed: 63 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,43 @@
22

33
> 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.
44
# gget g2p 🧬➜🧪
5-
Query the [Genomics 2 Proteins (G2P) portal](https://g2p.broadinstitute.org/) to link genes/proteins to residue-level structural and functional annotations (e.g. AlphaFold pLDDT, UniProt sites, predicted pockets, PTMs), the gene–transcript–protein–isoform–structure map, and isoform alignments.
5+
Query the [Genomics 2 Proteins (G2P) portal](https://g2p.broadinstitute.org/) to link genes/proteins to residue-level structural and functional annotations, the gene–transcript–protein–isoform–structure map, and isoform alignments.
66

7-
Returns: A data frame with the requested G2P information.
7+
The per-residue feature table is rich (~140 columns), including AlphaFold pLDDT, DSSP secondary structure, accessible surface area, UniProt sites (active/binding/domain/...), PhosphoSitePlus PTMs, fpocket / af2bind / p2rank pocket predictions, intra- and inter-chain hydrogen bonds, non-bonded interactions, disulfide bonds and salt bridges (from PDB and AlphaFold), the PFES (Protein Feature Enrichment Score) sub-scores used by G2P for missense variant interpretation, and per-residue MaveDB experimental functional scores. See the [`g2p-bis` documentation](https://github.com/broadinstitute/g2p-bis) for column descriptions.
8+
9+
> Note: this module wraps the *public* G2P REST API. The variant overlays shown in the portal's web UI (gnomAD, ClinVar, HGMD) are not exposed by the public API and are therefore not available via `gget g2p` — use the portal directly for those.
10+
11+
Returns: A data frame with the requested G2P information, or `None` if the query failed (network error, invalid arguments, or unknown gene/UniProt pair).
812

913
This module was written by [Elarwei](https://github.com/Elarwei001).
1014

11-
**Positional argument**
12-
`gene`
15+
At least one of `gene` or `--uniprot_id` is required — the other is resolved automatically via the UniProt REST API and cached.
16+
17+
**Arguments (at least one of `gene` / `--uniprot_id` required)**
18+
`gene` (positional)
1319
Gene symbol, e.g. BRCA1.
20+
If omitted, resolved from `--uniprot_id`. In this case, note that gene → UniProt accession lookup is approximate (it picks the canonical reviewed human Swiss-Prot entry only); for non-human organisms, unreviewed entries, or a specific isoform, pass `--uniprot_id` explicitly.
1421

15-
**Other required arguments**
1622
`-u` `--uniprot_id`
17-
UniProt accession, e.g. P38398. For `--resource alignment` this is the canonical isoform (e.g. P01130-1).
18-
Tip: find a gene's UniProt ID with [`gget info`](info.md).
23+
UniProt accession, e.g. P38398. If omitted, resolved from `gene`. For `--resource alignment` this is the canonical isoform (e.g. P01130-1) and is **required** (gene→UniProt lookup returns the base accession and cannot disambiguate isoforms).
24+
Tip: find a gene's UniProt ID with [`gget search`](search.md) (to get a gene's Ensembl ID) and [`gget info`](info.md).
1925

2026
**Optional arguments**
2127
`-r` `--resource`
2228
Defines the type of information to return (default: 'features'):
23-
`features`: Per-residue protein feature table (AlphaFold pLDDT, UniProt sites, secondary structure, predicted pockets, PTMs, etc.).
24-
`map`: Gene → transcript → protein isoform → structure map (UniProt/Ensembl/RefSeq/PDB identifiers).
29+
`features`: Per-residue protein feature table (~140 columns: AlphaFold pLDDT, UniProt sites, secondary structure, predicted pockets, PTMs, PFES, MaveDB scores, ...).
30+
`map`: Gene → transcript → protein isoform → structure map (UniProt/Ensembl/RefSeq/PDB identifiers). The comma-joined `PDB Ids` column is augmented with a parsed `PDB Ids List` column (`list[str]`) for direct consumption (e.g. with [`gget pdb`](pdb.md)).
2531
`alignment`: Residue-level sequence alignment between two isoforms (requires `--isoform`; `--uniprot_id` is the canonical isoform).
2632

2733
`-i` `--isoform`
2834
Alternative isoform UniProt accession (e.g. P01130-2). Required when `--resource alignment`. Default: None.
2935

36+
`--residues`
37+
Restrict the result to specific residue positions (applies to `--resource features` / `alignment` only). Command line: comma-separated list and/or inclusive ranges, e.g. `185,1775,1812` or `100-200` or `1-50,185`. Python: `int`, `list[int]`, `range`, or `set[int]`. Default: None (return all residues).
38+
3039
`-o` `--out`
3140
Path to the file the results will be saved in, e.g. path/to/directory/results.json. Default: Standard out.
32-
Python: `save=True` will save the output in the current working directory.
41+
Python: `save=True` will save the output as a CSV in the current working directory; `out="path/to/file.csv"` writes to an explicit path and takes precedence over `save`.
3342

3443
**Flags**
3544
`-csv` `--csv`
@@ -42,36 +51,74 @@ Python: Use `verbose=False` to prevent progress information from being displayed
4251

4352
### Examples
4453
```bash
45-
# Per-residue protein features for BRCA1 (AlphaFold pLDDT, UniProt sites, ...)
54+
# Per-residue protein features for BRCA1 (AlphaFold pLDDT, UniProt sites, ...).
55+
# The gene symbol is optional — it can be resolved from the UniProt accession.
56+
gget g2p -u P38398
57+
```
58+
```python
59+
# Python
60+
gget.g2p(uniprot_id="P38398", resource="features")
61+
```
62+
&rarr; Returns a data frame with one row per residue of the BRCA1 protein (UniProt P38398) and its structural/functional annotations.
63+
64+
<br/><br/>
65+
66+
```bash
67+
# Same query, with the gene symbol passed explicitly
4668
gget g2p BRCA1 -u P38398
4769
```
4870
```python
4971
# Python
5072
gget.g2p("BRCA1", uniprot_id="P38398", resource="features")
5173
```
52-
&rarr; Returns a data frame with one row per residue of the BRCA1 protein (UniProt P38398) and its structural/functional annotations.
74+
75+
<br/><br/>
76+
77+
```bash
78+
# Symmetric: only the gene symbol — UniProt accession is resolved automatically
79+
# (canonical reviewed human Swiss-Prot entry).
80+
gget g2p BRCA1
81+
```
82+
```python
83+
# Python
84+
gget.g2p("BRCA1")
85+
```
86+
&rarr; Same as above. The resolved `P38398` is logged and is visible in the leading `uniprot_id` column.
87+
88+
<br/><br/>
89+
90+
```bash
91+
# Score only specific residue positions
92+
gget g2p BRCA1 -u P38398 --residues 185,1775,1812
93+
```
94+
```python
95+
# Python
96+
gget.g2p("BRCA1", uniprot_id="P38398", residues=[185, 1775, 1812])
97+
gget.g2p("BRCA1", uniprot_id="P38398", residues=range(100, 200))
98+
```
99+
&rarr; Returns only the requested residues from the per-residue feature table.
53100

54101
<br/><br/>
55102

56103
```bash
57104
# Gene -> transcript -> isoform -> structure map (CSV)
58-
gget g2p BRCA1 -u P38398 -r map --csv
105+
gget g2p -u P38398 -r map --csv
59106
```
60107
```python
61108
# Python
62-
gget.g2p("BRCA1", uniprot_id="P38398", resource="map")
109+
gget.g2p(uniprot_id="P38398", resource="map")
63110
```
64111
&rarr; Returns the mapping of BRCA1 to its UniProt isoforms, Ensembl/RefSeq identifiers, and PDB structures.
65112

66113
<br/><br/>
67114

68115
```bash
69116
# Residue-level alignment between two LDLR isoforms
70-
gget g2p LDLR -u P01130-1 -r alignment -i P01130-2
117+
gget g2p -u P01130-1 -r alignment -i P01130-2
71118
```
72119
```python
73120
# Python
74-
gget.g2p("LDLR", uniprot_id="P01130-1", resource="alignment", isoform="P01130-2")
121+
gget.g2p(uniprot_id="P01130-1", resource="alignment", isoform="P01130-2")
75122
```
76123
&rarr; Returns the residue-level alignment between LDLR isoforms P01130-1 and P01130-2.
77124

0 commit comments

Comments
 (0)