chain_scores: Calculate association scores between alpha and beta chain...

Description Usage Arguments Value Examples

View source: R/chain_scores.R

Description

chain_scores() calculates association scores between every pair of alpha and beta chains based on the number of concurrent well appearances each alpha and beta pair makes, scaled inversely by the number of unique chains in that well. See Lee et. al. for more information about this procedure.

Usage

1
chain_scores(data_a, data_b)

Arguments

data_a

Matrix recording which alpha chains appear in each well of the data. See create_clones.

data_b

Matrix recording which beta chains appear in the each well of the data. See create_clones.

Value

A list containing the alpha and beta association scores. Accessed with list$ascores and list$bscores respectively.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
 # see the help for create_clones() and create_data()
 clones <- create_clones(numb_beta = 1000,
                         dual_alpha = .3,
                         dual_beta  = .06,
                         alpha_sharing = c(0.80, 0.15, 0.05),
                         beta_sharing  = c(0.75, 0.20, 0.05))
 dat <- create_data(clones$TCR, plate = 5,
                    error_drop = c(.15, .01),
                    error_seq  = c(.05, .001),
                    error_mode = c("lognormal", "lognormal"),
                    skewed = 10,
                    prop_top = 0.6,
                    dist = "linear",
                    numb_cells = matrix(c(50, 480), ncol = 2))

 #this is done internally in bagpipe()
 scores <- chain_scores(data_a = dat$alpha, data_b = dat$beta)
 scores <- scores$ascores + t(scores$bscores)

edwardslee/alphabetr documentation built on May 13, 2017, 2:04 p.m.