Skip to content

Commit 96fb916

Browse files
authored
Rename open cloning (#262)
* update linkml library * change text * rename shareyourcloning folder * change imports
1 parent 4ff5828 commit 96fb916

Some content is hidden

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

62 files changed

+126
-126
lines changed

.github/ISSUE_TEMPLATE/new-source.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ assignees: ''
1515

1616
You can do some of these tasks in parallel, specially if you need to wait for approval, but it's good to keep in mind the intended order:
1717

18-
* [ ] Make a branch in [ShareYourCloning_LinkML](https://github.com/genestorian/ShareYourCloning_LinkML) where you implement the new source (see extra docs in there) on how to do this.
19-
* [ ] Add your branch as a dependency (via commit id) using poetry in this repository, to update `shareyourcloning-linkml` dependency in `pyproject.toml`:
18+
* [ ] Make a branch in [OpenCloning_LinkML](https://github.com/genestorian/OpenCloning_LinkML) where you implement the new source (see extra docs in there) on how to do this.
19+
* [ ] Add your branch as a dependency (via commit id) using poetry in this repository, to update `opencloning-linkml` dependency in `pyproject.toml`:
2020
```bash
21-
poetry add git+https://github.com/genestorian/ShareYourCloning_LinkML#<commit-id>
21+
poetry add git+https://github.com/genestorian/OpenCloning_LinkML#<commit-id>
2222
```
2323
* [ ] Implement the new source in a branch in this repository. You will need to add a new endpoint in `main.py` and a new class in `pydantic_models.py` that will handle the new source. You can use the existing sources as a template. Note that you can add extra validation or methods (see examples as well).
2424
* [ ] Write tests for the new source in `tests/test_endpoints.py`. You can use the existing tests as a template.
25-
* [ ] Once the tests pass, merge the PR of the new source in [ShareYourCloning_LinkML] and make a release of the `shareyourcloning-linkml` package.
25+
* [ ] Once the tests pass, merge the PR of the new source in [OpenCloning_LinkML] and make a release of the `opencloning-linkml` package.
2626
* [ ] Update the dependency in the branch of this repository repository to the new version.
2727
```bash
28-
# Get version from https://pypi.org/project/shareyourcloning-linkml/
28+
# Get version from https://pypi.org/project/opencloning-linkml/
2929
# For instance, if the version is 0.1.6a0, then:
30-
poetry add shareyourcloning[email protected]
30+
poetry add opencloning[email protected]
3131
```
32-
* [ ] Implement the frontend functionality in a branch, following [the frontend wiki](https://github.com/manulera/ShareYourCloning_frontend/wiki/Checklist-%E2%80%90--adding-a-source).
32+
* [ ] Implement the frontend functionality in a branch, following [the frontend wiki](https://github.com/manulera/OpenCloning_frontend/wiki/Checklist-%E2%80%90--adding-a-source).
3333
* [ ] Make tests for the frontend functionality.
3434
* [ ] Merge the PR in this repository into master.
3535
* [ ] Update the backend submodule in the frontend repository to the latest master.

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ jobs:
9292
id: meta
9393
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
9494
with:
95-
images: manulera/shareyourcloningbackend
95+
images: manulera/opencloningbackend
9696

9797
- name: Build and push Docker image
9898
uses: docker/build-push-action@v6
9999
with:
100100
context: .
101101
push: true
102-
tags: manulera/shareyourcloningbackend:latest
102+
tags: manulera/opencloningbackend:latest
103103
labels: ${{ steps.meta.outputs.labels }}
104104
build-args: |
105105
COMMIT_SHA=${{ github.sha }}

.github/workflows/post_release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ jobs:
2020
id: meta
2121
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
2222
with:
23-
images: manulera/shareyourcloningbackend
23+
images: manulera/opencloningbackend
2424
- name: Build and push Docker image (release)
2525
if: github.event_name == 'release'
2626
uses: docker/build-push-action@v6
2727
with:
2828
context: .
2929
push: true
3030
tags: |
31-
manulera/shareyourcloningbackend:prod
32-
manulera/shareyourcloningbackend:${{ github.ref_name }}
31+
manulera/opencloningbackend:prod
32+
manulera/opencloningbackend:${{ github.ref_name }}
3333
labels: ${{ steps.meta.outputs.labels }}
3434
build-args: |
3535
COMMIT_SHA=${{ github.sha }}
@@ -40,7 +40,7 @@ jobs:
4040
name: Build and publish Python 🐍 distributions 📦 to PyPI + build documentation
4141
environment:
4242
name: publish
43-
url: https://pypi.org/p/shareyourcloning
43+
url: https://pypi.org/p/opencloning
4444
permissions:
4545
id-token: write
4646
steps:

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Backend for ShareYourCloning
2-
# https://github.com/manulera/ShareYourCloning_backend
1+
# Backend for OpenCloning
2+
# https://github.com/manulera/OpenCloning_backend
33

44
# BUILDER IMAGE
55
FROM python:3.11-slim-bookworm as builder
@@ -38,7 +38,7 @@ COPY ./pyproject.toml .
3838
COPY ./README.md .
3939

4040
RUN poetry build
41-
RUN pip install dist/shareyourcloning-*.whl
41+
RUN pip install dist/opencloning-*.whl
4242

4343
# FINAL IMAGE
4444
FROM python:3.11-slim-bookworm
@@ -70,4 +70,4 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
7070
# For example, ROOT_PATH="/syc"
7171
ENV ROOT_PATH=""
7272
# Only add --root-path if ROOT_PATH is not empty, otherwise uvicorn will throw an error
73-
CMD uvicorn shareyourcloning.main:app --host 0.0.0.0 --port 8000 ${ROOT_PATH:+--root-path ${ROOT_PATH}}
73+
CMD uvicorn opencloning.main:app --host 0.0.0.0 --port 8000 ${ROOT_PATH:+--root-path ${ROOT_PATH}}

README.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
[![Python tests](https://github.com/manulera/ShareYourCloning_backend/actions/workflows/ci.yml/badge.svg)](https://github.com/manulera/ShareYourCloning_backend/actions/workflows/ci.yml)
2-
[![codecov](https://codecov.io/gh/manulera/ShareYourCloning_backend/graph/badge.svg?token=CFIB2H6WMO)](https://codecov.io/gh/manulera/ShareYourCloning_backend)
1+
[![Python tests](https://github.com/manulera/OpenCloning_backend/actions/workflows/ci.yml/badge.svg)](https://github.com/manulera/OpenCloning_backend/actions/workflows/ci.yml)
2+
[![codecov](https://codecov.io/gh/manulera/OpenCloning_backend/graph/badge.svg?token=CFIB2H6WMO)](https://codecov.io/gh/manulera/OpenCloning_backend)
33

4-
# ShareYourCloning Backend API
4+
# OpenCloning Backend API
55

6-
This API is part of a bigger application, before going further, please go to the [main project readme](https://github.com/manulera/ShareYourCloning), where you can find an introduction.
6+
This API is part of a bigger application, before going further, please go to the [main project readme](https://github.com/manulera/OpenCloning), where you can find an introduction.
77

88
This python API is built with [FastAPI](https://fastapi.tiangolo.com/) and is for *in silico* cloning.
99

1010
## Summary
1111

12-
Read [main project readme](https://github.com/manulera/ShareYourCloning) first.
12+
Read [main project readme](https://github.com/manulera/OpenCloning) first.
1313

14-
This API provides a series of entry points. The API documentation can be accessed [here](https://shareyourcloning.api.genestorian.org/docs). You can use the documentation page to try some request directly on the browser. Otherwise, the API is open for you to make requests from a python script or command line at: [https://shareyourcloning.api.genestorian.org/](https://shareyourcloning.api.genestorian.org/).
14+
This API provides a series of entry points. The API documentation can be accessed [here](https://OpenCloning.api.genestorian.org/docs). You can use the documentation page to try some request directly on the browser. Otherwise, the API is open for you to make requests from a python script or command line at: [https://opencloning.api.genestorian.org/](https://opencloning.api.genestorian.org/).
1515

1616
## Getting started
1717

18-
If you want to quickly set up a local instance of the frontend and backend of the application, check [getting started in 5 minutes](https://github.com/manulera/ShareYourCloning#timer_clock-getting-started-in-5-minutes) in the main repository.
18+
If you want to quickly set up a local instance of the frontend and backend of the application, check [getting started in 5 minutes](https://github.com/manulera/OpenCloning#timer_clock-getting-started-in-5-minutes) in the main repository.
1919

2020
### Running locally
2121

@@ -27,9 +27,9 @@ python -m venv .venv
2727
# Activate the virtual environment
2828
source .venv/bin/activate
2929
# Install the package from github (will be in pypi at some point)
30-
pip install shareyourcloning
30+
pip install opencloning
3131
# Run the API (uvicorn should be installed in the virtual environment)
32-
uvicorn shareyourcloning.main:app
32+
uvicorn opencloning.main:app
3333
```
3434

3535
### Running locally if you want to contribute
@@ -56,61 +56,61 @@ Now you should be able to run the api by running:
5656

5757
```bash
5858
# The --reload argument will reload the API if you make changes to the code
59-
uvicorn shareyourcloning.main:app --reload --reload-exclude='.venv'
59+
uvicorn opencloning.main:app --reload --reload-exclude='.venv'
6060
```
6161

6262
Then you should be able to open the API docs at [http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs) to know that your API is working.
6363

6464
### Running locally with docker :whale:
6565

66-
If you want to serve the full site (backend and frontend) with docker, check [getting started in 5 minutes](https://github.com/manulera/ShareYourCloning#timer_clock-getting-started-in-5-minutes) in the main repository.
66+
If you want to serve the full site (backend and frontend) with docker, check [getting started in 5 minutes](https://github.com/manulera/OpenCloning#timer_clock-getting-started-in-5-minutes) in the main repository.
6767

68-
If you want to serve only the backend from a docker container, an image is available at [manulera/shareyourcloningbackend](https://hub.docker.com/r/manulera/shareyourcloningbackend). The image is built from the Dockerfile in the root of this repository and exposes the port 3000. To run it:
68+
If you want to serve only the backend from a docker container, an image is available at [manulera/opencloningbackend](https://hub.docker.com/r/manulera/opencloningbackend). The image is built from the Dockerfile in the root of this repository and exposes the port 3000. To run it:
6969

7070
```bash
71-
docker build -t manulera/shareyourcloningbackend .
72-
docker run -d --name backendcontainer -p 8000:8000 manulera/shareyourcloningbackend
71+
docker build -t manulera/opencloningbackend .
72+
docker run -d --name backendcontainer -p 8000:8000 manulera/opencloningbackend
7373

7474
```
7575

76-
If you don't want to download the repository and build the image, you can fetch the latest image from dockerhub (same image that is used in [https://shareyourcloning.api.genestorian.org/](https://shareyourcloning.api.genestorian.org/))
76+
If you don't want to download the repository and build the image, you can fetch the latest image from dockerhub (same image that is used in [https://opencloning.api.genestorian.org/](https://opencloning.api.genestorian.org/))
7777

7878
```bash
79-
docker pull manulera/shareyourcloningbackend
80-
docker run -d --name backendcontainer -p 8000:8000 manulera/shareyourcloningbackend
79+
docker pull manulera/opencloningbackend
80+
docker run -d --name backendcontainer -p 8000:8000 manulera/opencloningbackend
8181
```
8282

8383
The api will be running at `http://localhost:8000`, so you should be able to access the docs at [http://localhost:8000/docs](http://localhost:8000/docs).
8484

8585
### Connecting to the frontend
8686

87-
If you want to receive requests from the [frontend](https://github.com/manulera/ShareYourCloning_frontend), or from another web application you may have to include the url of the frontend application in the CORS exceptions. By default, if you run the dev server with `uvicorn shareyourcloning.main:app --reload --reload-exclude='.venv'`, the backend will accept requests coming from `http://localhost:3000`, which is the default address of the frontend dev server (ran with `yarn start`).
87+
If you want to receive requests from the [frontend](https://github.com/manulera/OpenCloning_frontend), or from another web application you may have to include the url of the frontend application in the CORS exceptions. By default, if you run the dev server with `uvicorn opencloning.main:app --reload --reload-exclude='.venv'`, the backend will accept requests coming from `http://localhost:3000`, which is the default address of the frontend dev server (ran with `yarn start`).
8888

8989
If you want to change the allowed origins, you can do so via env variables (comma-separated). e.g.:
9090

9191
```
92-
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:3001 uvicorn shareyourcloning.main:app --reload --reload-exclude='.venv'
92+
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:3001 uvicorn opencloning.main:app --reload --reload-exclude='.venv'
9393
```
9494

95-
Similarly, the frontend should be configured to send requests to the backend address, [see here](https://github.com/manulera/ShareYourCloning_frontend#connecting-to-the-backend).
95+
Similarly, the frontend should be configured to send requests to the backend address, [see here](https://github.com/manulera/OpenCloning_frontend#connecting-to-the-backend).
9696

9797
#### Serving the frontend from the backend
9898

9999
You may prefer to handle everything from a single server. You can do so by:
100-
* Build the [frontend](https://github.com/manulera/ShareYourCloning_frontend) with `yarn build`.
100+
* Build the [frontend](https://github.com/manulera/OpenCloning_frontend) with `yarn build`.
101101
* Copy the folder `build` from the frontend to the root directory of the backend, and rename it to `frontend`.
102102
* Set the environment variable `SERVE_FRONTEND=1` when running the backend. By default this will remove all allowed origins, but you can still set them with `ALLOWED_ORIGINS`.
103103
* Set the value of `backendUrl` in `frontend/config.js` to `/`.
104104
* Now, when you go to the root of the backend (e.g. `http://localhost:8000`), you should receive the frontend instead of the greeting page of the API.
105105

106-
You can see how this is done in this [docker image](https://github.com/manulera/ShareYourCloning/blob/master/Dockerfile) and [docker-compose file](https://github.com/manulera/ShareYourCloning/blob/master/docker-compose.yml).
106+
You can see how this is done in this [docker image](https://github.com/manulera/OpenCloning/blob/master/Dockerfile) and [docker-compose file](https://github.com/manulera/OpenCloning/blob/master/docker-compose.yml).
107107

108108
## Contributing :hammer_and_wrench:
109109

110-
Check [contribution guidelines in the main repository](https://github.com/manulera/ShareYourCloning/blob/master/CONTRIBUTING.md) for general guidelines.
110+
Check [contribution guidelines in the main repository](https://github.com/manulera/OpenCloning/blob/master/CONTRIBUTING.md) for general guidelines.
111111

112112
For more specific tasks:
113-
* Creating a new type of source: follow the [new source issue template](.github/ISSUE_TEMPLATE/new-source.md). You can create an issue like that [here](https://github.com/manulera/ShareYourCloning_backend/issues/new?assignees=&labels=new-source&projects=&template=new-source.md&title=New+source%3A+%3Cname-of-source%3E).
113+
* Creating a new type of source: follow the [new source issue template](.github/ISSUE_TEMPLATE/new-source.md). You can create an issue like that [here](https://github.com/manulera/OpenCloning_backend/issues/new?assignees=&labels=new-source&projects=&template=new-source.md&title=New+source%3A+%3Cname-of-source%3E).
114114

115115
## Running the tests locally
116116

@@ -132,7 +132,7 @@ For the frontend, it may be useful to produce stubs (I use them for writing the
132132
by looking at the `RecordStubRoute` class in `api_config_utils.py`. To run the dev server and record stubs:
133133

134134
```bash
135-
RECORD_STUBS=1 uvicorn shareyourcloning.main:app --reload --reload-exclude='.venv'
135+
RECORD_STUBS=1 uvicorn opencloning.main:app --reload --reload-exclude='.venv'
136136
```
137137

138138
This will record the stubs (requests and responses) in the `stubs` folder.

codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
ignore:
22
- "tests/**"
3-
- "src/shareyourcloning/batch_cloning/pombe"
3+
- "src/opencloning/batch_cloning/pombe"

examples/snapgene_history/build_history.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
A script to clone a gene into a plasmid. The same operation will be done in Snapgene,
3-
and we will try to extract the snapgene history to match the documentation by ShareYourCloning.
3+
and we will try to extract the snapgene history to match the documentation by OpenCloning.
44
"""
55

66
# %%

examples/snapgene_history/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ You can see it in the SnapGene history of `final_plasmid.dna` if you open with s
2525

2626
![](final_plasmid_history.svg)
2727

28-
The equivalent history is built with ShareYourCloning with the script `build_history.py`, and stored as json in `history.json`. The only difference in this case is that ase1 is loaded directly from GenBank instead of loaded from a file (I actually loaded from GenBank with SnapGene, but it does not register this in the history).
28+
The equivalent history is built with OpenCloning with the script `build_history.py`, and stored as json in `history.json`. The only difference in this case is that ase1 is loaded directly from GenBank instead of loaded from a file (I actually loaded from GenBank with SnapGene, but it does not register this in the history).
2929

3030
## Old SnapGene files
3131

poetry.lock

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[tool.poetry]
22
authors = ["Manuel Lera-Ramirez <[email protected]>"]
3-
description = "Backend of ShareYourCloning, a web application to generate molecular cloning strategies in json format, and share them with others."
3+
description = "Backend of OpenCloning, a web application to generate molecular cloning strategies in json format, and share them with others."
44
license = "MIT"
5-
name = "shareyourcloning"
5+
name = "opencloning"
66
version = "0.1.0"
77
package-mode = true
88
readme = "README.md"
9-
repository = "https://github.com/manulera/shareyourcloning_backend"
9+
repository = "https://github.com/manulera/OpenCloning_backend"
1010

1111
[tool.poetry.dependencies]
1212
beautifulsoup4 = "^4.11.1"
@@ -19,10 +19,10 @@ pydna = "^5.3"
1919
requests = "^2.31.0"
2020
regex = "^2023.10.3"
2121
pydantic = "^2.7.1"
22-
shareyourcloning-linkml = "0.1.12a0"
2322
pandas = "^2.2.3"
2423
openpyxl = "^3.1.5"
2524
pyyaml = "^6.0.2"
25+
opencloning-linkml = "^0.2a0"
2626

2727
[tool.poetry.group.dev.dependencies]
2828
autopep8 = "^2.0.4"

0 commit comments

Comments
 (0)