getAllelesPerPattern: Converting an allele-pattern data frame into a...

View source: R/func__getAllelesPerPattern.R

getAllelesPerPatternR Documentation

Converting an allele-pattern data frame into a pattern-alleles data frame

Description

This functions reformats the data frame "alle.pat" or mapping[, c("allele", "pattern")] in outputs of the findPhysLink function. It is useful when a user wants to list all alleles under each particular pattern.

For example, given an input data frame: allele | pattern; a1 | 1; a2 | 1

The function returns a data frame containing a row: pattern | alleles; 1 | a1,a2

Usage

getAllelesPerPattern(mapping, sep = ",")

Arguments

mapping

the data frame alle.pat or mapping in outputs of the findPhysLink function. It can be other data frames, but must contain names "allele" and "pattern".

sep

the delimiter for alleles that belong to the same pattern in the output. It is a comma by default.

Author(s)

Yu Wan (wanyuac@126.com)

Examples

assoc <- findPhysLink(...)
ap1 <- getAllelesPerPattern(assoc[["mapping"]], sep = ",")
ap2 <- getAllelesPerPattern(assoc[["alleles"]][["alle.pat"]], sep = ",")  # alternatively


wanyuac/GeneMates documentation built on Aug. 12, 2022, 7:37 a.m.