schoenerd

Schoener's D index calculator for niche overlap.

https://github.com/marcoradocchia/schoenerd

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.6%) to scientific vocabulary

Keywords

d-index index niche niche-d niche-overlap overlap rust schoener schoener-d schoener-d-index schoener-index
Last synced: 6 months ago · JSON representation ·

Repository

Schoener's D index calculator for niche overlap.

Basic Info
  • Host: GitHub
  • Owner: marcoradocchia
  • License: gpl-3.0
  • Language: Rust
  • Default Branch: master
  • Homepage:
  • Size: 58.6 KB
Statistics
  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Topics
d-index index niche niche-d niche-overlap overlap rust schoener schoener-d schoener-d-index schoener-index
Created over 2 years ago · Last pushed over 2 years ago
Metadata Files
Readme Funding License Citation

README.md

schoenerd

![GitHub releases](https://img.shields.io/github/downloads/marcoradocchia/schoenerd/total?color=%23a9b665&logo=github) ![GitHub source size](https://img.shields.io/github/languages/code-size/marcoradocchia/schoenerd?color=ea6962&logo=github) ![GitHub open issues](https://img.shields.io/github/issues-raw/marcoradocchia/schoenerd?color=%23d8a657&logo=github) ![GitHub open pull requests](https://img.shields.io/github/issues-pr-raw/marcoradocchia/schoenerd?color=%2389b482&logo=github) ![GitHub sponsors](https://img.shields.io/github/sponsors/marcoradocchia?color=%23d3869b&logo=github) ![Crates.io downloads](https://img.shields.io/crates/d/schoenerd?label=crates.io%20downloads&logo=rust) ![Crates.io version](https://img.shields.io/crates/v/schoenerd?logo=rust&color=%23d8a657) ![GitHub license](https://img.shields.io/github/license/marcoradocchia/schoenerd?color=%23e78a4e)

Packaging status

Schoener's D index calculator for niche overlap.

math D_{ij} = 1 - \frac{1}{2} \sum_{k = 1}^{S} \left\lvert P_{ik} - P_{jk} \right\rvert

schoenerd is a CLI program designed to compute the Schoener's D Index for niche overlap between pairs of species[^1] exploiting a common resource.

Installation

Build from source[^2]

The following building instructions compile and install schoenerd from the git master branch. They assume the Rust stable toolchain (or any version >= 1.70.0) installed on the system[^3], as well as the just command runner.

sh git clone https://github.com/marcoradocchia/schoenerd cd schoenerd just build sudo just install

By default, installation prefix is set to /usr/local. To use a different installation prefix, specify it via the PREFIX environment variable as PREFIX=<prefix> sudo just install, where <prefix> is a placeholder for the desired path.

NOTE: The install recipe in the justfile is Linux-specific and not available on other platforms. In order to install schoenerd on a non-Linux platform, manual installation of the build artifacts (binary, completions, manpage, etc.) is required.

GitHub releases

Pre-compiled binary[^4] of the latest release, as well as shell completion scripts[^5] and manpage are available in GitHub releases.

Cargo

Installing with Rust's cargo package manager is available on any platform (Linux, Windows, macOS, etc.).

NOTE: cargo installs the schoenerd binary in $CARGO_HOME/bin, however it ignores shell completions and manpage. If you need either of those, consider using one of the other installation options.

Master Branch

Build and install with cargo on any platform from git master branch:

sh cargo install --git https://github.com/marcoradocchia/schoenerd --branch master

crates.io

Build and install with cargo on any platform from latest release:

sh cargo install schoenerd

Arch User Repository

For Arch Linux users, packages are available in the Arch User Repository: - schoenerd: builds from source, from latest release; - schoenerd-bin: pre-compiled binary[^4] of the latest release; - schoenerd-git: builds from source, from git master branch.

WARNING: schoenerd, schoenerd-bin & schoenerd-git AUR packages are mutually exclusive and conflict with each other.

You may install one of the above packages using an AUR helper, such as yay:

sh yay -S schoenerd-bin # or `schoenerd`, or `schoenerd-git`

or paru:

sh paru -S schoenerd-bin # or `schoenerd`, or `schoenerd-git`

Usage

schoenerd accepts input data either from stdin or input file (using the -i/--input option) and produces output either to stdout or output file (using the -o/--output option). This allows schoenerd to be used as a standalone program or inside a UNIX pipeline, which makes it suitable for usage along with other programs or inside scripts.

Input format

Input data must be formatted as a Comma Separated Value table. Take as an example the data table below:

| | Bombus lapidarius | Bombus mesomelas | Bombus pascuorum | Bombus pratorum | | --------------------------- | ----------------------- | ---------------------- | ---------------------- | --------------------- | | Carduus chrysacanthus | 0 | 0 | 0 | 1 | | Carlina acaulis | 0 | 0 | 1 | 0 | | Stachys germanica | 18 | 5 | 14 | 134 | | Trifolium pratense | 0 | 1 | 0 | 1 | | Trifolium repens | 0 | 4 | 0 | 6 | | Oxytropis campestris | 3 | 153 | 0 | 53 |

If one wanted to calculate the Schoener's D Index for each pair of pollinators, column headers of the table should contain each pollinator species, while row headers should contain each of the plant species representing the available resources. Each intersection cell must represent a non-negative integer value describing the interaction between each plant/pollinator pair (e.g. number of visits).

schoenerd requires such a table to be serialized in a CSV format, like below:

,Bombus pratorum,Bombus lapidarius,Bombus mesomelas,Bombus pascuorum Carduus chrysacanthus,1,0,0,0 Carlina acaulis,0,0,0,1 Stachys germanica,134,18,5,14 Trifolium pratense,1,0,1,0 Trifolium repens,6,0,4,0 Oxytropis campestris,53,3,153,0

Output format

By default schoenerd produces CSV formatted output as shown below:

FIRST SPECIES,SECOND SPECIES,D INDEX Bombus pratorum,Bombus lapidarius,0.8300366300366301 Bombus pratorum,Bombus mesomelas,0.3321378008494573 Bombus pratorum,Bombus pascuorum,0.6871794871794872 Bombus lapidarius,Bombus mesomelas,0.17353198948290982 Bombus lapidarius,Bombus pascuorum,0.8571428571428571 Bombus mesomelas,Bombus pascuorum,0.030674846625766916

Each record (line) of the output data contains three fields described by the CSV headers: first two fields contain the two pollinator species of which the D index is reported in the third field.

Pretty table

Using the -p/--pretty-table flag the output is formatted into a table for quick data visualization. Using the same input above, the produced result is an ASCII version of the following table:

| FIRST SPECIES | SECOND SPECIES | D INDEX | | ----------------------- | ----------------------- | -------------------- | | Bombus pratorum | Bombus lapidarius | 0.8300366300366301 | | Bombus pratorum | Bombus mesomelas | 0.3321378008494573 | | Bombus pratorum | Bombus pascuorum | 0.6871794871794872 | | Bombus lapidarius | Bombus mesomelas | 0.17353198948290982 | | Bombus lapidarius | Bombus pascuorum | 0.8571428571428571 | | Bombus mesomelas | Bombus pascuorum | 0.030674846625766916 |

Help

Output of schoenerd -h listed below:

``` schoenerd v0.1.0 - Marco Radocchia marco.radocchia@outlook.com, Gaia Di Francescantonio gaiadfa@virgilio.it Schoener's D index calculator for niche overlap.

Usage: schoenerd [OPTIONS]

Options: -i, --input Input CSV file path -f, --input-field-delimiter Input CSV field delimiter -t, --input-record-terminator Input CSV record terminator -c, --input-quote-character Input CSV quote character -o, --output Output CSV file path -F, --output-field-delimiter Output CSV field delimiter -T, --output-record-terminator Output CSV record terminator -C, --output-quote-character Output CSV quote character -n, --disable-output-headers Disable output headers -s, --sort Sort output by D index value [possible values: descending, ascending] -p, --pretty-table Display output as a pretty table on stdout -h, --help Print help (see more with '--help') -V, --version Print version ```

License

This project is licensed under GPLv3.

[^1]: Schoener, T.W. (1968) Anolis lizards of Bimini: resource parti tioning in a complex fauna. Ecology, 49, 704–726. [^2]: schoenerd compiles on all platforms (Linux, Windows, macOs, ...) as long as rust and just are correctly installed, however installation recipes in the justfile are currently Linux only. [^3]: Install using rustup. [^4]: Currently x86_64-linux-gnu only. [^5]: Currently zsh, bash & fish.

Owner

  • Name: Marco Radocchia
  • Login: marcoradocchia
  • Kind: user
  • Location: Italy

I'm a physics student with real enthusiasm in computers and free and open source software.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Radocchia"
  given-names: "Marco"
- family-names: "Di Francescantonio"
  given-names: "Gaia"
title: "schoenerd"
version: 0.1.0
date-released: 2023-06-10
url: "https://github.com/marcoradocchia/schoenerd"

GitHub Events

Total
Last Year

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 20
  • Total Committers: 1
  • Avg Commits per committer: 20.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Marco Radocchia m****a@o****m 20

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cargo 1,334 total
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
crates.io: schoenerd

Schoener's D index calculator for niche overlap.

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1,334 Total
Rankings
Dependent repos count: 30.3%
Dependent packages count: 31.7%
Stargazers count: 39.1%
Forks count: 41.2%
Average: 47.8%
Downloads: 96.8%
Maintainers (1)
Last synced: 6 months ago