Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add back MW fallback #13

Merged
merged 2 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions geckopy/experimental/molecular_weights.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import gzip
import io
import re
from collections import defaultdict
from time import sleep
from typing import Callable, Dict, List, Optional

Expand Down Expand Up @@ -87,6 +88,9 @@ def _molecular_weight(seq: str) -> float:
"""
seq = "".join(str(seq).split()).upper() # Do the minimum formatting
weight_table = protein_weights
weight_table = defaultdict(
lambda: sum(weight_table.values()) / len(weight_table), weight_table
)
water = 18.010565

try:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ version = 0.0.1
[options]
zip_safe = True
install_requires =
cobra~=0.25.0
cobra~=0.27.0
pandas~=1.1.5
tqdm~=4.60
requests>=2
Expand Down
Loading