GRITIC estimates the timing and route histories of clonal copy number gains from single-sample bulk whole-genome sequencing of cancer genomes. It supports complex allele-specific copy-number states and up to one whole-genome duplication (WGD); see timing eligibility.
Gain timing is measured in mutation time, from 0 near conception to 1 at the emergence of the tumour's most recent common ancestor.
GRITIC is agnostic to reference genome. The number of numbered autosomes is configurable, and both X/Y and Z/W sex-chromosome systems are supported.
The method is described in Baker et al. (2024), The History of Chromosomal Instability in Genome-Doubled Tumors.
- Installation
- Quick start
- Input tables
- Run options
- Outputs
- Model details
- Downstream formats
- Python API
Python 3.12 or newer is required. Install the version documented here from this repository checkout:
python -m pip install .Run this example from the repository root. It writes directly to examples/output/TEST_ID, which must not already exist, even if empty. To reuse it, supply --overwrite.
gritic \
--mutation-table examples/snv_table_example.tsv \
--copy-number-table examples/cn_table_example.tsv \
--subclone-table examples/subclone_table_example.tsv \
--purity 0.5 \
--sample-id TEST_ID \
--sample-dir examples/output/TEST_ID \
--wgd-count 1 \
--random-seed 20260828 \
--plot-treesUse gritic --help for command-line help or see run options. For programmatic use, see Python API.
Supply tab-separated copy-number and mutation tables, plus an optional subclone table. Inputs from any caller are accepted if they follow these schemas; see examples/.
Column names are case-sensitive. Additional caller-supplied columns are accepted.
All SNVs for the sample, with either Mutation_ID or Position required alongside the three mandatory columns below.
| Column | Requirement | Values |
|---|---|---|
Chromosome |
Required | Labels following the chromosome-handling rules. |
Tumor_Ref_Count |
Required | Number of reads supporting the reference allele. |
Tumor_Alt_Count |
Required | Number of reads supporting the alternate allele. |
Mutation_ID |
Required unless Position is supplied |
Literal text, preserving values such as 000123, NA, and NULL. |
Position |
Required unless Mutation_ID is supplied |
Zero-based genomic position. |
Phasing |
Optional | major or minor, case-insensitive, ignoring surrounding whitespace. Missing values remain unphased. |
Supplying --drop-unrecognized-phasing drops mutations with unrecognized phasing and reports the number dropped and the unrecognized values.
Input mutation columns named Segment_Start, Segment_End, Major_CN, or Minor_CN are ignored because GRITIC always annotates those values from the copy-number table.
GRITIC supports two segment-assignment modes:
- If both the mutation and copy number tables contain
Segment_ID, GRITIC uses those IDs to associate mutations with the input copy number segments.Positionis not needed for assignment. - Otherwise, the mutation table must contain
Position, which assigns mutations to segments on the same chromosome using the coordinate convention.
In supplied-ID mode, both tables require nonblank Segment_ID values, and those IDs must be unique in the copy-number table. Every mutation's Segment_ID must match a copy-number row, including its Chromosome. If --drop-unmatched-snvs is supplied, GRITIC drops mutations unmatched by either assignment mode and reports the number dropped. Missing or blank supplied IDs and chromosome mismatches remain errors.
GRITIC does not model mutations in zero-copy 0+0 segments. In supplied-ID
mode, GRITIC drops mutations assigned to these segments and reports the mutation
count, segment count, and source Segment_ID values. This is independent of
--drop-unmatched-snvs because those IDs are matched rather than unknown.
The selected Mutation_ID or canonical integer Position value must be unique within its source segment. An explicit Mutation_ID column takes precedence for every row; GRITIC does not fall back to Position for blank values in that column. The same selected value may be reused in different source segments. With supplied segment IDs, this also applies to source segments that GRITIC subsequently merges.
The rounded allele-specific copy-number profile for the sample requires Chromosome, Segment_Start, Segment_End, Major_CN, and Minor_CN. Chromosome labels follow the rules below. Segments use zero-based, half-open intervals. Intervals on the same chromosome must not overlap. Supplied Segment_ID values enable the assignment mode described under Mutation table.
The supported allele-specific copy-number states are:
Major_CN |
Permitted Minor_CN |
|---|---|
| 1–5 | 0 through Major_CN |
| 6 | 0–4 |
| 7 | 0–3 |
| 8 | 0–1 |
The 1+0 and 1+1 states use uniform no-gain timing. In WGD runs, major-copy-number-two segments are excluded from the ordinary per-segment fit. WGD timing estimation uses those on configured autosomes with at least 10 retained SNVs. Balanced 2+2 segments use a WGD-specific allele model.
By default, GRITIC merges consecutive segments on the same chromosome having identical Major_CN and Minor_CN. The merged interval runs from the first segment's start through the last segment's end, including any intervening uncovered bases. Use --max-merge-gap to limit gaps or --keep-adjacent-segments to preserve input segments. Final segment IDs are generated from Chromosome, Segment_Start, and Segment_End after merging.
Both input tables accept numbered chromosomes from 1 through --autosome-count and the sex chromosomes present under the selected karyotype. Chromosome labels are case-sensitive; chr prefixes are removed.
| Karyotype | Present sex chromosomes | Normal X or Z copies | Normal Y or W copies |
|---|---|---|---|
| XX | X | 2 | 0 |
| XY | X, Y | 1 | 1 |
| ZZ | Z | 2 | 0 |
| ZW | Z, W | 1 | 1 |
When sample sex is not supplied, GRITIC infers it from the copy-number table: Y implies XY and W implies ZW; otherwise X alone implies XX and Z alone implies ZZ. If no sex chromosome is represented, GRITIC defaults to XX, so callers using another system should supply --sample-sex. Chromosomes outside the configured set follow --drop-unmatched-chromosomes behavior.
The optional subclone table gives the identified subclonal peaks and their assigned mutation fractions for the sample.
Required columns are:
Cluster: the subclone identifier.Subclone_CCF: cancer cell fraction. CCF determines the expected VAF of a subclone state.Subclone_Fraction: the fraction of input SNVs assigned to the subclone. Mutation shares determine its mixture prior.
Candidates are filtered using the subclone-handling options. If no subclones remain, GRITIC uses its clonal-only model. If there are more than two subclones, GRITIC groups them into two: the subclone with the largest CCF is unmodified and the remaining clones are combined by summing their fractions and taking their fraction-weighted mean CCF.
Retained Subclone_Fraction values keep their input scale; the remaining share is treated as clonal.
--mutation-tableA path to the mutation table for the sample.--copy-number-tableA path to the copy-number table for the sample.--purityThe estimated cellular purity for the sample.--sample-idSample ID used as an output filename prefix. It must be a cross-platform-safe filename component.--sample-dirSample output directory.
--overwriteReuse the existing--sample-dirdirectory and its subdirectories. Files with the same names as new outputs are overwritten; all other files are preserved.--plot-treesEnable route-tree plots for each segment.
--autosome-countNumber of numbered autosomes in the organism (default: 22). This defines the accepted numbered chromosome labels and the chromosomes eligible for WGD inference.--sample-sexOverride the inferred karyotype withXX,XY,ZZ, orZW. See chromosome handling for inference rules and normal copy numbers.--drop-unmatched-chromosomesDrop copy-number and mutation rows whose chromosome is not one of the configured autosomes or present sex chromosomes and report the number of rows dropped. By default, any such chromosome is an error.--drop-unmatched-snvsDrop mutation rows that cannot be associated with a copy-number segment by either suppliedSegment_IDor genomicPositionand report the number dropped. By default, unmatched mutations raise an error.--drop-unrecognized-phasingDrop mutation rows whose non-missingPhasingvalue is notmajororminorand report the number dropped. By default, unrecognized phasing labels raise an error.--keep-adjacent-segmentsPreserve input copy-number segments separately. See segment merging for the default behavior.--max-merge-gap NMerge consecutive equal-copy-number segments only when the gap is at mostNbases. If omitted, there is no maximum; use0to merge only intervals that touch.
--min-mutation-alt-countMinimumTumor_Alt_Countneeded to retain a mutation (default: 3).--min-mutation-coverageMinimumTumor_Ref_Count + Tumor_Alt_Countneeded to retain a mutation (default: 10).--coverage-vaf-quantileObserved-SNV VAF quantile used to select mutations for the mean-coverage estimate in the detection correction (default: 0.9). See detection correction and mutation-share priors.
--subclone-tableA path to the subclone table for the sample. If omitted, GRITIC assumes every SNV is clonal, which can bias gain timings earlier.--clip-subclone-ccfClip out-of-rangeSubclone_CCFvalues before filtering. With the default CCF filters, values clipped to either boundary are subsequently excluded.--min-subclone-ccfMinimumSubclone_CCFretained as a subclone, inclusive (default: 0.01).--max-subclone-ccfMaximumSubclone_CCFretained as a subclone, inclusive (default: 0.9).--min-subclone-fractionA subclone's normalized share of the subclonal mutation fractions after CCF filtering must be strictly greater than this threshold (default: 0.1).--subclone-fraction-prior {adjusted,supplied}Use detection-adjusted mutation fractions or the supplied fractions in the mutation-share prior (default:adjusted). See detection correction and mutation-share priors.
The value of --min-subclone-ccf must be greater than 0.
Every run requires configured autosomal segments with a segment-width-weighted modal Major_CN of 1 or 2, including runs with a supplied WGD count.
--wgd-count {0,1}Override GRITIC's inferred WGD count. If omitted, GRITIC infers the count. GRITIC warns when the supplied count conflicts with modal major copy number. See WGD timing estimation.--random-seedSeed stochastic inference with an unsigned 64-bit integer. If omitted, GRITIC generates a random seed using sources provided by the operating system.--unordered-balanced-route-priorUse a uniform prior over unordered allele-route pairs. See balanced route priors for the weighting of ordered routes.
Intervals default to highest posterior density (HPD, hpd); equal-tailed is also available. Interval widths specify probability mass.
| Interval family | Options | Default width | Controls |
|---|---|---|---|
| Route gain | --route-gain-interval-width, --route-gain-interval-method |
0.95 | Route-conditional gain bounds in both gain timing tables. |
| WGD overlap | --wgd-overlap-interval-width, --wgd-overlap-interval-method |
0.9 | Internal candidate-segment bounds that determine WGD overlap and can change WGD inference. |
| Sample WGD | --wgd-timing-interval-width, --wgd-timing-interval-method |
0.9 | Final sample-level WGD bounds shared by the calling-info JSON, route table, and yellow tree nodes. |
| Posterior summary | --posterior-summary-interval-width, --posterior-summary-interval-method |
0.95 | Gain and gain-conditioned WGD bounds in posterior summaries. |
| Tree gain | --tree-gain-interval-width, --tree-gain-interval-method |
0.9 | Blue gain-node labels in tree PDFs. |
Append each suffix below to SAMPLE_ID. We recommend only considering gained segments with 10 or more SNVs.
| File or directory suffix | Contents |
|---|---|
_posterior_timing_table_summary_penalty_*.tsv |
Main gain-timing summaries, with ordinary and penalized route weights. |
_route_table.tsv |
Route probabilities and segment metadata. |
_gain_timing_table.tsv |
Gain-node timing conditional on each route. |
_wgd_calling_info.json |
Sample WGD call and timing. |
_gain_timing_table_wgd_segments.tsv |
Preliminary segment timings used to evaluate WGD. |
_tree_plots |
Optional route-tree PDFs. |
_mutation_table.tsv |
Processed mutations and downstream identifiers. |
_count_group_table.tsv |
Distinct read-count pairs. |
_phase_group_table.tsv |
Read-count groups subdivided by phasing. |
_likelihood_context_table.tsv |
Distinct copy-number observation contexts. |
_segment_context_table.tsv |
Segment-to-context mapping. |
_count_group_likelihood_table.tsv |
Multiplicity likelihoods by count group and context. |
_segment_group_table.tsv |
Mutation counts by segment and phase group. |
_subclone_table.tsv |
Processed subclone inputs. |
_timing_dicts |
Posterior archives for downstream mutation timing. |
_posterior_timing_table_summary_penalty_<True|False>.tsv summarizes independent-gain timing across routes, keyed by (Sample_ID, Segment_ID, Gain_Index). Gain_Index is a 1-based chronological index of independent gains.
| Result columns | Interpretation |
|---|---|
Timing_Median, Timing_Low_CI, Timing_High_CI |
Gain-timing median and configured posterior-summary interval. |
Proportion |
Fraction of posterior route draws in which this independent gain exists. |
WGD_Timing_Median, WGD_Timing_Low_CI, WGD_Timing_High_CI |
WGD-timing median and interval. |
Pre_WGD_Probability, Post_WGD_Probability |
Probabilities of the gain preceding or following WGD. |
Only gains with Proportion >= 0.8 are reported. Its denominator includes all route draws for the segment, including routes with no independent gains.
Gain and WGD statistics on a row use the same subset of draws in which that gain exists. WGD-related fields are blank in non-WGD runs. Segment coordinates, copy numbers, mutation count, mutation rate, and WGD status accompany these results.
_penalty_False.tsv uses Probability; _penalty_True.tsv uses a separate set of draws with Penalized_Probability. See posterior sampling for how these draws are constructed.
This table contains one row for each possible route of each timed segment, keyed by (Sample_ID, Segment_ID, Route). Routes with no independently timeable gains are retained here.
Timing_Representation is Route_Particles for ordinary gained routes and Uniform_No_Gain when every extant copy spans the [0,1] interval. The table stores ordinary Probability and post-hoc Penalized_Probability, average event and loss counts, a timing-space sampling-density diagnostic (Density), runtime (Time), and segment and WGD metadata.
Route is an order-sensitive identifier of the complete allele route. See posterior sampling for the density diagnostic.
Penalized_Probability is calculated by multiplying each route's ordinary probability by exp(-2.7 * Average_N_Events) and renormalizing across routes within the segment. Tree output uses ordinary probabilities. See Baker et al. (2024) for details of the penalty.
This table contains one row per independently timeable gain node per route and is keyed by four identifier columns: (Sample, Segment, Route, Node).
The remaining columns are Node_Phasing, Timing (the median), and Timing_CI_Low and Timing_CI_High (the configured route-gain interval). Timing statistics are conditional on the route.
Node_Phasing is Major or Minor; a route with one extant allele component labels every node Major.
Keys are WGD_Timing, WGD_Timing_CI_Low, WGD_Timing_CI_High, Major_CN_Mode, Overlap_Proportion, WGD_Status, and Best_Overlap_Timing; missing or nonfinite numeric values are null.
See WGD timing estimation for eligibility, the overlap decision, and the final timing estimate.
This table is produced while evaluating WGD timing. It gives the preliminary non-WGD node posterior for every eligible major-copy-number-two segment. Displayed Timing_CI_Low and Timing_CI_High use the route-gain interval. Intersecting, Best_Overlap_Timing, and Overlap_Proportion use the separate, unrounded internal WGD-overlap intervals. Displayed bounds therefore need not determine Intersecting; see timing intervals for the settings.
Binary tree plots for the gain timings of each route in a segment. Each plot has one or two allele trees, according to the route. Blue nodes show independent gains with the tree-gain interval. Yellow nodes show WGD timing; red nodes are the extant copies at sampling.
The processed mutation table, including identifiers used by downstream mutation timing. Segment_ID is GRITIC's final coordinate-derived segment ID after the selected merge behavior.
Every output row contains these mutation identity, mapping, and provenance columns:
Source_Segment_IDis the input segment ID when both input tables supplied matchingSegment_IDcolumns. For position-based copy-number assignment it is the final assigned segment ID.Mutation_IDcontains the literal inputMutation_IDwhen supplied and is blank otherwise.Positioncontains the canonical input position when supplied and is blank otherwise.GRITIC_Mutation_IDis the canonical sample-unique identifier derived from the source segment plusMutation_IDwhen supplied, otherwise from the source segment plusPosition.Segment_Mutation_Indexis a zero-based, consecutive index within the finalSegment_ID.Phase_Group_IDlinks the mutation to one row of_phase_group_table.tsv. Together withSegment_ID, it also links to the mutation count in_segment_group_table.tsv.
Use GRITIC_Mutation_ID for downstream mutation joins.
Follow Phase_Group_ID through the phase and count dictionaries to recover phasing and read counts. Follow Segment_ID through _segment_context_table.tsv and _likelihood_context_table.tsv to recover Major_CN, Minor_CN, and total copy number.
The retained and processed subclone inputs with the fixed columns Cluster, Subclone_CCF, Subclone_Fraction, and N_SNVs. This file is always written. If no subclone table was supplied, or no candidate survived filtering, it contains the header and zero rows.
GRITIC derives N_SNVs from the retained mutation count and each retained/combined Subclone_Fraction, overwriting an input N_SNVs column.
For an allele-balanced N+N state, GRITIC defaults to a uniform prior over the ordered Cartesian product of single-allele histories, conditional on the copy-number and WGD setting.
With --unordered-balanced-route-prior, an A/A route retains weight 1 and each orientation of an A/B pair receives weight 0.5, so the pair carries the same total prior weight as A/A.
Without phased SNVs, reciprocal routes have equal likelihoods and probabilities. With phased SNVs, GRITIC evaluates their likelihoods and posteriors separately before applying the selected prior.
When evaluating a possible WGD or pooling timing for a called WGD, GRITIC constrains the two homolog histories and timings of an original balanced 2+2 segment to be identical. It retains mutation Phasing labels but evaluates every SNV against one representative duplicated allele. The likelihood context retains the original 2+2 copy number, while timing uses a single pseudo-2+0 route. If WGD is rejected, the ordinary independent-route 2+2 model uses mutation phasing.
See timing archives for the pooled-WGD encoding.
GRITIC calculates the modal Major_CN, weighted by segment width, across the configured autosomes. With automatic WGD inference, mode 1 gives a WGD count of 0. Mode 2 triggers timing of autosomal major-copy-number-two segments with at least 10 retained SNVs; at least one must produce a finite timing interval.
Best_Overlap_Timing is the mutation-time point covered by the greatest total segment width across the candidate segments' internal WGD-overlap intervals. Overlap_Proportion is that covered width divided by the total width of eligible segments with finite intervals. An overlap of at least 60% gives an inferred WGD count of 1; a lower overlap gives 0 and emits a warning.
Overlapping segments are pooled and refit by minor-copy-number class, and their timing densities are combined into 500 sample-level draws. For a WGD call, WGD_Timing and its interval fields summarize those draws using the configured sample-WGD interval.
GRITIC uses each segment's read counts to fit clonal and subclonal mutation shares, with the supplied subclone CCFs determining the expected VAFs of the subclonal states. The clonal input fraction is one minus the sum of the retained subclonal fractions. GRITIC constructs a weak Dirichlet prior with parameters equal to one plus the supplied or adjusted fractions.
With --subclone-fraction-prior adjusted, GRITIC divides the clonal and subclonal input fractions by their estimated detection probabilities separately for each segment, then renormalizes them. With supplied, it uses the fractions directly. Both modes apply the segment-specific detection correction in the likelihood.
The correction uses Poisson thinning to calculate the probability of meeting --min-mutation-alt-count, given each state's expected VAF and the segment's estimated mean coverage. Coverage is averaged over SNVs with observed VAF greater than the --coverage-vaf-quantile quantile minus 0.01. This quantile affects the likelihood correction in both prior modes and the prior adjustment only in adjusted mode.
The supplied prior follows Baker et al. (2024), Supplementary Methods §8.3.4, equation 22. The publication's detection correction averages detection power over individual SNV depths (§8.3.5, equation 23); the current implementation uses the mean-coverage approach above.
GRITIC retains 1,000 likelihood-resampled particles for each sampled route. The Density diagnostic reports the fraction of tested timing points with another sampled point within the sampling neighborhood. It covers hit-and-run timing coordinates. Analytic uniform routes require no chain and report density 1.
Each posterior-summary draw samples a route and its gain and WGD timings jointly, preserving dependence between events. The gain timing table supplies node identity and phasing metadata; the timing archives contain the joint timing draws and route weights used for downstream inference.
Count_Group_ID, Phase_Group_ID, and Likelihood_Context_ID are sample-wide, zero-based, consecutive identifiers.
One row per distinct (Tumor_Ref_Count, Tumor_Alt_Count) pair in the retained sample, with columns Sample_ID, Count_Group_ID, Tumor_Ref_Count, and Tumor_Alt_Count.
Count groups subdivided by mutation phasing, with columns Sample_ID, Phase_Group_ID, Count_Group_ID, and Phasing. Phasing values are non_phased, major, or minor; Count_Group_ID references _count_group_table.tsv.
One row per distinct read-count observation context, with columns Sample_ID, Likelihood_Context_ID, Major_CN, Minor_CN, and Normal_Total_CN (normal total copy number).
Each final segment with retained mutations mapped to one observation context, with columns Sample_ID, Segment_ID, and Likelihood_Context_ID.
One likelihood vector per (Likelihood_Context_ID, Count_Group_ID) pair used by at least one segment. The fixed leading columns are Sample_ID, Likelihood_Context_ID, and Count_Group_ID, followed by Prob_Mult_1, Prob_Mult_2, and so on through the largest sample-wide major copy number, then Prob_Subclone_0, Prob_Subclone_1, and so on. Multiplicity columns above the row context's Major_CN are blank. Applicable entries sum to one per row.
Columns Sample_ID, Segment_ID, Phase_Group_ID, and N_Mutations, keyed by (Segment_ID, Phase_Group_ID). N_Mutations counts retained mutations in the segment belonging to that phase group.
The _timing_dicts directory contains compressed posterior archives for mutation timing.
Route_Particles segments store gain timing and multiplicity particles. A Uniform_No_Gain segment writes no store when it has no subclones; with subclones it writes only the fitted clone-share posterior. Each archive consists of two files:
SEGMENT_ID_timing_dict.npzSEGMENT_ID_timing_dict.manifest.json
Pooled WGD stores use the same pair with a WGD_minor_cn_N identifier in place of SEGMENT_ID. See Reading timing archives for a Python example.
The rows of Timing, WGD_Timing, and Mult are aligned; use the same row index for one joint posterior draw.
A subclonal Uniform_No_Gain route contains only Clone_Share, whose columns contain fitted mutation shares for the clonal cluster followed by each subclone.
Archive schema
Each Route_Particles entry contains the following numeric arrays:
ProbabilityandPenalized_Probabilityare one-element float64 arrays containing the route weights used for downstream inference.Timingis a float64N_Particles x N_Timing_Nodesmatrix.Timing_Node_IDis the aligned int64 identifier for each column, corresponding toNodein the gain timing table.WGD_Timingis the aligned float64 WGD vector andMultis the aligned float64 multiplicity matrix. Non-WGD models use an all-NaNWGD_Timingvector; WGD models use finite values.Interval_Start_Source,Interval_End_Source,Interval_Multiplicity, andInterval_Phasingdescribe every mutation-bearing route interval without requiring the consumer to reconstruct a route tree. Source 0 is constant zero, source 1 is constant one, source 2 isWGD_Timing, and source3+jis columnjofTiming. Phasing is a bit mask: 1 isnon_phased, 2 ismajor, and 4 isminor.State_Column_OffsetsandState_Columnsmap phasings ontoMultcolumns. The four offsets delimit three slices innon_phased,major,minororder.Multcontains the corresponding unphased, major-phased, and minor-phased multiplicity blocks followed by shared subclone columns, which occur at the tail of every applicable slice.Target_Major_CN,Target_Minor_CN, andTarget_WGD_Statusdescribe the genomic segment to which inference applies.Model_Major_CN,Model_Minor_CN, andModel_WGD_Statusdescribe the fitted particle geometry.N_Subclonesgives the shared number of subclone columns.Archive_Kindis 0 for an ordinary segment store and 1 for a pooled-WGD store. For pooled2+2segments, target metadata describe2+2with WGD and model metadata describe2+0without WGD. Phasing masks and state slices address the representative major allele; see the balanced WGD model.
Run this example from the repository root. It writes directly to examples/output/TEST_ID. Pass overwrite=True to gritictimer.process_sample to reuse an existing sample directory; files with matching names are overwritten and other files are preserved.
import pandas as pd
from gritic import dataloader, gritictimer, sampletools
copy_number_table, mutation_table = dataloader.load_input_tables(
'examples/cn_table_example.tsv',
'examples/snv_table_example.tsv',
)
subclone_table = pd.read_csv(
'examples/subclone_table_example.tsv',
sep='\t',
dtype={'Cluster': str},
)
sample = sampletools.Sample(
mutation_table,
copy_number_table,
subclone_table,
sample_id='TEST_ID',
purity=0.5,
)
gritictimer.process_sample(
sample,
sample_dir='examples/output/TEST_ID',
plot_trees=True,
wgd_count=1,
random_seed=20260828,
)For unmatched-SNV dropping with supplied segment IDs, dataloader.load_input_tables(..., drop_unmatched_snvs=True) removes unmatched rows during loading. For position-based assignment, pass drop_unmatched_snvs=True to sampletools.Sample.
For segment merging, sampletools.Sample accepts max_merge_gap to limit gaps and merge_cn=False to preserve input segments.
min_subclone_ccf must be greater than 0.
Python callers configure intervals through the interval_config argument to process_sample, using distributiontools.TimingIntervalConfig and distributiontools.IntervalSpec.
Set the WGD overlap threshold with process_sample(..., min_wgd_overlap=...); the default is 0.6.
From the sample output directory, load a store through GRITIC to validate the pair and reconstruct the dictionary hierarchy:
from gritic.timingio import load_timing_archive
timing_dict = load_timing_archive(
'SAMPLE_ID_timing_dicts/1-0-200_timing_dict.npz'
)The reconstructed dictionary keys are route identifiers. See Timing archives for the array definitions and alignment rules.