insert_gaps2_vec | R Documentation |
This function inserts gaps (e.g., .
or -
) into an ungapped sequence (ungapped
)
to match the positions of gaps in a reference sequence (gapped
). It ensures that
the aligned sequence has the same gap structure as the reference.
insert_gaps2_vec(gapped, ungapped, parallel = FALSE)
gapped |
A vector of strings representing the reference sequences with gaps. |
ungapped |
A vector of strings representing the sequences without gaps. |
parallel |
A boolean flag to enable parallel processing (default: FALSE). |
A vector of strings with gaps inserted to match the gapped reference.
# Example usage
gapped <- c("caggtc..aact", "caggtc---aact")
ungapped <- c("caggtcaact", "caggtcaact")
# Sequential execution
result <- insert_gaps2_vec(gapped, ungapped, parallel = FALSE)
print(result) # "caggtc..aact", "caggtc---aact"
# Parallel execution
result_parallel <- insert_gaps2_vec(gapped, ungapped, parallel = TRUE)
print(result_parallel)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.