Skip to content

Commit 3116a1b

Browse files
authored
Merge pull request #1651 from virtualcell/mark-published-models
Add publish endpoint and webapp UI for marking models as published
2 parents c831b9e + 2aa074a commit 3116a1b

96 files changed

Lines changed: 3613 additions & 381 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.

.github/workflows/ci_cd.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,6 @@ jobs:
8585
java -version
8686
mvn --batch-mode clean install dependency:copy-dependencies -DskipTests=true
8787
88-
- name: Add jython
89-
shell: bash
90-
run: |
91-
curl https://repo1.maven.org/maven2/org/python/jython-installer/2.7.4/jython-installer-2.7.4.jar -o jython-installer.jar
92-
mkdir .temp_holding
93-
mv /home/runner/.m2/repository/org/python/jython/2.7.4/* .temp_holding
94-
java -jar jython-installer.jar -s -d /home/runner/.m2/repository/org/python/jython/2.7.4
95-
9688
- name: Test building of docker image
9789
run: |
9890
docker build \
@@ -178,15 +170,6 @@ jobs:
178170
java-version: '17'
179171
cache: 'maven'
180172

181-
- name: Add jython
182-
shell: bash
183-
run: |
184-
curl https://repo1.maven.org/maven2/org/python/jython-installer/2.7.4/jython-installer-2.7.4.jar -o jython-installer.jar
185-
mkdir .temp_holding
186-
mkdir -p /home/runner/.m2/repository/org/python/jython/2.7.4
187-
(mv /home/runner/.m2/repository/org/python/jython/2.7.4/* .temp_holding) || true
188-
java -jar jython-installer.jar -s -d /home/runner/.m2/repository/org/python/jython/2.7.4
189-
190173
- name: Maven Build and run Test group ${{ matrix.test-group }}
191174
shell: bash
192175
run: |

CLAUDE.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# VCell - Virtual Cell Project
2+
3+
Computational cell biology simulation platform (since 1997). Java monorepo with Python and TypeScript components, deployed on Kubernetes.
4+
5+
**Repo:** `git@github.com:virtualcell/vcell.git`
6+
**License:** MIT
7+
**Main branch:** `master`
8+
9+
## Build & Test
10+
11+
```bash
12+
# Full build (skip tests)
13+
mvn clean install -DskipTests
14+
15+
# Fast unit tests only
16+
mvn test -Dgroups="Fast"
17+
18+
# Quarkus REST service tests (uses testcontainers - needs Docker running)
19+
mvn test -pl vcell-rest
20+
21+
# Build specific module with dependencies
22+
mvn compile test-compile -pl vcell-rest -am
23+
```
24+
25+
**Java:** 17
26+
**Maven:** 3.8+
27+
**Quarkus:** 3.5.2 (vcell-rest, vcell-server)
28+
29+
## Module Structure
30+
31+
| Module | Purpose |
32+
|--------|---------|
33+
| `vcell-core` | Core simulation logic, VCML model representation |
34+
| `vcell-math` | Mathematical model utilities |
35+
| `vcell-rest` | Quarkus REST API service (the main deployed API) |
36+
| `vcell-restclient` | Auto-generated Java API client |
37+
| `vcell-server` | Server-side business logic |
38+
| `vcell-api` | Legacy REST API (Restlet-based, `/api/v0/`) |
39+
| `vcell-api-types` | Shared API type definitions |
40+
| `vcell-apiclient` | Legacy API client |
41+
| `vcell-client` | Desktop/standalone Java client |
42+
| `vcell-cli` | Command-line interface |
43+
| `vcell-admin` | Administration tools |
44+
| `vcell-util` | Shared utilities |
45+
| `vcell-vmicro` | Virtual microscopy |
46+
47+
## OpenAPI Client Generation
48+
49+
OpenAPI spec is generated by Quarkus SmallRye OpenAPI from `vcell-rest` and stored in `tools/openapi.yaml`. Three clients are auto-generated:
50+
51+
```bash
52+
cd tools
53+
./generate.sh # Generates Java, Python, and TypeScript-Angular clients
54+
```
55+
56+
- **Java client:** `vcell-restclient/` (OpenAPI Generator v7.1.0)
57+
- **Python client:** `python-restclient/`
58+
- **Angular client:** `webapp-ng/src/app/core/modules/openapi/`
59+
60+
After regenerating clients, always verify downstream compilation:
61+
```bash
62+
mvn compile test-compile -pl vcell-rest -am
63+
```
64+
65+
## vcell-rest (Quarkus API)
66+
67+
Config: `vcell-rest/src/main/resources/application.properties`
68+
69+
- **Port:** 9000 (dev), 80 (deployed)
70+
- **Auth:** OIDC via Auth0 (prod/dev), Keycloak devservices (test)
71+
- **Databases:** Oracle (prod), PostgreSQL (dev/test via testcontainers)
72+
- **OpenAPI:** SmallRye OpenAPI at `/openapi`, Swagger UI at `/q/swagger-ui/`
73+
- **Tests:** `@QuarkusTest` with Keycloak + PostgreSQL testcontainers
74+
75+
## Key Domain Concepts
76+
77+
- **versionFlag** — Curation/archive status of a model (Published, Archived, Current). This is NOT privacy. Privacy/access control uses `GroupAccess`.
78+
- **BioModel** — Primary biological model container (VCML format)
79+
- **MathModel** — Mathematical model representation
80+
- **Simulation** — A runnable simulation configuration within a model
81+
82+
## Python Components
83+
84+
Python 3.10 + Poetry 1.2.2+
85+
86+
| Package | Location |
87+
|---------|----------|
88+
| `vcell-cli-utils` | `vcell-cli-utils/` |
89+
| `python-restclient` | `python-restclient/` (auto-generated) |
90+
| `vcell-opt` | `pythonCopasiOpt/vcell-opt/` |
91+
| VTK integration | `pythonVtk/` |
92+
| Python utilities | `python-utils/` |
93+
| Data handling | `pythonData/` |
94+
95+
## Frontend
96+
97+
Angular 17 app in `webapp-ng/`. Uses auto-generated OpenAPI TypeScript client.
98+
99+
```bash
100+
cd webapp-ng
101+
npm install
102+
npm start # Dev server
103+
npm run build_prod # Production build
104+
```
105+
106+
## Docker & Deployment
107+
108+
- **Dockerfile** at repo root — Ubuntu Jammy + Java 17 + Python 3.10
109+
- **Docker Compose** in `docker/swarm/`
110+
- **Kubernetes** configs in separate repo: `vcell-fluxcd/kustomize/`
111+
- Overlays: `prod`, `stage`, `dev`, `remote-base`, `island-base`
112+
- Ingress routes `/api/v1/` → rest service, `/api/v0/` → legacy api
113+
114+
## CI/CD
115+
116+
GitHub Actions (`.github/workflows/ci_cd.yml`):
117+
118+
1. **CI-Build** — Maven build + Docker image test
119+
2. **CI-Test** — Parallel test groups: Fast, MathGen_IT, SBML_IT, SEDML_SBML_IT, SEDML_VCML_IT, BSTS_IT, Quarkus
120+
3. **CD** — Docker push to `ghcr.io` on release
121+
122+
## Validation Checklist
123+
124+
After major changes (especially removing/renaming user-facing features):
125+
126+
- [ ] Check `vcell-client/UserDocumentation/` for references to changed features. This is an ad-hoc XML format compiled into JavaHelp (in-app help) and HTML published at https://vcell.org/webstart/VCell_Tutorials/VCell_Help/index.html. Update documentation to stay consistent with code.
127+
- [ ] After regenerating OpenAPI clients (`tools/generate.sh`), compile downstream: `mvn compile test-compile -pl vcell-rest -am`
128+
129+
## Conventions
130+
131+
- Break changes into logically grouped commits (not one big commit)
132+
- Research known issues before trial-and-error config changes
133+
- When test output is saved to `./output.txt`, analyze it with grep/read instead of rerunning tests

docs/publications-api.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Publications and Model Curation
2+
3+
## Overview
4+
5+
Publications in VCell link scientific papers to the computational models (BioModels and MathModels) that were used or described in those papers. The publication system also drives the **curation workflow**, which controls model visibility and permanence.
6+
7+
## Domain Concepts
8+
9+
### Publication
10+
11+
A publication record represents a scientific paper and its metadata:
12+
13+
- **title**, **authors**, **year**, **citation** - bibliographic information
14+
- **pubmedid**, **doi**, **url** - external identifiers and links
15+
- **biomodelRefs** - array of BioModel references linked to this publication
16+
- **mathmodelRefs** - array of MathModel references linked to this publication
17+
18+
Publications are managed by curators (users with the `publicationEditors` special claim).
19+
20+
### Model References (BiomodelRef / MathmodelRef)
21+
22+
Model references are lightweight pointers to BioModels or MathModels that are associated with a publication. Each reference includes:
23+
24+
- **key** (`bmKey` / `mmKey`) - the model's database identifier
25+
- **name** - model name
26+
- **ownerName** / **ownerKey** - the model owner
27+
- **versionFlag** - the model's curation status (see below)
28+
29+
### VersionFlag (Curation Status)
30+
31+
`VersionFlag` represents a model's position in the curation lifecycle. It is **not** access control - that is handled separately by `GroupAccess`.
32+
33+
| State | Int Value | Description |
34+
|-------|-----------|-------------|
35+
| **Current** | 0 | Default state. Model is in active development. Can be modified or deleted. |
36+
| **Archived** | 1 | Model has been archived. Cannot be deleted without admin intervention. |
37+
| **Published** | 3 | Model has been curated and published. Cannot be deleted without admin intervention. |
38+
39+
**Key constraint**: Archived and Published models cannot be deleted through the normal API. This ensures the permanence of curated scientific models.
40+
41+
### GroupAccess (Access Control)
42+
43+
`GroupAccess` controls who can view a model. It is independent of `VersionFlag`.
44+
45+
| Type | GroupID | Description |
46+
|------|---------|-------------|
47+
| **GroupAccessAll** | 0 | Public - visible to everyone |
48+
| **GroupAccessNone** | 1 | Private - visible only to the owner |
49+
| **GroupAccessSome** | (hash) | Shared with a specific group of users |
50+
51+
## Curation Workflow
52+
53+
When a curator publishes models linked to a publication, two things happen atomically for each model:
54+
55+
1. **Access is set to public**: `GroupAccess` is changed to `GroupAccessAll` (groupid = 0)
56+
2. **Status is set to published**: `VersionFlag` is changed to `Published` (value = 3)
57+
58+
This is performed by `PublicationService.publishDirectly()`, which delegates to `DbDriver.publishDirectly()` to update the `vc_biomodel` and `vc_mathmodel` database tables.
59+
60+
### Selective Publishing
61+
62+
Curators can publish all models linked to a publication at once, or selectively choose which models to publish by providing specific model keys in the `PublishModelsRequest`.
63+
64+
## REST API
65+
66+
Base path: `/api/v1/publications`
67+
68+
| Method | Path | Operation | Auth | Description |
69+
|--------|------|-----------|------|-------------|
70+
| GET | `/` | getPublications | Public | List all publications |
71+
| GET | `/{id}` | getPublicationById | Public | Get a single publication |
72+
| POST | `/` | createPublication | Curator | Create a new publication |
73+
| PUT | `/` | updatePublication | Curator | Update publication metadata and model links |
74+
| DELETE | `/{id}` | deletePublication | Curator | Delete a publication |
75+
| PUT | `/{id}/publish` | publishBioModels | Curator | Publish models linked to a publication |
76+
77+
### Publish Endpoint
78+
79+
`PUT /api/v1/publications/{id}/publish`
80+
81+
Request body (`PublishModelsRequest`, optional):
82+
```json
83+
{
84+
"biomodelKeys": [12345, 67890],
85+
"mathmodelKeys": [11111]
86+
}
87+
```
88+
89+
- If the request body is null or keys arrays are empty, **all** models linked to the publication are published.
90+
- If specific keys are provided, only those models are published.
91+
92+
## Key Source Files
93+
94+
| File | Purpose |
95+
|------|---------|
96+
| `handlers/PublicationResource.java` | REST endpoint definitions |
97+
| `services/PublicationService.java` | Business logic for publication CRUD and publishing |
98+
| `models/Publication.java` | Publication REST model |
99+
| `models/BiomodelRef.java` | BioModel reference REST model |
100+
| `models/MathmodelRef.java` | MathModel reference REST model |
101+
| `models/PublishModelsRequest.java` | Request body for selective publishing |
102+
| `vcell-core/.../VersionFlag.java` | Curation status enum |
103+
| `vcell-core/.../GroupAccess.java` | Access control base class |
104+
| `vcell-server/.../DbDriver.java` | Database-level publish logic |

docs/publications.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# VCell Publications and Model Curation
2+
3+
## What is a Publication in VCell?
4+
5+
A VCell publication links a scientific paper to the computational models (BioModels and MathModels) that support it. Publications serve two purposes:
6+
7+
1. **Discovery** - Users can browse publications to find curated, peer-reviewed models relevant to their research.
8+
2. **Curation** - Publications drive the process of reviewing, approving, and permanently preserving models in the VCell database.
9+
10+
## How Users Find Published Models
11+
12+
In the VCell desktop client, the **Database** panel (lower left of any document window) organizes public models into three folders:
13+
14+
- **Published** - Models created by users and linked to a scientific publication. Grouped by publication citation.
15+
- **Curated** - Models created by the VCell team or collaborators to reproduce results described in a publication.
16+
- **Uncurated** - Public models that have not been peer-reviewed or linked to a publication.
17+
18+
Published and Curated models represent the highest quality tier - they have been reviewed, are permanently preserved, and are linked to their corresponding papers.
19+
20+
## How to Publish a VCell Model (Author Instructions)
21+
22+
When your paper is accepted and you want to associate your VCell model with the publication, follow these steps:
23+
24+
### 1. Make Your Model Public
25+
26+
Change your model's permissions in the VCell Database:
27+
- Navigate to **File > Permissions...**
28+
- Select **Public**
29+
- Click **OK**
30+
31+
The model will initially appear in the **Uncurated** public models folder. You can also share with specific users by selecting **Grant Access to Specific Users** and adding their VCell usernames.
32+
33+
### 2. Reference VCell in Your Publication
34+
35+
Include your username and model name so readers can find your model:
36+
37+
> "The Virtual Cell Model, *[modelname]* by user *[username]*, can be accessed within the VCell software (available at https://vcell.org)."
38+
39+
### 3. Acknowledge the Funding Source
40+
41+
Include this acknowledgment in your manuscript:
42+
43+
> "The Virtual Cell is supported by NIH Grant R24 GM137787 from the National Institute for General Medical Sciences."
44+
45+
### 4. Cite the Required VCell Papers
46+
47+
All publications using VCell must cite:
48+
- Schaff, J., C. C. Fink, B. Slepchenko, J. H. Carson, and L. M. Loew. 1997. A general computational framework for modeling cellular structure and function. Biophysical journal 73:1135-1146. PMC1181013 PMID: 9284281 DOI: 10.1016/S0006-3495(97)78146-3
49+
- Cowan, A. E., Moraru, II, J. C. Schaff, B. M. Slepchenko, and L. M. Loew. 2012. Spatial modeling of cell signaling networks. Methods Cell Biol 110:195-221. PMC3519356 PMID: 22482950 DOI: 10.1016/B978-0-12-388403-9.00008-4
50+
51+
Additional citations for specialized model types:
52+
- **Rule-Based models**:
53+
- Blinov, M. L., J. C. Schaff, D. Vasilescu, Moraru, II, J. E. Bloom, and L. M. Loew. 2017. Compartmental and Spatial Rule-Based Modeling with Virtual Cell. Biophysical journal 113:1365-1372. PMC5627391 PMID: 28978431 DOI: 10.1016/j.bpj.2017.08.022
54+
- **Spatial Hybrid Deterministic-Stochastic models**:
55+
- Schaff, J. C., F. Gao, Y. Li, I. L. Novak, and B. M. Slepchenko. 2016. Numerical Approach to Spatial Deterministic-Stochastic Models Arising in Cell Biology. PLoS Comput Biol 12:e1005236. PMC5154471 PMID: 27959915 DOI: 10.1371/journal.pcbi.1005236
56+
57+
### 5. Submit Your Publication Information
58+
59+
Complete the [VCell Publication Submission Form](https://vcell.org/publish-a-vcell-model) with:
60+
- Your name, email, and VCell username
61+
- Article title, authors, and journal citation
62+
- Publication date
63+
- Model type (BioModel or MathModel) and model name
64+
65+
Upon approval by the VCell team, your model will be archived, listed on the VCell website, and protected from modification or deletion.
66+
67+
### Archiving Without Publishing (Deprecated)
68+
69+
Previously, authors could archive models independently through the VCell desktop client by right-clicking a model in the Database panel and selecting **Archive**. Archiving protected a model from deletion or alteration but did not link it to a publication. This option was removed because it caused confusion among users about the distinction between archiving and publishing.
70+
71+
## Model Lifecycle
72+
73+
Every model in VCell has a **curation status** (`VersionFlag`) that tracks where it is in the curation lifecycle:
74+
75+
```
76+
Current (0) --> Archived (1) --> Published (3)
77+
(default) (protected) (protected + public)
78+
```
79+
80+
| Status | Who can see it | Can it be deleted? | Typical meaning |
81+
|--------|---------------|-------------------|-----------------|
82+
| **Current** | Depends on access settings | Yes | Work in progress or uncurated model |
83+
| **Archived** | Depends on access settings | No (admin only) | Preserved for reference, may or may not be linked to a publication |
84+
| **Published** | Everyone (public) | No (admin only) | Curated, peer-reviewed, linked to a publication |
85+
86+
Curation status is independent from access control. A model can be publicly visible but still in "Current" status (not yet curated), or it could be archived but only visible to certain users.
87+
88+
## Access Control (GroupAccess)
89+
90+
Access control determines who can view a model. It is a separate concept from curation status.
91+
92+
| Level | Description |
93+
|-------|-------------|
94+
| **Private** | Only the model owner can see it (default) |
95+
| **Shared** | The owner and specific named users can see it |
96+
| **Public** | Everyone can see it |
97+
98+
When a model is published through the curation workflow, its access is automatically set to Public. However, a model author can independently make their model public at any time without it being "published" in the curation sense.
99+
100+
## Curator Workflow
101+
102+
Curators are VCell team members with the `publicationEditors` role. Curation is performed through the Angular webapp at [vcell.cam.uchc.edu](https://vcell.cam.uchc.edu). Curators are responsible for:
103+
104+
- Creating and editing publication records (title, authors, DOI, PubMed ID, etc.)
105+
- Linking the correct model versions to each publication
106+
- Reviewing models for correctness and completeness
107+
- **Publishing** models - the act that makes them permanently public and protected from deletion
108+
109+
### What Happens When a Curator Publishes Models
110+
111+
When a curator clicks "Publish Selected Models" in the webapp (or calls the publish API), two things happen atomically for each selected model:
112+
113+
1. **Access becomes public** - The model's access control is set to `GroupAccessAll`, making it visible to all VCell users.
114+
2. **Status becomes Published** - The model's `VersionFlag` is set to `Published`, protecting it from deletion.
115+
116+
This is an intentionally irreversible operation through normal means. Published models are part of the scientific record and should not be casually removed.
117+
118+
### Selective Publishing
119+
120+
Curators can choose to publish all models linked to a publication at once, or selectively publish individual models. This is useful when a publication links to multiple models but only some are ready for curation.
121+
122+
## For Developers
123+
124+
See [publications-api.md](publications-api.md) for the REST API reference, data models, and source file locations.
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1b0f328c9eda0992167ce503b0a5afcc
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
34a67ba62097778e4695c951156bf189c2c8e016

0 commit comments

Comments
 (0)