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

Update URL to download models #225

Open
wants to merge 2 commits into
base: releases
Choose a base branch
from
Open
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
6 changes: 2 additions & 4 deletions ms2pip/_utils/xgb_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_predictions_xgb(features, num_ions, model_params, model_dir, processes=1
for ion_type, xgb_model in xgboost_models.items():
# Get predictions from XGBoost model
preds = xgb_model.predict(features)
preds = preds.clip(min=np.log2(0.001)) # Clip negative intensities
preds = preds.clip(min=np.log2(0.001)) # Clip negative intensities
xgb_model.__del__()

# Reshape into arrays for each peptide
Expand Down Expand Up @@ -96,9 +96,7 @@ def _download_model(model, model_hash, model_dir):
filename = os.path.join(model_dir, model)

logger.info(f"Downloading {model} to {filename}...")
urllib.request.urlretrieve(
os.path.join("http://genesis.ugent.be/uvpublicdata/ms2pip/", model), filename
)
urllib.request.urlretrieve(f"https://zenodo.org/records/13270668/files/{model}", filename)
if not _check_model_integrity(filename, model_hash):
raise InvalidXGBoostModelError()

Expand Down