Skip to main content

SimPhyni: a tool for phylogenetic trait simulation and inference.

Project description

SimPhyNI

Overview

SimPhyNI (Simulation-based Phylogenetic iNteraction Inference) is a phylogenetically-aware framework for detecting evolutionary associations between binary traits (e.g., gene presence/absence, major/minor alleles, binary phenotypes) on microbial phylogenetic trees. This tool leverages phylogenetic infromation to correct for surious associations caused by the relatedness of sister taxa.

This pipeline is designed to:

  • Infer evolutionary parameters for traits (gain/loss rates, time to emergence, ancestral states)
  • Estimate trait co-occurence null models through independent simulation of traits
  • Output statistical results for associations

Getting Started

Installation

First create a new environment:

conda create -n simphyni python=3.11
conda activate simphyni

then install using using PyPI

pip install simphyni

test installation:

simphyni version

Usage

Run mode (single-run)

simphyni run \
  --tree path/to/tree.nwk \
  --traits path/to/traits.csv \
  --runtype 0 \
  --outdir my_analysis \
  --cores 4 \
  --temp_dir ./temp \
  --min_prev 0.05 \
  --max_prev 0.95 \
  --prefilter \
  --plot

Run mode (batch)

Create a samples.csv file like:

Sample,Tree,Traits,RunType,MinPrev,MaxPrev
run1,tree1.nwk,traits1.csv,0,0.05,0.95
run2,tree2.nwk,traits2.csv,1,0.05,0.90

Then execute:

simphyni run --samples samples.csv --cores 8 --temp_dir ./temp

For all run options:

simphyni run --help

Example data

Download and run example inputs using:

simphyni download-examples
simphyni run --samples example_inputs/simphyni_sample_info.csv --cores 8 --prefitler --plot

Outputs

Outputs are placed in structured folders in the working directory or specified output directory in the 3-Objects/ subdirectory, including:

  • simphyni_result.csv contianing all tested trait pairs with their infered interaction direction, p-value, and effect size
  • simphyni_object.pkl containinf the completed analysis, parsable with the attached environment (not recommended for large analyses, > 1,000,000 comparisons)
  • heatmap summaries of tested associations if --plot is enabled

Directory Structure

SimPhyNI/
├── simphyni/               # Core package
│   ├── Simulation/          # Simulation scripts
│   ├── scripts/             # Workflow scripts
│   └── envs/simphyni.yaml   # Conda environment (used in snakemake)
├── conda-recipe/           # Build recipe 
├── snakemake_cluster_files # Cluster configs for Snakemake
└── pyproject.toml

Contact

For questions, please open an issue or contact Ishaq Balogun at https://github.com/jpeyemi.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simphyni-0.1.1.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simphyni-0.1.1-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file simphyni-0.1.1.tar.gz.

File metadata

  • Download URL: simphyni-0.1.1.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.23

File hashes

Hashes for simphyni-0.1.1.tar.gz
Algorithm Hash digest
SHA256 93d40eb71a2d538021a46fe109bcc4fc06fc28bed3a102fee1b9db3386ea769d
MD5 d5da08cc544c7ada932db15f4f370648
BLAKE2b-256 6d29490c4434fa335fd5a76fa7ae73a58a04163ea3790eaf42ef402c6b82677f

See more details on using hashes here.

File details

Details for the file simphyni-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: simphyni-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 26.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.23

File hashes

Hashes for simphyni-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5916fc1a4f00d16b0d3cd418e87794de24a0c3f76fa40cb61f44fdd27a32c111
MD5 0282f5de19f8fb40978d044b5179cf53
BLAKE2b-256 b6d9bb492156aba4bb454dc4db44d646a6f2d9efed97b0f6d3ffc69f4d477235

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page