import * as DG from 'datagrok-api/dg'; import { CandidateType, ISeqGraphInfo, ISeqSplitted, MonomerFreqs, SeqColStats, SeqSplittedBase, SplitterFunc } from './types'; import { ALPHABET } from './consts'; import { SeqPalette } from '../../seq-palettes'; import { ISeqHelper } from '../seq-helper'; import { HelmType, PolymerType } from '../../helm/types'; export declare class StringListSeqSplitted implements ISeqSplitted { private readonly mList; private readonly gapOriginalMonomer; get length(): number; get graphInfo(): ISeqGraphInfo | undefined; isGap(posIdx: number): boolean; /** @param {number} posIdx monomer position 0-based index */ getCanonical(posIdx: number): string; getOriginal(posIdx: number): string; getCanonicalRegion(start: number, end: number): string[]; getOriginalRegion(start: number, end: number): string[]; get gapOriginal(): string; constructor(mList: SeqSplittedBase, gapOriginalMonomer: string); } /** Same as string list splitted, but for helm will also encode the graph info, and define a getter for it * */ export declare class HelmSplitted extends StringListSeqSplitted { protected mListSeparated: string[][]; private readonly connections; private polymerTypes; constructor(mListSeparated: string[][], // list of lists of monomers (separated by | in helm notation connections: string, // string part of helm defining connections between monomers polymerTypes: PolymerType[], // polymer types for each disjoint sequence part gapOriginalMonomer: string); protected _graphInfo: ISeqGraphInfo | undefined; get graphInfo(): ISeqGraphInfo; protected parseConnections(): ISeqGraphInfo; } /** Gets canonical monomers for original ones with cyclization marks */ export declare class BilnSeqSplitted extends HelmSplitted { getCanonical(posIdx: number): string; getOriginal(posIdx: number): string; constructor(seqListSplit: string[][], gapOriginalMonomer: string); protected parseConnections(): ISeqGraphInfo; } export declare class FastaSimpleSeqSplitted implements ISeqSplitted { private readonly seqS; get length(): number; isGap(posIdx: number): boolean; getCanonical(posIdx: number): string; getOriginal(posIdx: number): string; getCanonicalRegion(start: number, end: number): string[]; getOriginalRegion(start: number, end: number): string[]; get gapOriginal(): string; constructor(seqS: string); } /** Stats of sequences with specified splitter func, returns { freq, sameLength }. * @param {DG.Column} seqCol * @param {number} minLength * @param {SplitterFunc} splitter * @return { SeqColStats }, sameLength: boolean } stats of column sequences */ export declare function getStatsForCol(seqCol: DG.Column, minLength: number, splitter: SplitterFunc): SeqColStats; /** Split sequence for single character monomers, square brackets multichar monomer names or gap symbol. * @param seq object with sequence * @param getMonomer Source of the {@link seq} string * @return {string[]} array of monomers */ export declare const splitterAsFasta: SplitterFunc; export declare const splitterAsFastaSimple: SplitterFunc; /** Gets method to split sequence by separator * @param separator Monomer separator * @param limit * @return {SplitterFunc} */ export declare function getSplitterWithSeparator(separator: string, limit?: number | undefined): SplitterFunc; export declare const RNA_HELM_TRIPLET_MONOMER_REG: RegExp; export declare const RNA_HELM_TERMINAL_PHOSPHATELESS_MONOMER_REG: RegExp; /** Splits Helm string to monomers, but does not replace monomer names to other notation (e.g. for RNA). * Only for linear polymers, does not split RNA for ribose and phosphate monomers. * EG byciclic helm: PEPTIDE1{F}|PEPTIDE2{[dI].[Trp_Ome].[Asp_OMe].[Cys_Bn].[meG].[Phe_3Cl].[dD].T.[dI].T.[dK].[aG].[3Pal].[xiIle].[meD].[Ala_tBu]}|PEPTIDE3{L.[Pro_4Me3OH].S.[NMe2Abz].Q.[3Pal].[xiIle].[D-Hyp].[Ala_tBu].[dI].[Trp_Ome].[Asp_OMe].N.[meG].[Phe_34diCl].[Phe_34diCl]}$PEPTIDE2,PEPTIDE2,16:R2-1:R1|PEPTIDE3,PEPTIDE3,16:R2-1:R1|PEPTIDE3,PEPTIDE2,10:R3-1:R3|PEPTIDE1,PEPTIDE2,1:R2-9:R3$$$V2.0 * Also should support smiles in monomer names, like: PEPTIDE1{[ac].L.N.[*N[C@H](C(=O)*)Cc1ccc(cc1)OP(=O)(O)O |$_R1;;;;;_R2;;;;;;;;;;;;$|].I.D.L.D.L.V.[am]}$$$$ * @param {string} seq Source string of HELM notation * @param {ISeqSource} src Source of the {@link seq} string * @return {string[]} */ export declare const splitterAsHelm: SplitterFunc; export declare function splitterAsBiln(seq: string): ISeqSplitted; /** Func type to shorten a {@link monomerLabel} with length {@link limit} */ export type MonomerToShortFunc = (monomerLabel: string, limit: number) => string; /** Get splitter method to split sequences to monomers (required for MacromoleculeDifferenceCellRenderer) * @param {string} units * @param {string} separator * @param limit * @return {SplitterFunc} */ export declare function getSplitter(units: string, separator: string, limit?: number | undefined): SplitterFunc; /** Convert long monomer names to short ones */ export declare function monomerToShort(amino: string, maxLengthOfMonomer: number): string; /** */ export declare function getAlphabet(alphabet: ALPHABET): Set; /** Calculate similarity in current sequence and alphabet. * @param {MonomerFreqs} freq * @param {Set} alphabet * @param {string} gapSymbol * @return {number} Cosine similarity */ export declare function getAlphabetSimilarity(freq: MonomerFreqs, alphabet: Set, gapSymbol?: string): number; /** From detectMacromolecule */ export declare function detectAlphabet(freq: MonomerFreqs, candidates: CandidateType[], gapSymbol?: string): string; export declare function detectHelmAlphabet(freq: MonomerFreqs, candidates: CandidateType[], gapSymbol?: string): string; /** Selects a suitable palette based on column data * @param {DG.Column} seqCol Column to look for a palette * @param {number} minLength minimum length of sequence to detect palette (empty strings are allowed) * @return {SeqPalette} Palette corresponding to the alphabet of the sequences in the column */ export declare function pickUpPalette(seqCol: DG.Column, seqHelper: ISeqHelper, minLength?: number): SeqPalette; export declare function getPaletteByType(paletteType: string): SeqPalette; export declare function pickUpSeqCol(df: DG.DataFrame): DG.Column | null; export declare function polymerTypeToHelmType(pt: PolymerType): HelmType; //# sourceMappingURL=utils.d.ts.map