Permutation-based test for copy-number and binary trait association
Project description
permucn
permucn is a command-line tool for testing whether trait transitions (0->1, optionally 1->0) are associated with gene-family copy-number evolution from CAFE outputs.
In binary mode, you can choose either permutation-based testing or Fisher's exact test with Tarone screening.
Install
Requirements: Python >=3.12
pip install permucn
Optional plot support:
pip install "permucn[plots]"
Conda / Bioconda:
conda install -c conda-forge -c bioconda permucn
Quick Start
- Fetch sample data:
permucn get-test-data --out-dir permucn_test_data
- Run
permucn:
permucn \
--cafe-dir permucn_test_data/toy_example/cafe_output \
--trait-tsv permucn_test_data/toy_example/species_trait.tsv \
--no-include-trait-loss \
--n-perm-initial 20 \
--n-perm-refine 50 \
--seed 7 \
--out-prefix results/toy_binary
- Check outputs:
results/toy_binary.family_results.tsvresults/toy_binary.run_metadata.jsonresults/toy_binary.top_hits.tsvresults/toy_binary.top_pvalues.tsv(default: top 100 by p-value)
If at least one tested family has p-values, these are also written:
results/toy_binary.pvalue_hist.tsvresults/toy_binary.qq.tsv
For a larger sample dataset:
permucn get-test-data --dataset polar_fish --out-dir permucn_test_data
permucn \
--cafe-dir permucn_test_data/polar_fish/cafe_output \
--trait-tsv permucn_test_data/polar_fish/species_trait.tsv \
--jobs 4 \
--perm-cache results/perm_cache.json.gz \
--out-prefix results/polar_fish
Required Inputs
--cafe-dir must include:
Gamma_change.tab(required)Gamma_asr.tre(required)Gamma_branch_probabilities.tab(required only with--cafe-significant-only)Gamma_family_results.txt(optional)
--trait-tsv must be a TSV with:
- one species column (
species,taxon,name, etc.; first column fallback) - one binary trait column (
0/1)
Important rules:
- Species names in trait TSV must match tree tip names.
- If multiple binary trait columns exist, specify
--trait-column. --cafe-significant-onlyis valid only inbinarymode.ratemode requires strictly positive non-root branch lengths.
Common Commands
Default binary mode:
permucn --cafe-dir <cafe_output_dir> --trait-tsv <trait.tsv> --out-prefix results/binary
Binary mode with CAFE-significant events only:
permucn --cafe-dir <cafe_output_dir> --trait-tsv <trait.tsv> --cafe-significant-only --out-prefix results/binary_sig
Binary mode with Fisher + Tarone:
permucn \
--cafe-dir <cafe_output_dir> \
--trait-tsv <trait.tsv> \
--binary-test fisher-tarone \
--out-prefix results/binary_fisher
Rate mode:
permucn --cafe-dir <cafe_output_dir> --trait-tsv <trait.tsv> --mode rate --out-prefix results/rate
Reproducibility and Performance
--seed: reproducible permutations--jobs: parallelism (1sequential,0auto CPU)--perm-cache: reuse permutations across runs (.json/.json.gz)--pvalue-top-n: size of*.top_pvalues.tsv(0disables)
Documentation
- wiki/Getting-Started.md
- wiki/CLI-Reference.md
- wiki/Input-Format.md
- wiki/Output-Interpretation.md
- wiki/Algorithm-Notes.md
- wiki/FAQ.md
License
MIT (LICENSE)
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file permucn-0.1.1.tar.gz.
File metadata
- Download URL: permucn-0.1.1.tar.gz
- Upload date:
- Size: 41.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c0141ca5bc6b1fd32124f3aeea7caab804019dbc848834e20afad8a8faac8db
|
|
| MD5 |
34b7b0878bc0417ccd76549995844050
|
|
| BLAKE2b-256 |
3072d335a022577bbbc6a198f005847ffd3bbbdd0fdee770343e06df98f42b2c
|
Provenance
The following attestation bundles were made for permucn-0.1.1.tar.gz:
Publisher:
publish-pypi.yml on mkrg01/permucn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
permucn-0.1.1.tar.gz -
Subject digest:
2c0141ca5bc6b1fd32124f3aeea7caab804019dbc848834e20afad8a8faac8db - Sigstore transparency entry: 1065656340
- Sigstore integration time:
-
Permalink:
mkrg01/permucn@b19803776704162dd0ae8b9ffbf7ecfe23f337f2 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/mkrg01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b19803776704162dd0ae8b9ffbf7ecfe23f337f2 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file permucn-0.1.1-py3-none-any.whl.
File metadata
- Download URL: permucn-0.1.1-py3-none-any.whl
- Upload date:
- Size: 36.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dde3b41030c42051c38f761dd0be86d02518e00a8debcf221deb1fa094becb3b
|
|
| MD5 |
a4fee5379b0d6b183e8925f83b95fac2
|
|
| BLAKE2b-256 |
55a0305149add5961ea186b3f83b73fe752ccb763f44cfbaa6e0a0192624337e
|
Provenance
The following attestation bundles were made for permucn-0.1.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on mkrg01/permucn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
permucn-0.1.1-py3-none-any.whl -
Subject digest:
dde3b41030c42051c38f761dd0be86d02518e00a8debcf221deb1fa094becb3b - Sigstore transparency entry: 1065656343
- Sigstore integration time:
-
Permalink:
mkrg01/permucn@b19803776704162dd0ae8b9ffbf7ecfe23f337f2 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/mkrg01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b19803776704162dd0ae8b9ffbf7ecfe23f337f2 -
Trigger Event:
workflow_dispatch
-
Statement type: