order_by_similarity: Order DNA sequences by Levenshtein edit distance

order_by_similarityR Documentation

Order DNA sequences by Levenshtein edit distance

Description

This function takes a vector of DNA sequences, computes pairwise distances between them, and orders the sequences based on their similarity using hierarchical clustering.

Usage

order_by_similarity(dna_strings)

Arguments

dna_strings

A character vector containing DNA sequences (A, C, G, T).

Value

A character vector of DNA sequences ordered by similarity.

Examples

dna_strings <- c("ACTG", "ACCG", "ATGC", "AGTC")
ordered_dna <- order_by_similarity(dna_strings)
print(ordered_dna)


lefeverde/lefutils documentation built on Sept. 18, 2024, 7:30 a.m.