semvec/pypi-packages huggingface dataset:
endstone-bstats 0.1.0
bStats Metrics for Endstone Plugins
Requires Python: >=3.9
Keywords: bstats, endstone, metrics, minecraft

# endstone-bstats

`endstone-bstats` is a Python library that provides functionality for integrating bStats metrics into your Endstone
plugins. It is designed to be simple, extensible, and lightweight.

## Features

- Supports various types of charts, including:
    - Simple Pie
    - Advanced Pie
    - Drilldown Pie
    - Single Line
    - Multi Line
    - Simple Bar
    - Advanced Bar
- Easy-to-use APIs for collecting and sending metric data.
- Designed for flexibility and extensibility.

## Installation

Install the package using pip:

```bash
pip install endstone-bstats
```

## Quick start

[bStats](https://bstats.org/getting-started) is a free and open source website that helps you to collect usage data for
your plugin. Integrating bStats into your plugin is straight forward and done in a matter of seconds.

Here’s a simple example of how to add bStats to your plugin.

```python
from endstone.plugin import Plugin
from endstone_bstats import Metrics


class ExamplePlugin(Plugin):
    def on_enable(self):
        plugin_id = 1234  # <-- Replace with the id of your plugin!
        self._metrics = Metrics(self, plugin_id)

    def on_disable(self):
        self._metrics.shutdown()
```

After adding bStats to your plugin you have to [create an account](https://bstats.org/register) to register your plugin.
You can manage your plugins with this account, e.g. adding customs graphs, etc.

## Add custom charts

Adding charts to your plugin consists of two parts:

- Adding charts to your code
- Adding charts on the website

To add a chart on the website, check the [detailed instructions here](https://bstats.org/help/custom-charts).

A **Simple Pie** is the most basic chart type. It's a great option for config settings as it only accepts one value per
server. Adding the chart to your code is fairly easy:

```python
from endstone.plugin import Plugin
from endstone_bstats import Metrics, SimplePie


class ExamplePlugin(Plugin):
    def on_enable(self):
        plugin_id = 1234  # <-- Replace with the id of your plugin!
        self._metrics = Metrics(self, plugin_id)
        self._metrics.add_custom_chart(
            SimplePie("used_language", lambda: "en_US")
        )

    def on_disable(self):
        self._metrics.shutdown()
```

## Contributing

We welcome contributions! Feel free to open an issue or submit a pull request to improve the library.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

## Acknowledgments

This library is inspired by [bStats for Java](https://bstats.org/), ported by the EndstoneMC team to Python.
PhyloFunc 1.0.7
Generate PhyloFunc to incorporate microbiome phylogeny to inform on metaproteomic functional distance.

# 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