Select representative, non-redundant data set from larger set, based on list of pairwise similarities (or distances).
Project description
hobohm: command line program for selecting representative, non-redundant data set from larger set, based on list of pairwise similarities (or distances).
The "Hobohm" algorithm was originally created with the purpose of selecting representative, non-redundant sets of protein data from a larger dataset. Non-redundant (or homology-reduced) here means that the resulting data set should contain no pairs of sequences with high similarity ("neighbors"):
"Selection of representative protein data sets", Protein Sci. 1992. 1(3):409-17.
This command-line program implements algorithm 2 from that paper.
The hobohm
program takes as input (1) a text-file containing a list of pairwise similarities and (2) a cutoff for deciding when two sequences are too similar.
The output (written to stdout) is a list of names that should be kept in the homology-reduced set. The algorithm aims to pick the maximally sized such set, given the cutoff.
It is also possible to use a list of pairwise distances instead of similarities. The cutoff is then interpreted as the minimum distance required in the output data set.
Availability
The hobohm
source code is available on GitHub: https://github.com/agormp/hobohm. The executable can be installed from PyPI: https://pypi.org/project/hobohm/
Installation
python3 -m pip install hobohm
Upgrading to latest version:
python3 -m pip install --upgrade hobohm
Dependencies
There are no dependencies (apart from the python standard library).
Overview
Input:
Option -s: pairwise similarities
(1) A text file containing pairwise similarities, one pair per line. All pairs of names must be listed.
name1 name2 similarity
name1 name3 similarity
...
(2) A cutoff value. Pairs of items that are more similar than this cutoff are taken to be redundant, and at least one of them will be removed in the final output.
Option -d: pairwise distances
(1) A text file containing pairwise distances, one pair per line. All pairs of names must be listed.
name1 name2 distance
name1 name3 distance
...
(2) A cutoff value. Pairs of items that are less distant than this cutoff are taken to be redundant, and at least one of them will be removed in the final output.
Output:
A list of names of items that should be kept in the non-redundant set, written to stdout. This set contains no pairs of items that are more similar (less distant) than the cutoff. The algorithm aims at making the set the maximal possible size. This can occassionally fail if there are multiple items with the same number of "neighbors" and the order of removal of items has an impact.
Usage
Usage: hobohm [-s|-d] FILE -c CUTOFF [-k KEEPFILE]
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-s SIMFILE file with pairwise similarities: name1 name2 sim
-d DISTFILE file with pairwise distances: name1 name2 dist
-c CUTOFF cutoff for deciding which pairs are neighbors
-k KEEPFILE file with names that must be kept (one name per line)
Usage examples
Select items such that max pairwise similarity is 0.65
hobohm -s pairsims.txt -c 0.65 > nonredundant.txt
Select items such that minimum pairwise distance is 10
hobohm -d pairdist.txt -c 10 > nonredundant.txt
Select items such that max pairwise similarity is 0.3, while keeping items in keeplist.txt
hobohm -s pairsims.txt -c 0.3 -k keeplist.txt > nonredundant.txt
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
Built Distribution
File details
Details for the file hobohm-1.0.1.tar.gz
.
File metadata
- Download URL: hobohm-1.0.1.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 810ddeb6b1c215d45055da6a9707210a8cd96f00e0955b2c8b8f35647f207eb9 |
|
MD5 | 7d25111bc2d8265a7cda7e6c27ff21ff |
|
BLAKE2b-256 | 4ed6832329521c35015559a80ff8335e480df568ba828ba41335e79114e974bc |
File details
Details for the file hobohm-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: hobohm-1.0.1-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c67f9e8f42e0416a97390f30eae5077bed767e6e0d531f57bfe14b4c1084d253 |
|
MD5 | 72a1df1bacfacf9b4cc457a14df07ce1 |
|
BLAKE2b-256 | 1ab9511ba36350b7ec00f53c09738e6316b955a7d04bf662a5a6bd1d6ecadd92 |