Skip to main content

Travis Coverage PyPI Documentation Status

StrainChoosr

StrainChoosr examines phylogenetic trees and will give you the X strains that represent the most diversity within your tree. Given today’s deluge of sequencing data, picking strains to do more detailed analysis on can be difficult. Using this tool ensures you’ll have the maximum amount of diversity possible in your scaled down set of sequences. The algorithm behind it is described in Pardi2005 and Steel2005 so please be sure to cite them if you use StrainChoosr.

Installation

StrainChoosr lives on PyPI. Install the core package for the selection API:

pip install strainchoosr

The CLI, tree visualizations, and graphical interface require the optional visualization dependencies:

pip install "strainchoosr[visualization]"

Alternatively, install the latest version from git with those dependencies. Note that there may be breaking changes pushed to the repository, so this isn’t necessarily advised.

pip install "strainchoosr[visualization] @ git+https://github.com/OLC-Bioinformatics/StrainChoosr.git"

Quickstart

To use StrainChoosr, all you need is a newick-formatted tree file. To pick the 5 most diverse strains from a tree, type the following on the command line:

strainchoosr --treefile /path/to/tree.nwk --number 5

This will print the names of the 5 most diverse strains in your tree to the terminal, as well as create a file called strainchoosr_output.html in your current working directory that lets you visualize the output in any web browser.

To do the same within python:

from strainchoosr import strainchoosr
strainchoosr.run_strainchoosr(treefile='/path/to/tree.nwk', number_representatives=[5])

In addition to printing the strains to terminal, run_strainchoosr will return a dictionary where keys are the number of representatives and values are lists of the strains selected for that number of representatives.

Alternatively, if all you want to get is the list of strains and not generated html reports:

from strainchoosr import strainchoosr
import ete3
tree = ete3.Tree('path/to/treefile.nwk')
diverse_strains = strainchoosr.pd_greedy(tree=tree, number_tips=5, starting_strains=[])

This will get you a list of ete3.TreeNode objects that represent the 5 most diverse possible strains. You can then use strainchoosr.get_leaf_names_from_nodes(diverse_strains) to get a list of names.

Complete documentation on the strainchoosr API can be found at https://strainchoosr.readthedocs.io/api.html.

Issues and Pull Requests

If you have any problems or want a feature implemented, please feel free to open an issue. Similarly, if you want to add a feature or otherwise improve things, feel free to open a pull request.

Metadata

Release files for strainchoosr 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for strainchoosr 0.1.7
File Size Uploaded Provenance Actions
strainchoosr-0.1.7.tar.gz 16.8 kB Without provenance Details for strainchoosr-0.1.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for strainchoosr 0.1.7
File Interpreter ABI Platform Actions
strainchoosr-0.1.7-py3-none-any.whl Python 3 none any Details for strainchoosr-0.1.7-py3-none-any.whl

Total release size: 31.0 kB

Release files / strainchoosr-0.1.7.tar.gz

Download URL strainchoosr-0.1.7.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
89b65f79e5df3fdef6cd74c9dd215bb65508cafe6f059479bee3e71c647bfc40
BLAKE2b-256 checksum
How to use checksums
da2415ea5d21ebea9b8bba5d40875fd1804624dcdf9ba1e35a6dcb5ba289bdb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.2

Release files / strainchoosr-0.1.7-py3-none-any.whl

Download URL strainchoosr-0.1.7-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
478244d4973216c668168608549ac0327461d0921895863a4c23bb3092f2c700
BLAKE2b-256 checksum
How to use checksums
f2d7e1192c849ee3af8d91193665bd987417f4d5f7cc2d371b3937387c93ff7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.2

Security for strainchoosr 0.1.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page