Metadata-Version: 2.1
Name: phylofunc
Version: 1.0.9
Summary: Generate phylofunc to incorporate microbiome phylogeny to inform on metaproteomic functional distance.
Author: Luman Wang
Author-email: wangluman@bjmu.edu.cn
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE.txt

# phylofunc

'phylofunc' is a Python package for generating phylofunc to incorporate microbiome phylogeny to inform on metaproteomic functional distance. 
It enables efficient calculation of functional beta-diversity distances between sample pairs and generates comprehensive distance metrics across multiple samples.

## Installation of package

You can install this package via pip:  
pip install phylofunc

## Usage
Once installed, you can use the phylofunc package in a Python script or an interactive environment.

### Quick Start

#### Import package

from phylofunc import PhyloFunc_distance  
from phylofunc import PhyloFunc_matrix

#### Script
Two input parameters are required. The first is a phylogenetic tree (default: bac120_iqtree_v2.0.1.nwk). The second is a phylogeny-informed Taxon-Function table, which includes columns labeled Taxon, Function, and the names of samples (default: Taxon_Function_distance.csvor Taxon_Function_matrix.csv).

#### 1. Calculate phylofunc distance between sample pairs
PhyloFunc_distance(tree_file='bac120_iqtree_v2.0.1.nwk', sample_file='Taxon_Function_distance.csv')

#### 2. Calculate phylofunc distance matrix across multiple samples
PhyloFunc_matrix(tree_file='bac120_iqtree_v2.0.1.nwk', sample_file='Taxon_Function_matrix.csv')

### Output
phylofunc distance or phylofunc distance matrix can be output.

## Performance optimization
This package improves performance by reducing disk I/O operations and processing data in memory. This enables faster computations with large datasets.

## Project structure
```
phylofunc/  
├── __init__.py  
├── phylofunc.py  
│  └── The main function code.  
├── data/  
│  ├── Taxon_Function_distance.csv
│  │  └── Data file for calculating the distance between two samples. 
│  ├── Taxon_Function_matrix.csv
│  │  └── Data file for calculating distances matrix across multiple samples.  
│  └── bac120_iqtree_v2.0.1.nwk  
│     └── Phylogenetic tree file.  
└── Phylofunc_Package_Tutorial.ipynb
   └── Demonstrates the specific application of this package.
```

## Contribution
Welcome code contributions and improvement suggestions! Feel free to submit an issue or a pull request on GitHub.

## License
This project uses an MIT license. For details, see the LICENSE file.

## Application
For more detailed usage instructions, please refer to the paper：
Wang and Li et al., PhyloFunc: Phylogeny-informed Functional Distance as a New Ecological Metric for Metaproteomic Data Analysis
doi: https://doi.org/10.1101/2024.05.28.596184
