Variant coordinate search with CIViCpy. (A) On updating or loading the in-memory cache, all variant records are extracted and converted into a sorted Variant Coordinate Index (VCI). Variants missing coordinate values are excluded, and variants with compound coordinates (eg, fusion variants) have the coordinates split into distinct records. Each coordinate is sorted by chromosome, start coordinate, stop coordinate, and alternate sequence (see the purple box). The VCI also contains a reference to the cache key for the corresponding variant. The vci_ptr is a reference to a record of the VCI. (B) CoordinateQuery objects are used to query against the VCI and should match the coordinate system requirements from CIViC (see the blue box). These objects contain an optional key field for user reference. When searching the knowledgebase for several variants, CoordinateQuery objects should be presorted by the same procedure for sorting the VCI. The q_ptr serves an analogous role to the vci_ptr for the variant queries. (C) Starting at the first sorted VCI and Query record, searches will increment the smaller of the vci_ptr or q_ptr until an overlapping coordinate range is identified. When overlaps occur, matches are reported on the basis of the search model specified. The vci_ptr is restored once all overlapping records for a query are evaluated. (D) Several search models exist for this algorithm, including a highly sensitive Any search, a conservative Exact search, and two intermediate modes. Overlap scenarios and report behavior for each scenario are presented. ✓, a scenario is reported; ✕, a scenario is not reported. QE, query encompassing; RE, record encompassing.