Function validateExons

  • Enhanced performance-optimized exon validation using sweep line algorithm. This function provides comprehensive validation for genes with many exons, optimized for O(n log n) performance.

    Features:

    • O(n log n) sweep line algorithm for overlap detection
    • Interval tree optimization for large gene sets
    • Memory-efficient processing for genes with 100+ exons
    • Biological constraint validation

    Parameters

    • exons: GenomicRegion[]

      Array of GenomicRegions representing exons

    • sequenceLength: number

      Total length of the gene sequence

    Returns {
        success: true;
    } | {
        error: string;
        success: false;
    }

    ValidationResult with detailed error reporting

    Example

    const result = validateExonsOptimized(exons, geneSequence.length);
    if (result.success) {
    console.log('Exons are valid');
    } else {
    console.error('Validation failed:', result.error);
    }