sequaljs
Version:
JavaScript/TypeScript library for parsing and manipulating ProForma peptide sequence notation
94 lines • 3.76 kB
TypeScript
import { GlobalModification, Modification } from './modification';
/**
* Represents a sequence ambiguity in a ProForma string.
*/
export declare class SequenceAmbiguity {
value: string;
position: number;
/**
* Initializes a SequenceAmbiguity object.
*
* @param value - The value of the sequence ambiguity.
* @param position - The position of the sequence ambiguity.
*/
constructor(value: string, position: number);
/**
* Returns a string representation of the sequence ambiguity.
* @returns The string representation.
*/
toString(): string;
}
/**
* A parser for ProForma 2.1 strings.
*/
export declare class ProFormaParser {
static readonly MASS_SHIFT_PATTERN: RegExp;
static readonly CROSSLINK_PATTERN: RegExp;
static readonly CROSSLINK_REF_PATTERN: RegExp;
static readonly BRANCH_PATTERN: RegExp;
static readonly BRANCH_REF_PATTERN: RegExp;
/**
* Parses a ProForma string.
*
* @param proformaStr - The ProForma string to parse.
* @returns A tuple containing the base sequence, modifications, global modifications, sequence ambiguities, charge information, peptidoform name, peptidoform ion name, and compound ion name.
*/
static parse(proformaStr: string): [string, Record<number, Modification[]>, GlobalModification[], SequenceAmbiguity[], [number | null, string | null], string | null, string | null, string | null];
/**
* Finds the matching closing parenthesis for an opening parenthesis at a given position.
*
* @param str - The string to search in.
* @param startPos - The position of the opening parenthesis.
* @returns The position of the matching closing parenthesis, or -1 if not found.
* @private
*/
static _findBalancedParen(str: string, startPos: number): number;
/**
* Finds the matching closing angle bracket for an opening angle bracket at a given position.
*
* @param str - The string to search in.
* @param startPos - The position of the opening angle bracket.
* @returns The position of the matching closing angle bracket, or -1 if not found.
* @private
*/
static _findBalancedAngleBracket(str: string, startPos: number): number;
/**
* Finds the matching closing curly brace for an opening curly brace at a given position.
*
* @param str - The string to search in.
* @param startPos - The position of the opening curly brace.
* @returns The position of the matching closing curly brace, or -1 if not found.
* @private
*/
static _findBalancedCurlyBrace(str: string, startPos: number): number;
/**
* Creates a modification object from a modification string.
*
* @param modStr - The modification string.
* @param options - The options for creating the modification.
* @returns The modification object.
* @private
*/
static _createModification(modStr: string, options?: {
isTerminal?: boolean;
isAmbiguous?: boolean;
isLabile?: boolean;
isUnknownPosition?: boolean;
crosslinkId?: string;
isCrosslinkRef?: boolean;
isBranch?: boolean;
isBranchRef?: boolean;
isGap?: boolean;
inRange?: boolean;
rangeStart?: number;
rangeEnd?: number;
}): Modification;
/**
* Parses the charge information from a ProForma string.
*
* @param proformaStr - The ProForma string to parse.
* @returns A tuple containing the ProForma string without the charge information, the charge value, and the ionic species.
*/
static parseChargeInfo(proformaStr: string): [string, number | null, string | null];
}
//# sourceMappingURL=proforma.d.ts.map