Skip to content

cdskit localize

Kenji Fukushima edited this page Jul 21, 2026 · 7 revisions

cdskit localize

cdskit localize predicts protein targeting or localization labels from CDS or protein FASTA input. It can use a local model file or a published pretrained model alias.

Examples

Pretrained TargetP-compatible model

The pretrained targeting5 model predicts noTP, SP, mTP, cTP, and lTP. It runs on CPU, but requires the optional ML dependencies (torch and scikit-learn) at runtime.

cdskit localize \
  --seq_file proteins.faa \
  --seq_type protein \
  --model targeting5 \
  --report localize.tsv

Experimental peroxisome-head model

The prerelease alias targeting5-perox-deeploc21-et-v1 adds a CPU-runtime ExtraTrees peroxisome sequence-label head to the targeting5 model. It is strongest for PTS-like peroxisomal targeting signals and should not yet be treated as a broad peroxisome-associated localization detector.

cdskit localize \
  --seq_file proteins.faa \
  --seq_type protein \
  --model targeting5-perox-deeploc21-et-v1 \
  --organism_group non_plant \
  --report localize.tsv

CDS input is translated in frame before prediction:

cdskit localize \
  --seq_file cds.fasta \
  --model targeting5 \
  --report localize.tsv

Local model file

cdskit localize \
  --seq_file proteins.faa \
  --seq_type protein \
  --model localize_model.json \
  --report localize.tsv

Example input and output

Example protein FASTA input:

>seq_sp
MKKLLLLLLLLLLAVAVAASAASA
>seq_mtp
MRRKRRAARAKRRNQAAARRRAA

Example command:

cdskit localize --seq_file proteins.faa --seq_type protein --model targeting5 --report localize.tsv

Example TSV output, with probabilities shortened for readability:

seq_id	predicted_class	p_noTP	p_SP	p_mTP	p_cTP	p_lTP	p_peroxisome	perox_signal_type
seq_sp	SP	0.0004	0.9979	0.0009	0.0004	0.0004	0.0	none
seq_mtp	mTP	0.0742	0.0099	0.9122	0.0007	0.0029	0.0	none

Input requirements

  • CDS input is the default.
  • CDS sequences must be DNA, in frame, and have no internal stop codons.
  • Protein input can be used with --seq_type protein.
  • Use --codon_table INT when translating CDS with a non-standard genetic code.

Key options

  • --seq_file PATH: Input FASTA. Use - for standard input.
  • --seq_type dna|protein: Input sequence type. The default is dna.
  • --model PATH|ALIAS: Model file path or pretrained alias such as targeting5.
  • --report PATH: Output report. Use - for standard output. .json writes JSON; other suffixes write TSV.
  • --organism_group unknown|plant|non_plant: Optional organism group used to constrain plant-only cTP/lTP predictions.
  • --include_features yes|no: Include internal feature values in the output report.
  • --model_download yes|no: Allow checksum-verified downloads for pretrained aliases. The default is yes; use no for offline-only operation.
  • --threads INT: Number of worker threads. 0 uses all detected CPUs.

Output

For the pretrained targeting5 model and other single-label targeting-peptide models, the TSV report includes:

  • seq_id
  • predicted_class
  • p_noTP, p_SP, p_mTP, p_cTP, p_lTP
  • p_peroxisome
  • perox_signal_type

Compatible multi-label models instead write predicted_labels and one probability column per model label.

TSV output is UTF-8, tab-delimited, rectangular, and LF-terminated. JSON output contains the same row objects. p_peroxisome is a separate binary-head score; it does not replace predicted_class. perox_signal_type describes the detected PTS-like signal category when the loaded model provides that feature.

Model aliases

Alias Labels Notes
targeting5 noTP, SP, mTP, cTP, lTP TargetP-compatible pretrained model; downloaded and checksum-verified on first use
targeting5-perox-deeploc21-et-v1 noTP, SP, mTP, cTP, lTP, p_peroxisome Experimental prerelease with a DeepLoc21-trained ExtraTrees peroxisome sequence-label head; downloaded and checksum-verified on first use

Training custom models

cdskit localize-learn can train lightweight custom models from a TSV table or from UniProt entries downloaded by query.

cdskit localize-learn \
  --training_tsv train.tsv \
  --seq_col sequence \
  --label_mode explicit \
  --localization_col localization \
  --perox_col peroxisome \
  --model_out localize_model.json

See cdskit localize-learn for input table format, UniProt download mode, model choices, and fair evaluation options.

Related pages

Clone this wiki locally