getGermlineLikeness: Function to summarise Germline Likeness for repertoires

View source: R/germlineDistances.R

getGermlineLikenessR Documentation

Function to summarise Germline Likeness for repertoires

Description

The function loops through each row in metadata_table and select the subset of lineages from distFromGermline_summary relevant to the given metadata combination, and calculate the Germline Likeness metric for this given set of lineages.

Usage

getGermlineLikeness(
  distFromGermline_summary,
  metadata_table,
  summarise_variables
)

Arguments

distFromGermline_summary

data.frame, output of summariseGermlineDistance. With metadata annotation including columns given in summarise_variables.

metadata_table

data.frame with meta data, 1 row per sample/donor as appropriate (see Example).

summarise_variables

Character vector, names of columns in distFromGermline used to partition the sequences into subsets for which summary is sought

Value

A data.frame identical to metadata_table with the additional column "GermlineLikeness" holding the Germline Likeness metric (numeric) of lineages matching the given combination of metadata attributes

Examples

## Not run: 
# We have included in the package the pre-computed germline distances of 
# sequences in the 'input' data frame, here use this as an example
distFromGermline <- system.file( "extdata/input_GermlineDistances.csv", package = "BrepPhylo")
distFromGermline <- read.csv(distFromGermline)

# set up a table containing metadata with which you want to
# obtain a summary of Germline Likeness
# here simply set up one column with PatientID
patient_details <- data.frame( PatientID = unique( distFromGermline[, c("PatientID") ] ) )

germline_likeness <- getGermlineLikeness( 
  germlineDistance_summary,
  metadata_table = patient_details,
  summarise_variables = "PatientID" 
)
germline_likeness

## End(Not run)


Fraternalilab/BrepPhylo documentation built on Jan. 3, 2025, 10:03 a.m.