Skip to contents

This function will allow you to define custom multilocus lineages for your data set.

Usage

mll.custom(x, set = TRUE, value)

mll.custom(x, set = TRUE) <- value

mll.levels(x, set = TRUE, value)

mll.levels(x, set = TRUE) <- value

Arguments

x

a genclone or snpclone object.

set

logical. If TRUE (default), the visible mlls will be set to 'custom'.

value

a vector that defines the multilocus lineages for your data. This can be a vector of ANYTHING that can be turned into a factor.

Value

an object of the same type as x

See also

Author

Zhian N. Kamvar

Examples

data(partial_clone)
pc <- as.genclone(partial_clone)
mll.custom(pc) <- LETTERS[mll(pc)]
mll(pc)
#>  [1] H I W X V U J C V K X I Y D L B N A I I I Z G M W C Q V F T V L E Y M U O M
#> [39] M M B S R M W P A K Y D
#> Levels: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

# Let's say we had a mistake and the A mlg was actually B. 
mll.levels(pc)[mll.levels(pc) == "A"] <- "B"
mll(pc)
#>  [1] H I W X V U J C V K X I Y D L B N B I I I Z G M W C Q V F T V L E Y M U O M
#> [39] M M B S R M W P B K Y D
#> Levels: B C D E F G H I J K L M N O P Q R S T U V W X Y Z

# Set the MLL back to the original definition.
mll(pc) <- "original"
mll(pc)
#>  [1]  8  9 23 24 22 21 10  3 22 11 24  9 25  4 12  2 14  1  9  9  9 26  7 13 23
#> [26]  3 17 22  6 20 22 12  5 25 13 21 15 13 13 13  2 19 18 13 23 16  1 11 25  4