Skip to contents

Row-bind the components of two mash data lists, returning the non-empty one when the other is empty.

Usage

mergeMashData(resData, oneData)

Arguments

resData

The accumulated mash data list (may be empty).

oneData

The mash data list to merge in.

Value

The merged mash data list.

Examples

# Each object's variants must be uniquely keyed (row names); the two
# objects share the same conditions (columns), which are aligned by name.
a <- list(strong = list(z = matrix(rnorm(9), 3, 3,
  dimnames = list(
    c("chr1:100:A:G", "chr1:200:A:G", "chr1:300:A:G"),
    c("t1", "t2", "t3")))))
b <- list(strong = list(z = matrix(rnorm(9), 3, 3,
  dimnames = list(
    c("chr1:400:A:G", "chr1:500:A:G", "chr1:600:A:G"),
    c("t1", "t2", "t3")))))
mergeMashData(a, b)
#> $strong
#>                    z.t1       z.t2       z.t3
#> chr1:100:A:G  1.2161509 -0.4196433 -3.0823636
#> chr1:200:A:G -0.5111711 -0.2127397  1.6461434
#> chr1:300:A:G  1.1285388 -1.0206608 -1.4112140
#> chr1:400:A:G  2.5651376  0.6988987  0.1363007
#> chr1:500:A:G  0.3255937  0.8807151  1.8434082
#> chr1:600:A:G -0.5655378 -0.2277550 -1.4053917
#>