Skip to content

Repository files navigation

NailScan

License: MIT

NailScan uses nail (Nail is an Alignment Inference tooL) to run fast profile HMM searches against InterPro member databases (Pfam, NCBIfam, SUPERFAMILY, PANTHER, Gene3D). Nail uses MMseqs2 for seeding and approximates the HMMER3 Forward/Backward algorithm, giving large speed-ups over a standard HMMER search.

NailScan is not meant to reproduce identical results to InterProScan or to replace it. It is intended as a faster alternative for HMM-based protein annotation where throughput and scalability matter more than exact parity. NailScan is still under development. Benchmarking Arabidopsis InterProScan with NailScan resulted in an average 0.95 F1 score for the five member databases in just over 20 minutes.

Disclaimer: NailScan is not affiliated with nail, InterPro, or any member database. Results are post-processed similarly to InterProScan's filtering conventions as closely as possible, but many differences exist.

References


Quick start

1. Create the conda environment

conda env create -f environment.yml
conda activate nailscan

2. Install nail and HMM databases

./install.sh

This will:

  • Clone and build nail (requires Rust; only needed at install time).
  • Download the five enabled HMM databases from the EBI FTP into data/.
  • Pre-process the SUPERFAMILY HMM file (add COMPO lines required by nail, remove single-node models).
  • Download InterPro / GO mapping files for --iprlookup / --goterms.

To install only specific databases:

NAILSCAN_DBS="pfam ncbifam" ./install.sh

3. Run annotation

Single FASTA → one merged TSV:

./nailscan.single.sh -f sequences.fasta -b myrun
# → results/myrun.tsv

Directory of genome FASTAs → one gzipped TSV per genome:

./nailscan.batch.sh -b mybatch -f path/to/fasta_dir/
# → results/mybatch/<genome_id>.tsv.gz

Both scripts require -b (output base name). Run with --help for all options.


Supported databases

Five InterPro member databases are enabled by default. Each uses database-specific post-processing (scripts/add_ipr_go.py) to match InterProScan's filtering approach as closely as possible.

DatabaseInterPro labelFiltering method
PfamPfamGA domain + sequence thresholds; clan-based overlap deduplication
NCBIfamNCBIfamTC sequence threshold
SUPERFAMILYSUPERFAMILYE-value ≤ 1e-3; global per-protein non-overlapping (35% overlap threshold)
PANTHERPANTHERBest hit per protein; family descriptions from PANTHER classifications
Gene3DGene3DBitscore ≥ 10, E-value ≤ 1e-4; global per-protein non-overlapping (20% overlap threshold)

Databases not currently enabled

Several databases present in InterProScan are not enabled by default, either because they require algorithms that cannot be replicated without HMMER's full output, or because the raw HMM search precision appeared too low to be included. They can still be run with --appl <db>, but results will be less reliable.

DatabaseReason disabled
SFLDRequires per-residue active-site matching (sfld_postprocess) using HMMER alignment files that nail does not produce. Without this filter, ~20–25% over-prediction.
HAMAPUses Prosite-matrix normalised scores (N_SCORE) for thresholding, not HMM bit scores; cutoffs are not transferable, causing ~10× over-prediction.
PIRSFHierarchy-aware scoring (length, coverage, parent-suppression) is not fully replicable without InterProScan internals; over-predicts broad parent families ~4×.
PIRSRPIR Site Rules require residue-level functional site detection, not available from a plain HMM search.
PrositeProfiles are in .prf format; no standard conversion to HMMER3 profile HMMs.
SMARTDistributed as HMMER2 format; could be converted but not currently tested.
CDDUses RPS-BLAST, not profile HMMs.
PRINTSFingerprint-based, not HMM-based.
AntiFamIncluded in the download but rarely annotates proteins; enabled with --appl antifam.

See docs/FILTERING.md for detailed filtering logic and docs/INTERPRO_DATABASES.md for HMM format compatibility notes.


Performance

Accuracy vs InterProScan

Benchmarked against InterProScan 5.77-108.0 on the Arabidopsis thaliana Col-0 proteome (35,386 proteins, 72 threads).

DatabaseNailScan predictionsIPR referenceTPFPFNPrecisionRecallF1
Pfam33,75334,83532,6541,0992,1810.9670.9370.952
NCBIfam4,0754,0804,00471760.9830.9810.982
SUPERFAMILY20,17021,49419,7354351,7590.9780.9180.947
PANTHER26,17024,62724,1781,9924490.9240.9820.952
Gene3D23,85025,33023,2066442,1240.9730.9160.944
Overall108,018110,366103,7774,2416,5890.9610.9400.950

HMM database load time: text vs. pre-serialized binary

Nail can pre-serialize HMM databases to a binary format (.nailbin) on first use. Subsequent runs load from the binary, which is significantly faster for large databases.

DatabaseText HMM (s)Binary cache (s)Speedup
Gene3D136.16.720×
PANTHER89.44.420×
NCBIfam70.33.520×
Pfam55.92.721×
SUPERFAMILY33.03.5
AntiFam0.5< 0.1

The binary cache is written automatically on first use; no manual step is required.


Output format

Both scripts produce a tab-separated TSV with one row per domain match:

ColumnDescription
targetProtein / gene identifier
AnalysisDatabase name (e.g. Pfam, Gene3D, SUPERFAMILY)
ACCCanonical accession for the matched model
DESCHuman-readable description
target_startStart position on the protein (1-based)
target_endEnd position on the protein (inclusive)
query_startStart of the alignment on the HMM
query_endEnd of the alignment on the HMM
scoreBit score
biasComposition bias
evalueE-value
cell_fracFraction of DP matrix cells computed by nail
InterProInterPro entry ID (requires --iprlookup)
IPR_descShort description of the InterPro entry (requires --iprlookup)
GOGO term IDs, semicolon-separated (requires --goterms)

Rows are sorted by target (gene ID). Single mode writes results/<base>.tsv; batch mode writes results/<base>/<genome_id>.tsv.gz.


Options

./nailscan.single.sh -f <input.fasta> -b <base> [-o output_dir] [-t threads]
[--appl pfam,ncbifam,...] [--iprlookup] [--goterms]
./nailscan.batch.sh -b <base> [-f fasta_dir] [-o results_dir] [-t threads]
[--batch-size N] [--appl pfam,ncbifam,...] [--iprlookup] [--goterms]
FlagDescriptionDefault
-fInput FASTA (single) or directory of FASTAs (batch)fasta/
-bOutput base name (required)
-oOutput root directoryresults/
-tThreadsnproc
-dData directorydata/
--applComma-separated list of databases to runall enabled
--batch-sizeGenomes per nail call in batch mode (0 = all)0
--iprlookupAdd InterPro and IPR_desc columnsoff
--gotermsAdd GO columnoff

Configuration

config.json lists all databases with their EBI FTP URLs, MD5 checksums, and expected HMM filenames. Databases with "enabled": false are skipped by default but can still be downloaded and run with --appl.

install.sh reads config.json to download and prepare each database. Run ./install.sh from the repo root with the nailscan conda environment active.


Repository layout

PathPurpose
config.jsonDatabase download URLs and enabled/disabled status
install.shDownloads databases; builds nail; sets up mapping files
nailscan.single.shAnnotates a single FASTA; writes one merged TSV
nailscan.batch.shWrapper that calls nailscan.single.sh per batch of genomes
environment.ymlConda environment (Python, Rust, MMseqs2, HMMER)
scripts/add_ipr_go.pyDatabase-specific filtering and InterPro/GO annotation
scripts/benchmark.pyCompare NailScan output against InterProScan reference
scripts/download_interpro_mappings.shDownloads InterPro/GO mapping files
scripts/cath-resolve-hitsGene3D DP domain architecture solver (from InterProScan)
scripts/assign_cath_superfamilies.pyGene3D G3DSA mapping script (from InterProScan)
scripts/sfld_postprocessSFLD active-site filter binary (from InterProScan; requires HMMER output)
docs/FILTERING.mdDetailed filtering logic for each database
docs/INTERPRO_DATABASES.mdHMM format compatibility notes

Contributors

  • Elly Poretsky (@eporetsky)
  • Contributions and collaborations welcome - open an issue or pull request.

About

Fast and scalable profile HMM search against InterPro member databases

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages