B²Filter
B²Filter is a Python package for research-oriented filtering and prioritization of genetic variants, with a B²Pred ranking module. It is designed for programmatic use and Linux command-line workflows; it has no graphical interface and does not import Tkinter.
Research-use notice: B²Filter is a research software tool, not a medical device or a stand-alone clinical diagnostic system. Candidate prioritization requires expert review, validation, and interpretation in the context of phenotype, inheritance, sequencing quality, and current evidence.
Installation
Python 3.9 or newer is required.
python -m pip install b2filter
The package name on PyPI is lowercase (b2filter), while the Python import is case-sensitive:
import B2Filter
Python API
import B2Filter
result = B2Filter.run(
input_file="sample_variants.csv",
output_dir="results",
pubmed=True,
top_n=5,
)
print(result["report"])
print(result["ranked"].head())
You can also pass a pandas DataFrame:
import pandas as pd
import B2Filter
variants = pd.read_csv("sample_variants.csv")
result = B2Filter.run_dataframe(
variants,
output_dir="results",
pubmed=False, # no external HGNC/PubMed requests
)
Linux command line
b2filter sample_variants.csv --output-dir results
Disable external PubMed/HGNC requests:
b2filter sample_variants.csv --output-dir results --no-pubmed
Input
The input is expected to be a tabular annotation file containing the columns used by the original B²Filter workflow. The required fields are validated before processing. Common CSV, TSV and tab-delimited VCF-like exports are supported; raw VCF files with INFO-field annotations are not automatically converted into the expected annotation table.
Required columns include REF, ALT, POSITION, SYMBOL, GENOTYPE, IMPACT, BIALLELIC, CANONICAL, Consequence, gnomADe_AF, GTEX_testis_RATIO, SIFT, PolyPhen, am_pathogenicity, SpliceAI_DS, and KNOWN_CANDIDATE_GENE.
Output
The Excel report contains:
B²Pred: ranked candidate variants (Top 5 by default)HV-H,HV-MH,HET-bH,HET-bMH,Kn-bML,Kn-nb,CNV: category-specific tablesConclusion: summary sheet
Where the necessary columns are available, database hyperlinks are added for gnomAD, GTEx, ClinVar, OMIM, PubMed and UCSC.
External services
When pubmed=True, B²Filter queries HGNC and NCBI PubMed over the internet to calculate PubScoreStrg. Network failures are handled by assigning a score of zero for the affected gene; this means results may differ when external services are unavailable or their databases change. For reproducible analyses, archive input files, package version, parameters, date, and external annotation results. You can set pubmed=False to disable these requests.
Compatibility
The package metadata declares Python 3.9+. Compatibility should be verified in the target environment using the included tests. It is not technically possible to guarantee compatibility with every Python/Linux distribution or every version. The package avoids Tkinter and platform-specific GUI dependencies.
Development and tests
git clone https://github.com/YOUR_GITHUB_USERNAME/B2Filter.git
cd B2Filter
python -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[dev]"
pytest
Citation
If you use B²Filter in a scientific publication, cite the versioned release and its archived DOI (for example, Zenodo) once created. Do not cite an untagged development branch as the stable release.
License
MIT. Review authorship, institutional ownership, and permissions before publishing the repository under this license.
Metadata
Release files for b2filter 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| b2filter-1.0.1.tar.gz | 14.8 kB | Without provenance | Details for b2filter-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| b2filter-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for b2filter-1.0.1-py3-none-any.whl |
Total release size: 28.6 kB
Release files / b2filter-1.0.1.tar.gz
| Download URL | b2filter-1.0.1.tar.gz |
|---|---|
| Size | 14.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eeadf27fa3904bfec6a628cc58ac1d00848af7a8b1e108a38e9171fd8b7726f5
|
|
BLAKE2b-256 checksum How to use checksums |
63bf8f5795a266bca2fc78991583f0283e18a848140cb7378c145b2d9b111ba9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.3
|
Release files / b2filter-1.0.1-py3-none-any.whl
| Download URL | b2filter-1.0.1-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9b3b8a9cf8e105345e800c7560bec2291d181930e1e58aaa83c44cc893826787
|
|
BLAKE2b-256 checksum How to use checksums |
e2ae6c4ec2a34847b4dbfcf8caf6b6f02c353beadc0c3aeea556d0fb05de2cbc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.3
|
Security for b2filter 1.0.1
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.