correct_seq: Correct a DNA Sequence Based on a CIGAR String

View source: R/extract_features_from_bam_indels.R

correct_seqR Documentation

Correct a DNA Sequence Based on a CIGAR String

Description

This function corrects a DNA sequence based on a provided CIGAR string. It first expands the CIGAR string, then inserts 'D's into the DNA sequence at positions corresponding to 'D's in the expanded CIGAR string. It also replaces characters in the DNA sequence with 'I's at positions corresponding to 'I's in the CIGAR string. After applying these modifications, the function calls clean_insertions to clean up the sequence.

Usage

correct_seq(cigar, sequence)

Arguments

cigar

A string representing the CIGAR sequence. Each character in the CIGAR string (such as M, I, D) represents a type of alignment operation.

sequence

A string representing the DNA sequence that needs to be corrected based on the CIGAR string.

Value

A DNA sequence string that has been corrected based on the CIGAR string. The function returns the sequence after applying deletions, insertions, and further cleaning through the clean_insertions function.


JakobPedersenLab/dreams documentation built on Feb. 2, 2024, 3:14 p.m.