crisscross_core library

Core data models for DNA origami design.

This library provides the fundamental data structures for representing slats, cargo, seeds, and handle plates used in megastructure designs.

Classes

Cargo
Fluorophore
A fluorophore entry in the per-design library. The name is used directly as the compatibility token for source plate lookup.
HashCadPlate
ParasiticInnerArgs
PlateDisplayEntry
Summary record for a unique plate entry shown in the detailed plate dialog.
PlateLibrary
Seed
Slat

Enums

FluorophoreShape
Allowed marker shapes for fluorophore indicators in the 2D view.

Constants

defaultPlateCompatibility → const String

Properties

qualitativeCargoColors → List<Color>
final
standardizedSlatMappings → Map<String, IntGrid>
Build the standardized mapping arrays just like Python’s for each slat type. Each grid holds 1..32 in the appropriate triangular coordinates.
final

Functions

calculateCenter(Iterable<Offset> points) → Offset
convertSparseSlatBundletoArray(Map<String, Slat> slats, Map<String, Map<String, dynamic>> layerMap, Offset minGrid, Offset maxGrid, double gridSize, {bool allTypes = false, bool phantomOnly = false}) → List<List<List<int>>>
returns a 3D array ylayer_order containing the numeric IDs of slats at each grid position (phantom slats are skipped)
extractAssemblyHandleArray(Map<String, Slat> slats, Map<String, Map<String, dynamic>> layerMap, Offset minGrid, Offset maxGrid, double gridSize, {bool allTypes = false, bool phantomOnly = false}) → List<List<List<int>>>
extractGridBoundary(Map<String, Slat> slats) → (Offset, Offset)
fluorophoreShapeFromString(String value) FluorophoreShape
Parses a shape string back to the enum value.
fluorophoreShapeToString(FluorophoreShape shape) → String
Converts a shape enum to its string representation for serialization.
generateBasicSeedCoordinates(int cols, int rows, double jump, bool tiltMode, bool invertMode) → Map<int, Offset>
quick generation of basic seed coordinates for model seeds (not to be used in actual coordinate system)
generateLayerSideKey(String layerID, String slatSide) → String
Generates a layer-side key string for occupiedCargoPoints indexing
generateLayerSplitHandles(List<List<List<int>>> baseArray, int uniqueSequences, {int seed = 8, Set<(int, int, int)>? additionalPositions}) → List<List<List<int>>>
generateRandomSlatHandles(List<List<List<int>>> baseArray, int uniqueSequences, {int seed = 8, Set<(int, int, int)>? additionalPositions}) → List<List<List<int>>>
generateShortName(String name) → String
generateStandardizedSlatHandleArray(List<int> slat1D, String slatType) IntGrid
Given a 1D ordered slat array (length 32) and a slat type, place the values onto a standardized 2D grid as per the template.
getAdjacentLayerOrder(Map<String, Map<String, dynamic>> layerMap, String layerID, String slatSide) → int
Calculates adjacent layer order (order +1 for top, -1 for bottom)
getHandleDict(Slat slat, int side) → Map<int, Map<String, dynamic>>
Gets the appropriate handle dictionary from a slat based on side (2 or 5)
getIndexFromSeedText(String seedText) → int
getLayerByOrder(Map<String, Map<String, dynamic>> layerMap, int order) → String?
getLayerOffsetForSide(Map<String, Map<String, dynamic>> layerMap, String layerID, int side) → int
Determines the layer offset direction for a given layer and slat side Returns 1 if the side points upward, -1 if it points downward
getOpposingSide(Map<String, Map<String, dynamic>> layerMap, String adjacentLayerID, int direction) → int
Gets the opposing helix side for a given layer based on direction direction: 1 for looking up (returns bottom helix of adjacent), -1 for looking down (returns top helix of adjacent)
getRequiredStapleCompatibility(String slatType, int position, int side) → String?
Returns the compatibility keyword required for a slat staple at position/side.
getSlatMatchCounts(List<List<List<int>>> handleArray, Map<String, Slat> slats, Map<String, Map<String, dynamic>> layerMap, Offset minGrid, Map<String, Map<Offset, String>> occupiedGridPoints) → Map<int, int>
getSlatSideFromLayer(Map<String, Map<String, dynamic>> layerMap, String layerID, String slatSide) → int
Gets integer slat side from layer map for a given layer and position (top/bottom)
isDefaultPlateCompatibility(String compatibility) → bool
Returns whether compatibility points to the default tube-compatible staple.
normalizePlateCompatibility(dynamic compatibility) → String
Normalizes optional plate compatibility text into a canonical lookup token.
parasiticInnerCompute(ParasiticInnerArgs args) → Map<String, dynamic>
parasiticInteractionsCompute(Map<String, Slat> slats, List<List<List<int>>> handleArray, Map<String, Map<String, dynamic>> layerMap, Offset minGrid, String connectionAngle, Map<String, Map<Offset, String>> occupiedGridPoints) → Future<Map<String, dynamic>>
parseHelixSide(String helixString) → int
Parses integer slat side (2 or 5) from helix string like 'H5' or 'H2'
plateCompatibilityLabel(String compatibility) → String
Human-readable label for a normalized compatibility token.
readDnaPlateMapping(Uint8List fileBytes) → List<Map<String, dynamic>>
Reads an Excel file and returns a list of maps (one per row), simulating what pandas would do with read_excel.
rotateCoordinateSpace(Offset point, Offset center, int steps, String gridMode) → Offset
Rotates a point around a center in coordinate space by a given number of steps. In 90deg mode, each step is 90deg CW (4 steps = full rotation). In 60deg mode, each step is 60deg CW (6 steps = full rotation).
sanitizePlateMap(String name) → String
syncCargoFromPlates(PlateLibrary plateLibrary, Map<String, Cargo> cargoPalette) → void
Adds any cargo IDs found in plateLibrary that are missing from cargoPalette.
validateSeedGeometry(List<(Offset, int, int)> handles) → bool
Validates that a set of seed handles forms a valid 5x16 grid pattern. Takes a list of (coordinate, row, col) tuples. Returns true if:

Typedefs

HandleKey = (String, int, int)
Typedef for handle key (slatID, position, side) - matches Python convention
IntGrid = List<List<int>>