pub fn estimate_from_record(
        record: &bam::Record,
        properties: &mut AlignmentProperties,
    ) -> Option<f64> {
        let mut tlen = None;
        if record.is_unmapped() || record.is_duplicate() || record.is_quality_check_failed() {
            tlen
        } else {
            let is_regular = properties.update_max_cigar_ops_len(&record);

            if is_regular
                && !record.is_mate_unmapped()
                && record.is_first_in_template()
                && record.tid() == record.mtid()
                && record.mapq() > 0
            {
                // record insert size
                tlen = Some(record.insert_size().abs() as f64);
            }
            tlen
        }
    }
/// Estimate `AlignmentProperties` from each record in bam file.
/// Only reads that are mapped, not duplicates and where quality checks passed are taken.
/// Return will need to be extended to existing vector
Estimate `AlignmentProperties` from each record in bam file.
Only reads that are mapped, not duplicates and where quality checks passed are taken.
Return will need to be extended to existing vector
Estimate ` AlignmentProperties ` from each record in bam file . Only reads that are mapped not duplicates and where quality checks passed are taken . Return will need to be extended to existing vector
pub fn estimate_from_record(
        record: &bam::Record,
        properties: &mut AlignmentProperties,
    ) -> Option<f64> {
        let mut tlen = None;
        if record.is_unmapped() || record.is_duplicate() || record.is_quality_check_failed() {
            tlen
        } else {
            let is_regular = properties.update_max_cigar_ops_len(&record);
            if is_regular
                && !record.is_mate_unmapped()
                && record.is_first_in_template()
                && record.tid() == record.mtid()
                && record.mapq() > 0
            {
                // record insert size
                tlen = Some(record.insert_size().abs() as f64);
            }
            tlen
        }
    }
pub fn estimate_from_record ( record : & bam :: Record , properties : & mut AlignmentProperties , ) -> Option < f64 > { let mut tlen = None ; if record . is_unmapped ( ) || record . is_duplicate ( ) || record . is_quality_check_failed ( ) { tlen } else { let is_regular = properties . update_max_cigar_ops_len ( & record ) ; if is_regular && ! record . is_mate_unmapped ( ) && record . is_first_in_template ( ) && record . tid ( ) == record . mtid ( ) && record . mapq ( ) > 0 { // record insert size tlen = Some ( record . insert_size ( ) . abs ( ) as f64 ) ; } tlen } }
Estimate `AlignmentProperties` from each record in bam file.
Estimate ` AlignmentProperties ` from each record in bam file .
record
&bam::Record
properties
&mut AlignmentProperties
record
&bam::Record
properties
&mut AlignmentProperties