/** * MSA Coordinate Systems: * * 1. **Global Column (globalCol)**: The column index in the full, unfiltered MSA. * Range: 0 to (MSA width - 1) * This is the "true" column position before any gap-hiding is applied. * * 2. **Visible Column (visibleCol)**: The column index after hiding gappy columns. * Range: 0 to (numColumns - 1) where numColumns = MSA width - blanks.length * This is what the user sees on screen when "Hide columns w/ N% gaps" is enabled. * When gap hiding is disabled, visibleCol === globalCol. * * 3. **Sequence Position (seqPos)**: The position within a specific row's ungapped sequence. * Range: 0 to (ungapped sequence length - 1) * This counts only non-gap characters ('-' and '.' are gaps). * Each row can have different seqPos values for the same globalCol due to gaps. */ /** * Convert a visible column index to a global column index. * This is used when translating mouse/screen coordinates to MSA coordinates. * * @param blanks - Sorted array of global column indices that are hidden * @param visibleCol - The visible column index (what the user sees on screen) * @returns The corresponding global column index in the full MSA */ export declare function visibleColToGlobalCol(blanks: number[], visibleCol: number): number; /** * Convert a global column index to a visible column index. * This is the inverse of visibleColToGlobalCol. * * @param blanks - Sorted array of global column indices that are hidden * @param globalCol - The global column index in the full MSA * @returns The visible column index, or undefined if the column is hidden */ export declare function globalColToVisibleCol(blanks: number[], globalCol: number): number | undefined; /** * Convert a global column index to a row-specific sequence position. * This counts non-gap characters up to the given global column. * * @param seq - The row's sequence string (including gaps) * @param globalCol - The global column index * @returns The sequence position (count of non-gap characters before this column) */ export declare function globalColToSeqPos(seq: string, globalCol: number): number; /** * Convert a visible column to a row-specific sequence position. * Returns undefined if the position is a gap in the sequence. * * @param seq - The row's sequence string (including gaps) * @param blanks - Sorted array of global column indices that are hidden * @param visibleCol - The visible column index * @returns The sequence position, or undefined if it's a gap */ export declare function visibleColToSeqPos({ seq, blanks, visibleCol, }: { seq: string; blanks: number[]; visibleCol: number; }): number | undefined; /** * Convert a visible column to a row-specific sequence position, with row lookup. * * @param rowName - The name of the row * @param visibleCol - The visible column index * @param rowMap - Map from row name to sequence string * @param blanks - Sorted array of global column indices that are hidden * @returns The sequence position, or undefined if row not found or position is a gap */ export declare function visibleColToSeqPosForRow({ rowName, visibleCol, rowMap, blanks, }: { rowName: string; visibleCol: number; rowMap: Map; blanks: number[]; }): number | undefined;