Skip to content

2. Prediction Pipeline

paolomanlapaz edited this page Jul 29, 2026 · 1 revision

This guide demonstrates the standard RiSPICE workflow for scoring variants from a snp_list.tsv file. If you have not yet installed RiSPICE or downloaded the required models, please follow the Installation guide before proceeding.

Preparing Input Data (Optional)

RiSPICE accepts variants in a snp_list.tsv file as the input to the prediction pipeline. If your variants are stored in a VCF file, you may use the helper script below to convert them.

Convert a VCF to snp_list.tsv

python -m scripts.snp.vcf_to_snp_list \
    -i <INPUT_VCF> \
    -o <OUTPUT_DIR> \
    --nip_to_chrom

Note: snp_list.tsv expects the chrom column to contain numerical chromosome identifiers (1–12). If your VCF uses Nipponbare GenBank chromosome accessions (e.g. AP014960.1), use the --nip_to_chrom flag to convert them automatically.

Alternatively, you may prepare your own snp_list.tsv containing the following columns:

chrom    pos    id    ref    alt

where chrom contains numerical chromosome identifiers.

Run the Prediction Pipeline

The following commands demonstrate the standard RiSPICE prediction workflow.

Tip: Append --help to any RiSPICE script to view all available options and command-line arguments. For example:

python -m scripts.predict.probs --help

1. Generate Ref and Alt Sequences

Generate the reference and alternative DNA sequences for each variant.

python -m scripts.predict.generate_sequences \
    -i <OUTPUT_DIR>/snp_list.tsv \
    -o <OUTPUT_DIR> \
    -f <REFERENCE_GENOME_FASTA> \
    -l 1000

Note: Ensure the -l value matches the downloaded adapter (500, 750, or 1000).

Reference genome: Use the GenBank FASTA for the Nipponbare reference genome (assembly GCA_001433935.1) as <REFERENCE_GENOME_FASTA>. RiSPICE was developed using this reference assembly.

2. Predict Chromatin Features

Predict the probability of each chromatin feature listed in features.csv for the reference and alternative sequences.

python -m scripts.predict.probs \
    -m <BASE_MODEL_DIR> \
    -l <ADAPTER_DIR> \
    -i <OUTPUT_DIR>/sequences.tsv \
    -o <OUTPUT_DIR> \
    --automodel \
    --cuda

Remove the --cuda flag if running on a CPU-only system.

3. Compute Per-Feature and Overall Scores

Compute the Per-Feature Scores using the selected scoring mode (default: log_odds) and aggregate them into an Overall Score using the Euclidean norm.

python -m scripts.predict.compute_scores \
    -i <OUTPUT_DIR> \
    -m log_odds \
    -f scores

Example

Suppose your input VCF contains the following variant:

Chr4    19884685    .    C    A

First, convert the VCF into a snp_list.tsv (or prepare one manually):

chrom    pos         id    ref    alt
4        19884685    .     C      A

Then, run the RiSPICE prediction pipeline:

  1. Generate the reference and alternative sequences.
  2. Predict chromatin feature probabilities for both sequences.
  3. Compute the Per-Feature Scores and Overall Score.

The pipeline produces the following files:

output/
├── snp_list.tsv
├── sequences.tsv
├── ref.tsv
├── alt.tsv
└── scores.tsv
File Description
snp_list.tsv Input variants used by the RiSPICE pipeline.
sequences.tsv Generated reference and alternative DNA sequences for each variant.
ref.tsv Predicted chromatin feature probabilities for the reference sequences.
alt.tsv Predicted chromatin feature probabilities for the alternative sequences.
scores.tsv Per-Feature Scores and Overall Scores used for variant prioritization.