Skip to content

Add load_ppi to panda IO module, complete issue #350#385

Merged
katehoffshutta merged 3 commits intonetZoo:develfrom
marouenbg:fix-panda-io-350-clean
Apr 30, 2026
Merged

Add load_ppi to panda IO module, complete issue #350#385
katehoffshutta merged 3 commits intonetZoo:develfrom
marouenbg:fix-panda-io-350-clean

Conversation

@marouenbg
Copy link
Copy Markdown
Contributor

Summary

Completes the extraction of IO functions from the PANDA class (issue #350) by adding load_ppi() to netZooPy/panda/io.py and wiring it into Panda.processData().

load_motif() and load_expression() were already extracted in a previous commit on devel. This PR adds the missing load_ppi() and removes the last inline IO logic from processData().

Changes (3 files, ~47 additions / ~27 deletions)

  • netZooPy/panda/io.py: Added load_ppi() function (was a commented-out stub).
  • netZooPy/panda/panda.py: Replaced inline PPI reading in processData() with io.load_ppi().
  • netZooPy/panda/__init__.py: Exports load_ppi alongside load_motif and load_expression.

Usage

All three IO functions can now be used independently:

from netZooPy.panda.io import load_motif, load_expression, load_ppi

motif_data, motif_tfs, motif_genes = load_motif('motif_file.txt')
expr_data, expr_genes, expr_samples = load_expression('expression_file.txt')  
ppi_data, ppi_tfs = load_ppi('ppi_file.txt')

Testing

All existing tests pass: test_panda (2 tests), test_puma, test_lioness.

Fixes #350

Add load_ppi() to netZooPy/panda/io.py extracting the inline PPI
reading logic from Panda.processData(). This completes the move of
all IO functions (motif, expression, PPI) outside of the PANDA class.

The functions can now be imported and used independently:
  from netZooPy.panda.io import load_motif, load_expression, load_ppi

Fixes netZoo#350
- condor.py: Use itertuples() instead of iterrows() to avoid
  integer-indexing a string-keyed Series (KeyError: 2).
- test_cobra.py: Convert X to numpy before np.mean() to avoid
  integer-indexing a string-keyed Series (KeyError: 0).
@katehoffshutta
Copy link
Copy Markdown
Contributor

@marouenbg Could you please take a look at these merge conflicts and resolve them if there's a clear resolution? Thanks!

# Conflicts:
#	netZooPy/condor/condor.py
#	netZooPy/panda/panda.py
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 95.65217% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 59.52%. Comparing base (0964f65) to head (0bbcab7).
⚠️ Report is 41 commits behind head on devel.

Files with missing lines Patch % Lines
netZooPy/panda/io.py 92.30% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            devel     #385   +/-   ##
=======================================
  Coverage   59.51%   59.52%           
=======================================
  Files          45       45           
  Lines        3053     3071   +18     
=======================================
+ Hits         1817     1828   +11     
- Misses       1236     1243    +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@katehoffshutta katehoffshutta merged commit 7335a46 into netZoo:devel Apr 30, 2026
10 checks passed
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.

2 participants