Skip to content

Fixed the Library - PyBioMed#26

Open
LenkaChandini wants to merge 1 commit intogadsbyfly:masterfrom
LenkaChandini:Master
Open

Fixed the Library - PyBioMed#26
LenkaChandini wants to merge 1 commit intogadsbyfly:masterfrom
LenkaChandini:Master

Conversation

@LenkaChandini
Copy link

Pull Request: Fixed and Modernized PyBioMed Library

📌Summary
This PR updates and fixes the PyBioMed library to ensure compatibility with modern Python versions and current scientific libraries (NumPy, SciPy, RDKit, Requests). The changes improve reliability, maintainability, and usability of the library for bioinformatics workflows.

🔧Key Changes

🧮1. NumPy & SciPy Compatibility

  • Replaced deprecated numpy.float with float or numpy.float64.
  • Updated SciPy functions (scipy.triu, dot, argwhere) to use NumPy equivalents.
  • Removed reliance on deprecated APIs for better forward-compatibility.

🌐2. Network and File Handling

  • Replaced legacy FTP downloads with secure HTTPS requests via requests.
  • Improved file handling using with open(..., encoding="utf-8") for safer I/O.
  • Added error handling for missing/invalid files.

🛠3. Code Robustness & Error Handling

  • Added warnings and exception handling for missing sequences or molecules.
  • Improved descriptor calculation functions to handle RDKit vector outputs correctly.
  • Enhanced function return values with clearer error messages.

📚4. Library Improvements

  • Updated GetConstitutional and other descriptor functions for stability.
  • Added missing imports (numpy as np, requests, warnings).
  • General cleanup of redundant or outdated code blocks.

Benefits

  • Full compatibility with Python 3.10+ and latest NumPy/SciPy releases.
  • More reliable data retrieval (HTTPs vs. outdated FTP).
  • Cleaner, more maintainable codebase for future contributions.
  • Improved error handling enhances robustness in bioinformatics pipelines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant