Skip to content

3. Analysis

paolomanlapaz edited this page Jul 28, 2026 · 4 revisions

RiSPICE provides several downstream analysis utilities to help interpret variant scores. These workflows can be used to rank candidate variants, examine their predicted chromatin changes, and perform in silico saturation mutagenesis to identify influential nucleotides within a genomic region.

The available analyses are:

  1. Rank by Overall Score
  2. Analyze Per-Feature Scores
  3. In Silico Saturation Mutagenesis

Tip: Append --help to any RiSPICE command to display its usage, available options, and descriptions of each argument.

1. Rank by Overall Score

Ranks variants according to their Overall Score, allowing candidate variants with the largest predicted chromatin changes to be identified.

python -m scripts.analysis.prioritization.rank \
    --scores path/to/scores.tsv \
    --snp_list path/to/snp_list.tsv \
    -o path/to/output_directory

Use the --top flag to output only the top N variants (e.g. --top 20). When specified, the results are saved as top{N}_variants.tsv.

Visualize Ranked Variants

Generate a bar plot of the ranked variants.

python -m scripts.analysis.visualize.prioritization.top_variants \
    -i path/to/top20_variants.tsv \
    -o path/to/top20_variants.png \
    --title "Overall Scores of the Top 20 Variants"

Adjust the figure width as needed depending on the number of variants being displayed. The default width (6) is recommended for approximately 20 variants.

2. Analyze Per-Feature Scores

Generates a matrix of Per-Feature Scores sorted by Overall Score. Chromatin features are ordered according to their average predicted impact across all input variants, making the most affected features easier to identify.

python -m scripts.analysis.prioritization.per_feature_scores \
    --scores path/to/scores.tsv \
    --snp_list path/to/snp_list.tsv \
    -o path/to/output_directory \
    --top 20

Use the --top flag to output only the top N variants (e.g. --top 20). When specified, the results are saved as per_feature_scores_top{N}.tsv.

Visualize Per-Feature Scores

Generate a heatmap of the Per-Feature Scores.

python -m scripts.analysis.visualize.prioritization.per_feature_scores \
    -i path/to/per_feature_scores_top20.tsv \
    -o path/to/per_feature_scores_top20.png \
    --threshold_dir path/to/per_feature_thresholds \
    -t "Per-Feature Scores of the Top 20 Variants"

Adjust the figure height as needed depending on the number of variants being displayed. The default height (12) is recommended for approximately 20 variants.

Specify --threshold_dir to annotate statistically significant Per-Feature Scores. This directory should point to the extracted per_feature/ folder from the downloaded empirical background distribution, which contains the significance threshold (*.tsv) files for all chromatin features.

Clone this wiki locally