Skip to content

Commit

Permalink
Merge pull request #55 from nleroy917/dev
Browse files Browse the repository at this point in the history
Tweak pydantic schema's to fix Docker bugs
  • Loading branch information
nleroy917 authored Sep 1, 2023
2 parents eb53fa6 + e9290ca commit 5a64630
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,4 @@ cython_debug/

.DS_Store
.Rproj.user
.python-version
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ import optipyzer

api = optipyzer.API()

gblock = "ATGGCCCTTTAA"
dna_seq = "ATGGCCCTTTAA"

result = api.optimize(
seq=dna_seq,
seq_type="dna",
weights={"human": 2, "mouse": 1},
)
seq=dna_seq,
seq_type="dna",
weights={"human": 2, "mouse": 1},
)

print(result['optimized_sd'])
```
Expand Down Expand Up @@ -69,13 +69,13 @@ import optipyzer

api = optipyzer.API(local=True) # <--- specify you are using a local server

gblock = "ATGGCCCTTTAA"
dna_seq = "ATGGCCCTTTAA"

result = api.optimize(
seq=dna_seq,
seq_type="dna",
weights={"human": 2, "mouse": 1},
)
seq=dna_seq,
seq_type="dna",
weights={"human": 2, "mouse": 1},
)

print(result['optimized_sd'])
```
Expand Down
2 changes: 1 addition & 1 deletion optipyzer/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = "0.2.0"
VERSION = "0.2.1"

VALID_AMINO_ACIDS = "ARNDCQEGHILKMFPSTWYV"

Expand Down
2 changes: 1 addition & 1 deletion optipyzer/request_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class OptimizeQuery(BaseModel):
seed: Optional[Union[int, str]]

class Config:
schema_extra = {
json_schema_extra = {
"description": "The optimization query that includes the sequence, and the organism weights",
"example": {
"seq": "ATGCGTACTAGTCAGTCAGACTGACTG",
Expand Down
8 changes: 4 additions & 4 deletions optipyzer/response_models.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
from typing import Dict, List
from typing import Dict, List, Union
from pydantic import BaseModel


# model for an optimization result
class OptimizationResult(BaseModel):
query: str
weights: Dict[str, int]
weights: Dict[Union[str, int], int]
seq_type: str
peptide_seq: str
dna_seq: str
stop_codon: int
optimized_sd: str
min_difference_sumsquares: float
best_expression_sd: Dict[str, float]
best_expression_sd: Dict[Union[str, int], float]
optimized_ad: str
min_difference_absvalue: float
best_expression_ad: Dict[str, float]
best_expression_ad: Dict[Union[str, int], float]

class Config:
orm_mode = True
Expand Down

1 comment on commit 5a64630

@vercel
Copy link

@vercel vercel bot commented on 5a64630 Sep 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.