Class PreMRNA

Represents pre-mRNA (precursor mRNA) - the initial RNA transcript containing both exons and introns. Pre-mRNA is produced directly from DNA transcription and requires processing (splicing) to become mature mRNA.

In eukaryotes, genes are transcribed as pre-mRNA containing:

  • All exons (coding sequences that will be retained)
  • All introns (non-coding sequences that will be removed during splicing)
  • 5' UTR and 3' UTR regions

Example

const gene = new Gene(dnaSequence, exons);
const preMRNA = new PreMRNA(transcriptSequence, gene, tss, polyASite);

console.log(preMRNA.getExonRegions()); // Exon positions in transcript
console.log(preMRNA.getIntronRegions()); // Intron positions in transcript
console.log(preMRNA.getCodingSequence()); // Exons only, joined together

Hierarchy (view full)

Constructors

  • Creates a new PreMRNA instance.

    Parameters

    • sequence: string

      The complete pre-mRNA sequence including introns and exons

    • sourceGene: Gene

      The gene that was transcribed

    • transcriptionStartSite: number

      TSS position in the original gene sequence

    • Optional polyadenylationSite: number

      Optional polyadenylation site position in transcript

    Returns PreMRNA

    Example

    const gene = new Gene('ATGAAACCCAAATTTGGG', [
    { start: 0, end: 6 }, // First exon: ATGAAA
    { start: 12, end: 18 } // Second exon: TTTGGG
    ]);

    const preMRNA = new PreMRNA(
    'AUGAAACCCAAAUUUGGG', // Transcribed sequence (DNA -> RNA)
    gene,
    0, // TSS at gene position 0
    18 // Poly-A site at transcript end
    );

Properties

nucleicAcidType: NucleicAcidType
polyadenylationSite?: number

Position of polyadenylation site in the transcript, if known

sourceGene: Gene

The source gene that was transcribed to create this pre-mRNA

transcriptionStartSite: number

Position of transcription start site in the original gene sequence

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 sequence by extracting and joining only the exons. This represents what the mature mRNA sequence will be after splicing.

    Returns string

    The coding sequence (exons joined together)

    Example

    const preMRNA = new PreMRNA('AUGAAACCCAAAUUUGGG', gene, 0);
    console.log(preMRNA.getCodingSequence()); // 'AUGAAAUUUGGG' (exons only)
  • 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 exon regions in transcript coordinates. These are the regions that will be retained after splicing.

    Returns GenomicRegion[]

    Array of exon regions in transcript coordinates

    Example

    const exonRegions = preMRNA.getExonRegions();
    // [{ start: 0, end: 6 }, { start: 12, end: 18 }]
  • Gets the intron regions in transcript coordinates. These are the regions that will be removed during splicing.

    Returns GenomicRegion[]

    Array of intron regions in transcript coordinates

    Example

    const intronRegions = preMRNA.getIntronRegions();
    // [{ start: 6, end: 12 }] - region between exons
  • Gets the polyadenylation site position in the transcript, if known.

    Returns undefined | number

    Polyadenylation site position in transcript coordinates, or undefined

  • 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 transcription start site position in the original gene.

    Returns number

    TSS position in gene coordinates

  • Checks if this pre-mRNA contains introns that need to be spliced.

    Returns boolean

    true if introns are present, false if this is intronless

  • 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
  • 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
  • Gets a string representation of this pre-mRNA.

    Returns string

    String showing sequence length, exon/intron counts, and source gene