Skip to content

Commit 835bc67

Browse files
committed
revert more + inter res
1 parent d4a3918 commit 835bc67

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/anyvlm/functions/get_caf.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ def get_caf(
1414
anyvar_client: BaseAnyVarClient,
1515
anyvlm_storage: Storage,
1616
assembly_id: GrcAssemblyId | UcscAssemblyBuild,
17-
chromosome_name: ChromosomeName,
17+
reference_name: ChromosomeName,
1818
start: int,
19-
end: int,
2019
) -> list[CohortAlleleFrequencyStudyResult]:
2120
"""Retrieve Cohort Allele Frequency data for all known variants matching provided
2221
search params
@@ -25,17 +24,15 @@ def get_caf(
2524
:param anyvlm_storage: AnyVLM Storage (CAF storage and retrieval)
2625
:param assembly_id: The reference assembly to utilize - must be one of: "GRCh37",
2726
"GRCh38", "hg38", "hg19"
28-
:param chromosome_name: The chromosome to search on, with an optional "chr" prefix
27+
:param reference_name: The chromosome to search on, with an optional "chr" prefix
2928
- e.g., "1", "chr22", "X", "chrY", etc.
30-
:param start: Inclusive, inter-residue genomic start position of the interval to
31-
search
32-
:param end: Inclusive, inter-residue genomic end position of the interval to search
29+
:param start: start of range search. Uses residue coordinates (1-based)
3330
:param reference_bases: Genomic bases ('T', 'AC', etc.)
3431
:param alternate_bases: Genomic bases ('T', 'AC', etc.)
3532
:return: list of CAFs contained in search interval
3633
"""
3734
vrs_variations: list[VrsVariation] = anyvar_client.search_by_interval(
38-
f"{assembly_id}:{chromosome_name}", start, end
35+
f"{assembly_id}:{reference_name}", start - 1, start
3936
)
4037
vrs_variations_map: dict[str, Allele] = {
4138
vrs_variation.id: vrs_variation

tests/integration/functions/test_get_caf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from anyvlm.storage.postgres import PostgresObjectStore
1111
from anyvlm.utils.types import GrcAssemblyId
1212

13-
POSITION = 2781760
13+
POSITION = 2781761
1414
ASSEMBLY = GrcAssemblyId.GRCH38
1515
CHROMOSOME = "chrY"
1616
CHROMOSOME_IDENTIFIER = f"{ASSEMBLY}:{CHROMOSOME}"
@@ -76,7 +76,6 @@ def test_get_caf_results_returned(
7676
ASSEMBLY,
7777
CHROMOSOME,
7878
POSITION,
79-
POSITION,
8079
)
8180
diff = DeepDiff(
8281
[caf.model_dump(exclude_none=True) for caf in cafs],
@@ -98,6 +97,5 @@ def test_get_caf_no_results(
9897
GrcAssemblyId.GRCH37,
9998
"Y",
10099
POSITION,
101-
POSITION,
102100
)
103101
assert cafs == []

0 commit comments

Comments
 (0)