fn disrupts_start_codon(&self, genomic_position: usize, _sequence: &[char]) -> bool {
        let gene = self.gene_info;
        match gene.strand {
            Strand::Plus => {
                if let Some(cds) = gene.coding_sequences.first() {
                    // the first CDS usually starts with the start codon
                    if let Some(distance_to_start_codon) =
                        genomic_position.checked_sub(cds.range.start)
                    {
                        /* //too much output for now
                        if distance_to_start_codon == 0 { // then we do a sanity check
                            let flanking: usize = _sequence.len() / 2;
                            if _sequence[ flanking .. flanking + 3 ] !=  [ 'A', 'T', 'G' ] {
                                eprintln!( "[WARNING] Lowest CDS on the + strand does not have a proper start codon. This can be correct for some genes" );
                            }
                        }
                        */
                        return distance_to_start_codon < 3; // usize is always >= 0
                    }
                }
            }
            Strand::Minus => {
                if let Some(cds) = gene.coding_sequences.last() {
                    // the last CDS must end with a reverse start codon
                    if let Some(distance_to_start_codon) =
                        cds.range.stop.checked_sub(genomic_position)
                    {
                        /* //too much output for now
                        if distance_to_start_codon == 3 {
                            let flanking: usize = _sequence.len() / 2;
                            if _sequence[ flanking .. flanking + 3 ] != [ 'C', 'A', 'T' ] {
                                eprintln!( "[WARNING] Highest CDS on the - strand does not have a proper start codon. This can be correct for some genes" );
                            }
                        }
                        */
                        return 0 < distance_to_start_codon && distance_to_start_codon < 4;
                        // keep in mind that the .stop is exclusive
                    }
                }
            }
        }
        false
    }
/// Check if a mutation at this position would disrupt the first codon
///
/// Parameters:
///   genomic_position: The position on the chromosome
Check if a mutation at this position would disrupt the first codon
Parameters:
genomic_position: The position on the chromosome
Check if a mutation at this position would disrupt the first codon Parameters : genomic_position : The position on the chromosome
fn disrupts_start_codon(&self, genomic_position: usize, _sequence: &[char]) -> bool {
        let gene = self.gene_info;
        match gene.strand {
            Strand::Plus => {
                if let Some(cds) = gene.coding_sequences.first() {
                    // the first CDS usually starts with the start codon
                    if let Some(distance_to_start_codon) =
                        genomic_position.checked_sub(cds.range.start)
                    {
                        /* //too much output for now
                        if distance_to_start_codon == 0 { // then we do a sanity check
                            let flanking: usize = _sequence.len() / 2;
                            if _sequence[ flanking .. flanking + 3 ] !=  [ 'A', 'T', 'G' ] {
                                eprintln!( "[WARNING] Lowest CDS on the + strand does not have a proper start codon. This can be correct for some genes" );
                            }
                        }
                        */
                        return distance_to_start_codon < 3; // usize is always >= 0
                    }
                }
            }
            Strand::Minus => {
                if let Some(cds) = gene.coding_sequences.last() {
                    // the last CDS must end with a reverse start codon
                    if let Some(distance_to_start_codon) =
                        cds.range.stop.checked_sub(genomic_position)
                    {
                        /* //too much output for now
                        if distance_to_start_codon == 3 {
                            let flanking: usize = _sequence.len() / 2;
                            if _sequence[ flanking .. flanking + 3 ] != [ 'C', 'A', 'T' ] {
                                eprintln!( "[WARNING] Highest CDS on the - strand does not have a proper start codon. This can be correct for some genes" );
                            }
                        }
                        */
                        return 0 < distance_to_start_codon && distance_to_start_codon < 4;
                        // keep in mind that the .stop is exclusive
                    }
                }
            }
        }
        false
    }
fn disrupts_start_codon ( & self , genomic_position : usize , _sequence : & [ char ] ) -> bool { let gene = self . gene_info ; match gene . strand { Strand :: Plus => { if let Some ( cds ) = gene . coding_sequences . first ( ) { // the first CDS usually starts with the start codon if let Some ( distance_to_start_codon ) = genomic_position . checked_sub ( cds . range . start ) { /* //too much output for now
                        if distance_to_start_codon == 0 { // then we do a sanity check
                            let flanking: usize = _sequence.len() / 2;
                            if _sequence[ flanking .. flanking + 3 ] !=  [ 'A', 'T', 'G' ] {
                                eprintln!( "[WARNING] Lowest CDS on the + strand does not have a proper start codon. This can be correct for some genes" );
                            }
                        }
                        */ return distance_to_start_codon < 3 ; // usize is always >= 0 } } } Strand :: Minus => { if let Some ( cds ) = gene . coding_sequences . last ( ) { // the last CDS must end with a reverse start codon if let Some ( distance_to_start_codon ) = cds . range . stop . checked_sub ( genomic_position ) { /* //too much output for now
                        if distance_to_start_codon == 3 {
                            let flanking: usize = _sequence.len() / 2;
                            if _sequence[ flanking .. flanking + 3 ] != [ 'C', 'A', 'T' ] {
                                eprintln!( "[WARNING] Highest CDS on the - strand does not have a proper start codon. This can be correct for some genes" );
                            }
                        }
                        */ return 0 < distance_to_start_codon && distance_to_start_codon < 4 ; // keep in mind that the .stop is exclusive } } } } false }
Check if a mutation at this position would disrupt the first codon
Parameters:
genomic_position: The position on the chromosome
Check if a mutation at this position would disrupt the first codon Parameters : genomic_position : The position on the chromosome
&self
genomic_position
usize
_sequence
&[char]