Skip to content

Commit

Permalink
download models from zenodo
Browse files Browse the repository at this point in the history
  • Loading branch information
paretje committed Sep 20, 2024
1 parent 3428609 commit 5d46707
Showing 1 changed file with 2 additions and 4 deletions.
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("https://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

0 comments on commit 5d46707

Please sign in to comment.