opencloning 0.4.2__tar.gz → 0.4.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. {opencloning-0.4.2 → opencloning-0.4.4}/PKG-INFO +4 -2
  2. {opencloning-0.4.2 → opencloning-0.4.4}/pyproject.toml +1 -1
  3. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/batch_cloning/EBIC/example.py +16 -7
  4. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/batch_cloning/pombe/pombe_clone.py +6 -6
  5. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/endpoints/assembly.py +5 -1
  6. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/endpoints/other.py +20 -1
  7. {opencloning-0.4.2 → opencloning-0.4.4}/LICENSE +0 -0
  8. {opencloning-0.4.2 → opencloning-0.4.4}/README.md +0 -0
  9. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/__init__.py +0 -0
  10. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/_version.py +0 -0
  11. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/api_config_utils.py +0 -0
  12. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/app_settings.py +0 -0
  13. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/batch_cloning/EBIC/__init__.py +0 -0
  14. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/batch_cloning/EBIC/barcode.gb +0 -0
  15. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/batch_cloning/EBIC/common_plasmid.gb +0 -0
  16. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/batch_cloning/EBIC/primer_design_settings.py +0 -0
  17. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/batch_cloning/__init__.py +0 -0
  18. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/batch_cloning/index.html +0 -0
  19. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/batch_cloning/pombe/__init__.py +0 -0
  20. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/batch_cloning/pombe/index.html +0 -0
  21. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/batch_cloning/pombe/pombe_gather.py +0 -0
  22. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/batch_cloning/pombe/pombe_get_primers.py +0 -0
  23. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/batch_cloning/pombe/pombe_summary.py +0 -0
  24. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/batch_cloning/ziqiang_et_al2024/__init__.py +0 -0
  25. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/batch_cloning/ziqiang_et_al2024/index.html +0 -0
  26. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/batch_cloning/ziqiang_et_al2024/ziqiang_et_al2024.json +0 -0
  27. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/bug_fixing/README.md +0 -0
  28. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/bug_fixing/__init__.py +0 -0
  29. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/bug_fixing/backend_v0_3.py +0 -0
  30. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/cre_lox.py +0 -0
  31. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/dna_functions.py +0 -0
  32. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/dna_utils.py +0 -0
  33. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/ebic/__init__.py +0 -0
  34. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/ebic/primer_design.py +0 -0
  35. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/ebic/primer_design_settings.py +0 -0
  36. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/endpoints/annotation.py +0 -0
  37. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/endpoints/external_import.py +0 -0
  38. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/endpoints/no_assembly.py +0 -0
  39. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/endpoints/no_input.py +0 -0
  40. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/endpoints/primer_design.py +0 -0
  41. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/gateway.py +0 -0
  42. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/get_router.py +0 -0
  43. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/http_client.py +0 -0
  44. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/main.py +0 -0
  45. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/ncbi_requests.py +0 -0
  46. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/primer_design.py +0 -0
  47. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/pydantic_models.py +0 -0
  48. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/request_examples.py +0 -0
  49. {opencloning-0.4.2 → opencloning-0.4.4}/src/opencloning/utils.py +0 -0
@@ -1,8 +1,9 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: opencloning
3
- Version: 0.4.2
3
+ Version: 0.4.4
4
4
  Summary: Backend of OpenCloning, a web application to generate molecular cloning strategies in json format, and share them with others.
5
5
  License: MIT
6
+ License-File: LICENSE
6
7
  Author: Manuel Lera-Ramirez
7
8
  Author-email: manulera14@gmail.com
8
9
  Requires-Python: >=3.11,<4.0
@@ -11,6 +12,7 @@ Classifier: Programming Language :: Python :: 3
11
12
  Classifier: Programming Language :: Python :: 3.11
12
13
  Classifier: Programming Language :: Python :: 3.12
13
14
  Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
14
16
  Requires-Dist: beautifulsoup4 (>=4.11.1,<5.0.0)
15
17
  Requires-Dist: biopython (>=1.85,<2.0)
16
18
  Requires-Dist: fastapi
@@ -8,7 +8,7 @@ authors = ["Manuel Lera-Ramirez <manulera14@gmail.com>"]
8
8
  description = "Backend of OpenCloning, a web application to generate molecular cloning strategies in json format, and share them with others."
9
9
  license = "MIT"
10
10
  name = "opencloning"
11
- version = "0.4.2"
11
+ version = "0.4.4"
12
12
  package-mode = true
13
13
  readme = "README.md"
14
14
  repository = "https://github.com/manulera/OpenCloning_backend"
@@ -4,7 +4,7 @@ from primer3 import bindings
4
4
  import json
5
5
  from fastapi import UploadFile, Response
6
6
 
7
- from ...pydantic_models import (
7
+ from opencloning.pydantic_models import (
8
8
  GenomeCoordinatesSource,
9
9
  TextFileSequence,
10
10
  PrimerModel,
@@ -13,10 +13,10 @@ from ...pydantic_models import (
13
13
  BaseCloningStrategy,
14
14
  HomologousRecombinationSource,
15
15
  )
16
- from .primer_design_settings import amanda_settings
17
- from ...endpoints.external_import import genome_coordinates, read_from_file
18
- from ...endpoints.assembly import pcr, restriction_and_ligation, homologous_recombination
19
- from ...dna_functions import read_dsrecord_from_json
16
+ from opencloning.batch_cloning.EBIC.primer_design_settings import amanda_settings
17
+ from opencloning.endpoints.external_import import genome_coordinates, read_from_file
18
+ from opencloning.endpoints.assembly import pcr, restriction_and_ligation, homologous_recombination
19
+ from opencloning.dna_functions import read_dsrecord_from_json
20
20
 
21
21
  # Settings for design
22
22
  padding = 1000
@@ -123,7 +123,9 @@ async def main():
123
123
 
124
124
  with open(os.path.join(os.path.dirname(__file__), 'barcode.gb'), 'rb') as f:
125
125
  dummy_resp = Response()
126
- resp = await read_from_file(dummy_resp, UploadFile(file=f, filename='barcode.gb'), None, None, True, 'barcode')
126
+ resp = await read_from_file(
127
+ dummy_resp, UploadFile(file=f, filename='barcode.gb'), None, None, True, 'barcode', None, None
128
+ )
127
129
 
128
130
  barcode_source = resp['sources'][0]
129
131
  barcode_seq: TextFileSequence = resp['sequences'][0]
@@ -132,7 +134,14 @@ async def main():
132
134
  with open(os.path.join(os.path.dirname(__file__), 'common_plasmid.gb'), 'rb') as f:
133
135
  dummy_resp = Response()
134
136
  resp = await read_from_file(
135
- dummy_resp, UploadFile(file=f, filename='common_plasmid.gb'), None, None, True, 'common_plasmid'
137
+ dummy_resp,
138
+ UploadFile(file=f, filename='common_plasmid.gb'),
139
+ None,
140
+ None,
141
+ True,
142
+ 'common_plasmid',
143
+ None,
144
+ None,
136
145
  )
137
146
 
138
147
  common_plasmid_source = resp['sources'][0]
@@ -1,7 +1,7 @@
1
1
  import os
2
- from ...endpoints.external_import import genome_coordinates, get_from_repository_id_addgene, read_from_file
3
- from ...endpoints.assembly import pcr, homologous_recombination
4
- from ...pydantic_models import (
2
+ from opencloning.endpoints.external_import import genome_coordinates, get_from_repository_id_addgene, read_from_file
3
+ from opencloning.endpoints.assembly import pcr, homologous_recombination
4
+ from opencloning.pydantic_models import (
5
5
  GenomeCoordinatesSource,
6
6
  TextFileSequence,
7
7
  AddgeneIdSource,
@@ -12,7 +12,7 @@ from ...pydantic_models import (
12
12
  UploadedFileSource,
13
13
  )
14
14
 
15
- from ...ncbi_requests import get_annotations_from_query
15
+ from opencloning.ncbi_requests import get_annotations_from_query
16
16
  import asyncio
17
17
  import json
18
18
  from Bio import SeqIO
@@ -78,9 +78,9 @@ async def main(
78
78
  # Get plasmid sequence =================s================================================================
79
79
  if not isinstance(plasmid, str):
80
80
  if plasmid.filename.endswith('.fa') or plasmid.filename.endswith('.fasta'):
81
- resp = await read_from_file(plasmid, None, None, True, None)
81
+ resp = await read_from_file(plasmid, None, None, True, None, None, None)
82
82
  else:
83
- resp = await read_from_file(plasmid, None, None, None, None)
83
+ resp = await read_from_file(plasmid, None, None, None, None, None, None)
84
84
  # Verify that plasmid is circular
85
85
  if not pydna_parse(resp['sequences'][0].file_content)[0].circular:
86
86
  raise ValueError('Plasmid is not circular')
@@ -265,12 +265,16 @@ async def pcr(
265
265
  source: PCRSource,
266
266
  sequences: Annotated[list[TextFileSequence], Field(min_length=1, max_length=1)],
267
267
  primers: Annotated[list[PrimerModel], Field(min_length=1, max_length=2)],
268
- minimal_annealing: int = Query(20, description='The minimal annealing length for each primer.'),
268
+ minimal_annealing: int = Query(
269
+ 14,
270
+ description='The minimal amount of bases that must match between the primer and the sequence, excluding mismatches.',
271
+ ),
269
272
  allowed_mismatches: int = Query(0, description='The number of mismatches allowed'),
270
273
  ):
271
274
  if len(primers) != len(sequences) * 2:
272
275
  raise HTTPException(400, 'The number of primers should be twice the number of sequences.')
273
276
 
277
+ minimal_annealing = minimal_annealing + allowed_mismatches
274
278
  pydna_sequences = [read_dsrecord_from_json(s) for s in sequences]
275
279
  pydna_primers = [PydnaPrimer(p.sequence, id=str(p.id), name=p.name) for p in primers]
276
280
 
@@ -3,6 +3,7 @@ from Bio.Restriction.Restriction_Dictionary import rest_dict
3
3
  from pydantic import ValidationError
4
4
  from opencloning_linkml.migrations import migrate
5
5
  from opencloning_linkml._version import __version__ as schema_version
6
+ import os
6
7
 
7
8
  from ..bug_fixing.backend_v0_3 import fix_backend_v0_3
8
9
 
@@ -22,9 +23,27 @@ from .._version import __version__ as backend_version
22
23
  router = get_router()
23
24
 
24
25
 
26
+ def version_to_int(version: str | None) -> int | None:
27
+ if version is None:
28
+ return None
29
+ try:
30
+ version = version.replace('v', '')
31
+ # Pad to 2 digits
32
+ int_vals = [val.zfill(2) for val in version.split('.')]
33
+ return int(''.join(int_vals))
34
+ except ValueError:
35
+ return None
36
+
37
+
25
38
  @router.get('/version')
26
39
  async def get_version():
27
- return {'backend_version': backend_version, 'schema_version': schema_version}
40
+ opencloning_version = os.getenv('OPENCLONING_VERSION')
41
+ return {
42
+ 'backend_version': backend_version,
43
+ 'schema_version': schema_version,
44
+ 'opencloning_version': opencloning_version,
45
+ 'opencloning_version_int': version_to_int(opencloning_version),
46
+ }
28
47
 
29
48
 
30
49
  @router.get('/restriction_enzyme_list', response_model=dict[str, list[str]])
File without changes
File without changes