Class MRNA

Represents mature messenger RNA (mRNA) that has undergone complete processing.

Mature mRNA is the final product of RNA processing, containing:

  • 5' methylguanosine cap for stability and ribosome binding
  • Spliced sequence with introns removed and exons joined
  • 3' poly-A tail for stability and nuclear export
  • Clear coding sequence boundaries for translation

This class extends RNA to provide specific functionality for translation-ready mRNA.

Hierarchy (view full)

Constructors

  • Creates a new mature mRNA instance.

    Parameters

    • sequence: string

      The complete mRNA sequence including cap and poly-A tail

    • codingSequence: string

      The coding sequence (CDS) portion for translation

    • codingStart: number

      Start position of coding sequence in the full sequence

    • codingEnd: number

      End position of coding sequence in the full sequence

    • fivePrimeCap: boolean = true

      Whether the mRNA has a 5' cap (default: true)

    • polyATail: string = ''

      The poly-A tail sequence (default: empty string)

    Returns MRNA

    Example

    // Create mature mRNA with cap and poly-A tail
    const mRNA = new MRNA(
    'GAUGAAACCCGGGUAAAAAAAAAA', // full sequence
    'AUGAAACCCGGG', // coding sequence
    1, // coding starts at position 1
    13, // coding ends at position 13
    true, // has 5' cap
    'AAAAAAAAAA' // 10 A's poly-A tail
    );

Properties

codingEnd: number
codingSequence: string
codingStart: number
fivePrimeCap: boolean
nucleicAcidType: NucleicAcidType
polyATail: string

Methods

  • Checks if the sequence contains the specified subsequence

    Parameters

    • subsequence: string | NucleicAcid

      The subsequence to search for (string or same nucleic acid type)

    Returns boolean

    True if the subsequence is found, false otherwise

    Example

    const dna = new DNA('ATCGATCG');
    console.log(dna.contains('TCG')); // true
    console.log(dna.contains('AAA')); // false
  • Checks if the sequence ends with the specified suffix

    Parameters

    • suffix: string | NucleicAcid

      The suffix to check for (string or same nucleic acid type)

    Returns boolean

    True if the sequence ends with the suffix, false otherwise

    Example

    const dna = new DNA('ATCGATCG');
    console.log(dna.endsWith('TCG')); // true
    console.log(dna.endsWith('ATC')); // false
  • Gets the coding end position in the full mRNA sequence.

    Returns number

    The 0-based index where the coding sequence ends (exclusive)

  • Gets the coding sequence (CDS) for translation. This excludes 5' UTR, 3' UTR, cap, and poly-A tail.

    Returns string

    The coding sequence that will be translated to a polypeptide

    Example

    const mRNA = new MRNA('GAUGAAACCCGGGUAAAAAAA', 'AUGAAACCCGGG', 1, 13);
    console.log(mRNA.getCodingSequence()); // 'AUGAAACCCGGG'
  • Gets the coding start position in the full mRNA sequence.

    Returns number

    The 0-based index where the coding sequence begins

  • Returns the complement as a new RNA instance This is the object-oriented API for getting RNA complements

    Returns RNA

    A new RNA instance containing the complement sequence

    Example

    const rnaResult = RNA.create('AUCG');
    if (rnaResult.success) {
    const complement = rnaResult.data.getComplement(); // Returns new RNA('UAGC')
    console.log(complement.getSequence()); // 'UAGC'
    }
  • Gets the 5' untranslated region (UTR).

    Returns string

    The 5' UTR sequence before the coding sequence

    Example

    const mRNA = new MRNA('GAUGAAACCCGGGUAA', 'AUGAAACCCGGG', 1, 13);
    console.log(mRNA.getFivePrimeUTR()); // 'G'
  • Gets the poly-A tail sequence.

    Returns string

    The poly-A tail sequence

    Example

    const mRNA = new MRNA('GAUGAAACCCGGGUAAAAAAA', 'AUGAAACCCGGG', 1, 13, true, 'AAAAAAA');
    console.log(mRNA.getPolyATail()); // 'AAAAAAA'
  • Gets the length of the poly-A tail.

    Returns number

    The number of adenine nucleotides in the poly-A tail

    Example

    const mRNA = new MRNA('GAUGAAACCCGGGUAAAAAAA', 'AUGAAACCCGGG', 1, 13, true, 'AAAAAAA');
    console.log(mRNA.getPolyATailLength()); // 7
  • Returns the reverse complement as a new RNA instance This represents the opposite strand orientation for RNA binding

    Returns RNA

    A new RNA instance containing the reverse complement sequence

    Example

    const rnaResult = RNA.create('AUCG');
    if (rnaResult.success) {
    const rna = rnaResult.data;
    const reverseComplement = rna.getReverseComplement(); // Returns new RNA('CGAU')

    // Chainable operations
    const original = rna.getReverseComplement().getReverseComplement(); // Returns new RNA('AUCG')
    const doubleComplement = rna.getComplement().getComplement(); // Returns new RNA('AUCG')
    }
  • Returns the reverse complement of the sequence This represents the opposite strand of double-stranded nucleic acids

    Returns string

    String representing the reverse complement of the sequence

    Example

    const dna = new DNA('ATCG');
    console.log(dna.getReverseComplementSequence()); // 'CGAT'

    const rna = new RNA('AUCG');
    console.log(rna.getReverseComplementSequence()); // 'CGAU'
  • Returns an RNA subsequence from the specified start position to the end position

    Parameters

    • start: number

      The starting position (inclusive, 0-based)

    • Optional end: number

      The ending position (exclusive, 0-based). If not specified, goes to end of sequence

    Returns RNA

    A new RNA instance containing the subsequence

    Example

    const rnaResult = RNA.create('AUCGAUCG');
    if (rnaResult.success) {
    const sub = rnaResult.data.getSubsequence(2, 5); // Creates new RNA with 'CGA'
    console.log(sub.getSequence()); // 'CGA'
    }
  • Gets the 3' untranslated region (UTR).

    Returns string

    The 3' UTR sequence after the coding sequence (excluding poly-A tail)

    Example

    const mRNA = new MRNA('GAUGAAACCCGGGUAAAAAAA', 'AUGAAACCCGGG', 1, 13, true, 'AAAAAAA');
    console.log(mRNA.getThreePrimeUTR()); // 'UAA' // stop codon + UTR, excluding poly-A
  • Checks if the mRNA has a 5' methylguanosine cap.

    Returns boolean

    True if the mRNA has a 5' cap, false otherwise

    Example

    const mRNA = new MRNA('GAUGAAACCCGGGUAA', 'AUGAAACCCGGG', 1, 13, true);
    console.log(mRNA.hasFivePrimeCap()); // true
  • Returns the index of the first occurrence of the specified subsequence

    Parameters

    • subsequence: string | NucleicAcid

      The subsequence to search for (string or same nucleic acid type)

    • startPosition: number = 0

      The position to start searching from (default: 0)

    Returns number

    The index of the first occurrence, or -1 if not found

    Example

    const dna = new DNA('ATCGATCG');
    console.log(dna.indexOf('TCG')); // 1
    console.log(dna.indexOf('TCG', 2)); // 5
    console.log(dna.indexOf('AAA')); // -1
  • Checks if the mRNA is fully processed and ready for translation.

    A fully processed mRNA must have:

    • A 5' cap
    • A poly-A tail (minimum length 10)
    • A valid coding sequence

    Returns boolean

    True if the mRNA is fully processed, false otherwise

    Example

    const mRNA = new MRNA('GAUGAAACCCGGGUAAAAAAAAAA', 'AUGAAACCCGGG', 1, 13, true, 'AAAAAAAAAA');
    console.log(mRNA.isFullyProcessed()); // true
  • Returns the length of the nucleic acid sequence

    Returns number

    The length of the sequence in nucleotides/base pairs

    Example

    const dna = new DNA('ATCG');
    console.log(dna.length()); // 4
  • Checks if the sequence starts with the specified prefix

    Parameters

    • prefix: string | NucleicAcid

      The prefix to check for (string or same nucleic acid type)

    Returns boolean

    True if the sequence starts with the prefix, false otherwise

    Example

    const dna = new DNA('ATCGATCG');
    console.log(dna.startsWith('ATC')); // true
    console.log(dna.startsWith('GTC')); // false