Giter Club home page Giter Club logo

pymgpipe's Introduction

Coverage

Coverage Report
FileStmtsMissCoverMissing
pymgpipe
   coupling.py39685%20, 43, 46–47, 52, 67
   diet.py1031982%16, 22, 396–397, 437–453, 466–477, 482–485, 494, 496, 525
   fva.py1445959%32, 36, 88–92, 98, 107–113, 116–117, 120–121, 139–149, 165, 174–235, 244
   io.py1063765%17, 55, 61–66, 80–81, 95–96, 108, 111, 117–120, 125–133, 142, 146–147, 152–157, 161–167, 176–177
   main.py1484470%112, 115, 167, 210–212, 243–297, 304, 309–310, 323
   metrics.py242112%5–35
   modeling.py145795%36, 39, 54–57, 129, 131
   nmpc.py64592%95, 132–134, 136
   utils.py23510754%45–46, 49, 52, 67, 73, 83, 87, 102–105, 111, 115–117, 120–138, 142–152, 160, 173–174, 176–177, 199–200, 205–207, 245–248, 250–264, 270, 281–286, 289–293, 313–314, 325–367
pymgpipe/tests
   test_e2e.py90199%197
TOTAL130930677% 

API Docs

https://korem-lab.github.io/pymgpipe/

Installation

pympgipe has been built and tested with python 3.10+. To install and use our PyPi package, run pip install pymgpipe

Additional Dependencies

Need at least one of the following solvers (requirements.txt includes gurobi)-

In order to install the solver interfaces in python, you can use pip install cplex or pip install gurobipy. This does not actually create a license, it just installs the python interface to interact with these solvers. Both gurobipy and cplex offer free academic licenses. To install the licenses themselves, refer to the links provided above.

Inputs

To create multi-species community models with pymgpipe, you need two things to start-

  • Folder with individual taxa models (either in .mat or .xml format)
  • Relative abundance matrix (as a .csv) with samples as columns and taxa as rows. Taxa names should correspond to file names within taxa folder (excluding extension)

Examples of both can be found in the examples/ folder. Individual models for thousands of bacteria can be found and downloaded here.

Outputs

The exact location and names of output files will vary depending on the parameters you pass into each function. However, the default output for pymgpipe's build_models function will look something like this-


* pymgpipe input*
.
├── taxaModels/
│   ├── taxa1.xml
│   ├── taxa2.xml
│   └── ...
├── abundances.csv

# pymgpipe output*
.
├── out/
    ├── reaction_content.csv
    ├── reaction_abundance.csv
    ├── sample_label_conversion.csv
    ├── metabolic_diversity.png
    ├── problems/
    │   ├── mc1.mps.gz
    │   ├── mc2.mps.gz
    │   └── ...
    └── models/
        ├── mc1.xml.gz
        ├── mc2.xml.gz
        └── ...

Here is a breakdown of each output files/directory and their descriptions-

File Type Description
reaction_content CSV Matrix showing binary presence/absence of all reactions within each sample
reaction_abundance CSV Matrix showing scaled abundance (between 0 and 1) of all reactions within each sample
sample_label_conversion CSV Dictionary with conversion between original sample names and model names (default sample_prefix is 'mc')
metabolic_diversity PNG Plot depicting # of unique reactions & taxa present within each sample
problems dir Directory containing LP problems (default format is .mps, with compressed set to True)
models dir Directory containing COBRA moddels (default format is .xml, with compressed set to True)

Examples

Clone and run through workflow.ipynb in the examples/ folder (see below)

Attribution

When using pymgpipe please cite-

Meydan et al., (2023). pymgpipe: microbiome metabolic modeling in Python. Journal of Open Source Software, 8(88), 5545, https://doi.org/10.21105/joss.05545

Baldini, F., Heinken, A., Heirendt, L., Magnusdottir, S., Fleming, R. M. T., & Thiele, I. (2019). The Microbiome Modeling Toolbox: from microbial interactions to personalized microbial communities. Bioinformatics (Oxford, England), 35(13), 2332–2334. https://doi.org/10.1093/bioinformatics/bty941

Contributing

We warmly welcome and appreciate contributions from everyone. There are several ways you can contribute:

  • Reporting Bugs: If you find a bug, please create a new issue on our GitHub page. Be sure to include as much information as possible so we can reproduce and fix the bug. The more detail you provide, the better.
  • Code Contributions: If you'd like to contribute code, great! Please fork this repository, make your changes in a separate branch, and then submit a pull request. We'll review your changes and discuss any necessary modifications or improvements before merging.

Here are some general guidelines for code contributions:

  1. Fork the repo and create your branch from the master.
  2. If you've added code, add tests.
  3. Ensure the test suite passes.
  4. Issue that pull request!

Reporting Issues

Issues should be reported using the GitHub issue tracker. Please check the existing issues to avoid duplicates. When reporting an issue, please provide as much detail as possible about how to reproduce the problem, including the following information:

  • Operating system and version
  • Details of the problem, including any error messages and screenshots if possible

Thank you for your contributions!

Copyright 2023 The Trustees of Columbia University in the City of New York. See LICENSE for additional details.

pymgpipe's People

Contributors

github-actions[bot] avatar meydany avatar talkorem avatar ym2877 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pymgpipe's Issues

JOSS Review

Hello,

I have a few comments concerning your python package and your manuscript:

  1. let's start with the installation process. I honestly don't see a reason why this package shouldn't be available in the Python Package Index https://pypi.org. I would strongly suggest to create a pypi package. You already have everything to do that;
  2. before uploading the package to pypi, I would definitely refactor the setup.py. Please add as many details as possible (see this example here);
  3. this is the first time I see taking track of a tool version through a .VERSION file. Is that used for any other purpose? Is it used by a GitHub action? If not, I would add this info in the pymgpipe/__init__.py, i.e., __version__ = "v0.16.0". At that point, I would add from pymgpipe import __version__ in the setup.py to access the software version, without the need to read a file. And you can get rid of the .VERSION file now;
  4. now that you have your package available in pypi, it would be extremely easy to define a Bioconda recipe. At that point, once you have a conda package, you don't have to take care of installing the external dependencies by your own anymore;
  5. on line 65-66, you said that The pymgpipe python package, as well as all associated documentation, tests, and example workflows, can be found at https://korem-lab.github.io/pymgpipe. This is not correct since that page shows the code documentation only. I would reformulate that sentence;
  6. the code documentation seems not complete. Most of the functions are not documented. This must be fixed;
  7. that's great that you provide a Notebook to better explain users how to use the library. The problem here is the lack of notes. I can only see python codes here, but there is no explanation about what you are doing. Please, add a text explaining what you do in every cell of the notebook.

Please, do not close this thread.
I'll update it in case I will have any other comments.

JOSS Review - General Comments

Hi there,

I had a few comments that I think could improve the user experience. Making these changes are not contingent on publishing.

  • Create a dedicated section in the readme with the full install instructions. The install instructions a bit light, while it is current enough to install the package, more detailed instructions would be beneficial. I suggest a full step by step instructions, including the how to use the suggested pyenv. I also suggest not including the local installation example as it can be confusing for beginners.
  • Specify what version(s) of Python is recommended.
  • Update the version in setup.py here https://github.com/korem-lab/pymgpipe/blob/main/setup.py#L5
  • Add more information on how to generate/find taxa models

Well done on creating this great tool and publishing.

Regards,

Ammar

License issue with included MICOM code

Hi,

Since you copied some of the MICOM source code into your software I just wanted to point out that MICOM's Apache 2.0 license is not compatible with the CC-BY license you applied to your project. So you would need to transfer your project to a compatible license if you want to use MICOM source code in your codebase. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.