Skip to content

Commit f18898b

Browse files
authored
Merge branch 'main' into fork-readme
2 parents 7d635ab + 0d3139a commit f18898b

42 files changed

Lines changed: 1313 additions & 1130 deletions

File tree

Some content is hidden

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

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[submodule "submodules/vrs"]
22
path = submodules/vrs
33
url = https://github.com/ga4gh/vrs.git
4-
branch = 2.0.0-snapshot.2025-02
4+
branch = 2.0

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ First, you must install a local [SeqRepo](https://github.com/biocommons/biocommo
8383

8484
```shell
8585
pip install seqrepo
86-
export SEQREPO_VERSION=2024-02-20 # or newer if available -- check `seqrepo list-remote-instances`
86+
export SEQREPO_VERSION=2024-12-20 # or newer if available -- check `seqrepo list-remote-instances`
8787
sudo mkdir -p /usr/local/share/seqrepo
8888
sudo chown $USER /usr/local/share/seqrepo
8989
seqrepo pull -i $SEQREPO_VERSION
@@ -93,7 +93,7 @@ seqrepo update-latest
9393
If you encounter a permission error similar to the one below:
9494

9595
```shell
96-
PermissionError: [Error 13] Permission denied: '/usr/local/share/seqrepo/2024-02-20._fkuefgd' -> '/usr/local/share/seqrepo/2024-02-20'
96+
PermissionError: [Error 13] Permission denied: '/usr/local/share/seqrepo/2024-12-20._fkuefgd' -> '/usr/local/share/seqrepo/2024-12-20'
9797
```
9898

9999
Try moving data manually with `sudo`:
@@ -131,7 +131,7 @@ Check that the containers are running, by running:
131131
$ docker ps
132132
CONTAINER ID IMAGE // NAMES
133133
86e872ab0c69 biocommons/seqrepo-rest-service:latest // vrs-python_seqrepo-rest-service_1
134-
a40576b8cf1f biocommons/uta:uta_20210129b // vrs-python_uta_1
134+
a40576b8cf1f biocommons/uta:uta_20241220 // vrs-python_uta_1
135135
```
136136

137137
Depending on your network and host, the _first_ run is likely to take 5-15
@@ -141,7 +141,7 @@ nearly instantaneous.
141141
You can test UTA and seqrepo installations like so:
142142

143143
```shell
144-
$ psql -XAt postgres://anonymous@localhost/uta -c 'select count(*) from uta_20210129b.transcript'
144+
$ psql -XAt postgres://anonymous@localhost/uta -c 'select count(*) from uta_20241220.transcript'
145145
314227
146146
```
147147

@@ -156,9 +156,9 @@ Here are some things to try.
156156
$ docker-compose up seqrepo-rest-service
157157
Starting vrs-python_seqrepo-rest-service_1 ... done
158158
Attaching to vrs-python_seqrepo-rest-service_1
159-
seqrepo-rest-service_1 | 2022-07-26 15:59:59 seqrepo_rest_service.__main__[1] INFO Using seqrepo_dir='/usr/local/share/seqrepo/2024-02-20' from command line
159+
seqrepo-rest-service_1 | 2022-07-26 15:59:59 seqrepo_rest_service.__main__[1] INFO Using seqrepo_dir='/usr/local/share/seqrepo/2024-12-20' from command line
160160
161-
seqrepo-rest-service_1 | OSError: Unable to open SeqRepo directory /usr/local/share/seqrepo/2024-02-20
161+
seqrepo-rest-service_1 | OSError: Unable to open SeqRepo directory /usr/local/share/seqrepo/2024-12-20
162162
vrs-python_seqrepo-rest-service_1 exited with code 1
163163
```
164164

docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
seqrepo:
3-
image: biocommons/seqrepo:2024-02-20
3+
image: biocommons/seqrepo:2024-12-20
44
volumes:
55
- seqrepo_vol:/usr/local/share/seqrepo
66

@@ -11,16 +11,16 @@ services:
1111
- seqrepo_vol:/usr/local/share/seqrepo
1212
depends_on:
1313
- seqrepo
14-
command: seqrepo-rest-service -w /usr/local/share/seqrepo/2024-02-20
14+
command: seqrepo-rest-service -w /usr/local/share/seqrepo/2024-12-20
1515
network_mode: bridge
1616
ports:
1717
- 5000:5000
1818

1919
uta:
2020
# Test:
21-
# psql -XAt postgres://anonymous@localhost/uta -c 'select count(*) from uta_20210129b.transcript'
21+
# psql -XAt postgres://anonymous@localhost/uta -c 'select count(*) from uta_20241220.transcript'
2222
# 314227
23-
image: biocommons/uta:uta_20210129b
23+
image: biocommons/uta:uta_20241220
2424
environment:
2525
- POSTGRES_PASSWORD=some-password-that-you-make-up
2626
volumes:

docs/extras/vcf_annotator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Like other VRS-Python tools, the VCF annotator requires access to [sequence and
2020
For example, to use a local set of SeqRepo data, you can use an absolute file path:
2121

2222
```commandline
23-
vrs-annotate vcf --dataproxy_uri="seqrepo+file:///usr/local/share/seqrepo/2024-02-20/" --vcf_out=out.vcf.gz input.vcf.gz
23+
vrs-annotate vcf --dataproxy_uri="seqrepo+file:///usr/local/share/seqrepo/2024-12-20/" --vcf_out=out.vcf.gz input.vcf.gz
2424
```
2525

2626
Alternative, a relative file path:
2727

2828
```commandline
29-
vrs-annotate vcf --dataproxy_uri="seqrepo+../seqrepo/2024-02-20/" --vcf_out=out.vcf.gz input.vcf.gz
29+
vrs-annotate vcf --dataproxy_uri="seqrepo+../seqrepo/2024-12-20/" --vcf_out=out.vcf.gz input.vcf.gz
3030
```
3131

3232
Or an alternate REST path:

docs/setup_help/uta_installation.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717
8. Exit postgres
1818
1. `\q`
1919
9. Download the UTA database and place it in the uta database object that you created before (**This step takes around 5 hours**).
20-
1. `export UTA_VERSION=uta_20210129.pgd.gz\ncurl -O http://dl.biocommons.org/uta/$UTA_VERSION\ngzip -cdq ${UTA_VERSION} | psql -h localhost -U uta_admin --echo-errors --single-transaction -v ON_ERROR_STOP=1 -d uta -p 5432`
20+
1. `export UTA_VERSION=uta_20241220.pgd.gz\ncurl -O http://dl.biocommons.org/uta/$UTA_VERSION\ngzip -cdq ${UTA_VERSION} | psql -h localhost -U uta_admin --echo-errors --single-transaction -v ON_ERROR_STOP=1 -d uta -p 5432`
2121
10. Set your UTA path
22-
1. `export UTA_DB_URL=postgresql://uta_admin@localhost:5432/uta/uta_20210129`
22+
1. `export UTA_DB_URL=postgresql://uta_admin@localhost:5432/uta/uta_20241220`
2323
###Optional installation step
2424
11. If you wanted to wait for the 5 hour update till later please follow these steps instead:
2525
12. Download the UTA database and place it in the uta database object that you created before.
26-
1. `export UTA_VERSION=uta_20210129.pgd.gz
26+
1. `export UTA_VERSION=uta_20241220.pgd.gz
2727
curl -O http://dl.biocommons.org/uta/$UTA_VERSION
2828
gzip -cdq ${UTA_VERSION} | grep -v "^REFRESH MATERIALIZED VIEW" | psql -h localhost -U uta_admin --echo-errors --single-transaction -v ON_ERROR_STOP=1 -d uta -p 5432`
2929
13. Run the refresh materialized view commands
30-
1. `REFRESH MATERIALIZED VIEW uta_20210129.exon_set_exons_fp_mv;`
31-
2. `REFRESH MATERIALIZED VIEW uta_20210129.tx_exon_set_summary_mv;`
32-
3. `REFRESH MATERIALIZED VIEW uta_20210129.tx_def_summary_mv;`
33-
4. `REFRESH MATERIALIZED VIEW uta_20210129.tx_similarity_mv;` #**This step will take 5 or more hours**
30+
1. `REFRESH MATERIALIZED VIEW uta_20241220.exon_set_exons_fp_mv;`
31+
2. `REFRESH MATERIALIZED VIEW uta_20241220.tx_exon_set_summary_mv;`
32+
3. `REFRESH MATERIALIZED VIEW uta_20241220.tx_def_summary_mv;`
33+
4. `REFRESH MATERIALIZED VIEW uta_20241220.tx_similarity_mv;` #**This step will take 5 or more hours**

notebooks/getting_started/1_Quick_Start.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"outputs": [],
9393
"source": [
9494
"import os\n",
95-
"os.environ[\"UTA_DB_URL\"] = \"postgresql://anonymous:anonymous@uta.biocommons.org:5432/uta/uta_20210129b\""
95+
"os.environ[\"UTA_DB_URL\"] = \"postgresql://anonymous:anonymous@uta.biocommons.org:5432/uta/uta_20241220\""
9696
]
9797
},
9898
{

notebooks/getting_started/4_Exploring_the_AlleleTranslator.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
"outputs": [],
113113
"source": [
114114
"import os\n",
115-
"os.environ[\"UTA_DB_URL\"] = \"postgresql://anonymous:anonymous@uta.biocommons.org:5432/uta/uta_20210129b\""
115+
"os.environ[\"UTA_DB_URL\"] = \"postgresql://anonymous:anonymous@uta.biocommons.org:5432/uta/uta_20241220\""
116116
]
117117
},
118118
{

notebooks/getting_started/5_Exploring_the_CnvTranslator.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
"outputs": [],
123123
"source": [
124124
"import os\n",
125-
"os.environ[\"UTA_DB_URL\"] = \"postgresql://anonymous:anonymous@uta.biocommons.org:5432/uta/uta_20210129b\""
125+
"os.environ[\"UTA_DB_URL\"] = \"postgresql://anonymous:anonymous@uta.biocommons.org:5432/uta/uta_20241220\""
126126
]
127127
},
128128
{

notebooks/getting_started/6_Upcoming_features.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
"outputs": [],
113113
"source": [
114114
"import os\n",
115-
"os.environ[\"UTA_DB_URL\"] = \"postgresql://anonymous:anonymous@uta.biocommons.org:5432/uta/uta_20210129b\""
115+
"os.environ[\"UTA_DB_URL\"] = \"postgresql://anonymous:anonymous@uta.biocommons.org:5432/uta/uta_20241220\""
116116
]
117117
},
118118
{

src/ga4gh/core/models.py

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,17 @@ class Coding(Element, BaseModelForbidExtra):
146146
)
147147
system: str = Field(
148148
...,
149-
description="The terminology/code system that defined the code. May be reported as a free-text name (e.g. 'Sequence Ontology'), but it is preferable to provide a uri/url for the system. When the 'code' is reported as a CURIE, the 'system' should be reported as the uri that the CURIE's prefix expands to (e.g. 'http://purl.obofoundry.org/so.owl/' for the Sequence Ontology).",
149+
description="The terminology/code system that defined the code. May be reported as a free-text name (e.g. 'Sequence Ontology'), but it is preferable to provide a uri/url for the system.",
150150
)
151151
systemVersion: Optional[str] = Field( # noqa: N815
152152
None,
153153
description="Version of the terminology or code system that provided the code.",
154154
)
155155
code: code # Cannot use Field due to PydanticUserError: field name and type annotation must not clash.
156+
iris: Optional[list[iriReference]] = Field(
157+
None,
158+
description="A list of IRIs that are associated with the coding. This can be used to provide additional context or to link to additional information about the concept.",
159+
)
156160

157161

158162
class ConceptMapping(Element, BaseModelForbidExtra):
@@ -193,40 +197,30 @@ class Extension(Element, BaseModelForbidExtra):
193197

194198

195199
class MappableConcept(Element, BaseModelForbidExtra):
196-
"""A concept name that may be mapped to one or more `Codings`."""
200+
"""A concept based on a primaryCoding and/or name that may be mapped to one or more other `Codings`."""
197201

198202
conceptType: Optional[str] = Field( # noqa: N815
199203
None,
200204
description="A term indicating the type of concept being represented by the MappableConcept.",
201205
)
202206
name: Optional[str] = Field(None, description="A primary name for the concept.")
203-
primaryCode: Optional[code] = Field( # noqa: N815
207+
primaryCoding: Optional[Coding] = Field( # noqa: N815
204208
None,
205-
description="A primary code for the concept that is used to identify the concept in a terminology or code system. If there is a public code system for the primaryCode then it should also be specified in the mappings array with a relation of 'exactMatch'. This attribute is provided to both allow a more technical code to be used when a public Coding with a system is not available as well as when it is available but should be identified as the primary code.",
209+
description="A primary coding for the concept.",
206210
)
207211
mappings: Optional[list[ConceptMapping]] = Field(
208212
None,
209213
description="A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation.",
210214
)
211215

212-
class ga4gh: # noqa: N801
213-
"""Contain properties used for computing digests"""
214-
215-
inherent: tuple[str] = ("primaryCode",)
216-
217216
@model_validator(mode="after")
218-
def require_name_or_primary_code(cls, v): # noqa: ANN001 N805 ANN201
219-
"""Ensure that ``name`` or ``primaryCode`` is provided"""
220-
if v.primaryCode is None and v.name is None:
221-
err_msg = "`One of name` or `primaryCode` must be provided."
217+
def require_name_or_primary_coding(cls, v): # noqa: ANN001 N805 ANN201
218+
"""Ensure that ``name`` or ``primaryCoding`` is provided"""
219+
if v.primaryCoding is None and v.name is None:
220+
err_msg = "One of `name` or `primaryCoding` must be provided."
222221
raise ValueError(err_msg)
223222
return v
224223

225-
def ga4gh_serialize(self) -> Optional[str]: # noqa: D102
226-
if self.primaryCode:
227-
return self.primaryCode.root
228-
return None
229-
230224

231225
Element.model_rebuild()
232226
Entity.model_rebuild()

0 commit comments

Comments
 (0)