Skip to content

Latest commit

 

History

History
85 lines (63 loc) · 5.11 KB

readme.md

File metadata and controls

85 lines (63 loc) · 5.11 KB

Tests passing: Python Testing

Code coverage: codecov

Introduction

Note: This repository is intended for teaching purposes. It contains deliberately introduced errors, do not use it for any real world use. Use the upstream repository https://github.com/colinsauze/pl_curves instead.

This program calculates Pareto–Lorenz (PL) curves for calculating the relative abundance of different bacteria in a community. It also calculates a Gini coefficient to show how evenly distributed the different bacteria are. There are tests written for most functions. Your task is to:

  1. Fork this repository
  2. Fix the badge path and test github actions
    • Edit the URL at the top of this file to be your repository, not CDT-AIMLAC or:
      • Click on the actions tab and choose the "Python testing" workflow.
      • Press the 3 horizontal dots on left side and click "Create status badge".
      • Copy the markdown and replace the code on line 2 of this file with it.
    • Commiting a change to this file will cause the Github Actions to run.
    • The first run will take a few minutes to start, subsequent runs should be quicker. The first run will also fail due to some broken tests. Sometimes it will timeout when installing the dependencies, if this happens rerun it manually.
  3. Setup codecov.io Codecov.io reports the test coverage percentage. Github Actions can produce and push reports to codecov. You need to create an account linked to your github page at https://codecov.io/login/gh.
    • Click on your user name and choose "add repository"
    • Find the pl_curves repository and go to Settings->Badge, copy the markdown and replace the codecov badge link on line 4 of this file.
  4. Upgrade to the most recent version of Pandas, Matplotlib and Pytest.
  5. Fix the broken tests.
  6. Add python 3.10 and 3.11 as target languages in the .github/workflows/main.yml file, fix any errors which result from this.
  7. Upgrade the operating system being tested from Ubuntu 20.04 to Ubuntu 22.04.

Scientific Background

A program for graphically describing the evenness of bacterial communities using Pareto–Lorenz (PL) curves, by plotting the cumulative relative abundance against the cumulative proportion of each taxonomical bins (based on e.g. T-RFs , OTUs). The more the plotted line deviates from the 1:1 line (45° diagonal), the lower the evenness of the community.

For each sample individually, empty bins are removed and the remaining bins are sorted in decreasing order of relative abundance. The cumulative relative abundance (range 0-1) and cumulative proportion of bins (range 0-1) are calculated and the data plotted so that the first (left most) data point represents the contribution of the bin with the highest relative abundance. Data for all samples in the imported data set are plotted on the same graph, to facilitate comparisons between samples.

The program also calculates the Gini-coefficient for each community, which describes the evenness of a community as the ratio of the area between the PL curve and the equality line and the whole triangular area above the equality line. The Gini coefficient ranges from 0 (perfect evenness) to 1 (perfect unevenness). The reported Gini coefficient has been corrected for the number of taxonomical units in the sample by multiplying the ratio with n/(n-1).

This implements the method described in the following papers:

Possible interactions between bacterial diversity, microbial activity and supraglacial hydrology of cryoconite holes in Svalbard" by Arwyn Edwards, Alexandre M Anesio, Sara M Rassner, Birgit Sattler, Bryn Hubbard, William T Perkins, Michael Young & Gareth W Griffith in The ISME Journal volume 5, pages 150–160 (2011) https://www.nature.com/articles/ismej2010100

and

Can the Bacterial Community of a High Arctic Glacier Surface Escape Viral Control?" by Sara M. E. Rassner, Alexandre M. Anesio, Susan E. Girdwood, Katherina Hell, Jarishma K. Gokul, David E. Whitworth and Arwyn Edwards in Frontiers in Microbiology 21 June 2016 https://doi.org/10.3389/fmicb.2016.00956

Citing this software

If you are using this software in an academic paper then please cite it. A machine readable citation.cff file and BibTex (citation.bib) file can also be found in this repository.

Colin Sauze and Sara Rassner, 2019, "PA script for generating Pareto–Lorenz (PL) curves", https://doi.org/10.5281/zenodo.2628856

DOI

Build Status

This software is automatically tested by Github Actions after each build. Its current status is shown below: Build Status

codecov