Skip to content

Commit

Permalink
Merge pull request #225 from paretje/feature/https
Browse files Browse the repository at this point in the history
Update URL to download models
  • Loading branch information
RalfG authored Nov 20, 2024
2 parents adf3be1 + 502fded commit 3c21b8b
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("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

0 comments on commit 3c21b8b

Please sign in to comment.