rbind.gen_tbl.Rd
This function combined two gen_tibbles. By defaults, it subsets the loci
and swaps ref and alt alleles to make the two datasets compatible (this
behaviour can be switched off with as_is
).
The first object is used as a "reference" , and SNPs
in the other dataset will be flipped and/or alleles swapped
as needed. SNPs that have different alleles in the two datasets
(i.e. triallelic) will also be
dropped. There are also options (NOT default) to attempt strand flipping to
match alleles (often needed in human datasets from different SNP chips),
and remove ambiguous alleles (C/G and A/T) where the correct strand can not
be guessed.
# S3 method for class 'gen_tbl'
rbind(
...,
as_is = FALSE,
flip_strand = FALSE,
use_position = FALSE,
quiet = FALSE,
backingfile = NULL
)
two gen_tibble
objects. Note that this function can not take
more objects, rbind
has to be done sequentially for large sets of objects.
boolean determining whether the loci should be left as they are
before merging. If FALSE (the defaults), rbind
will attempt to subset and
swap alleles as needed.
boolean on whether strand flipping should be checked to match the two datasets. If this is set to TRUE, ambiguous SNPs (i.e. A/T and C/G) will also be removed. It defaults to FALSE
boolean of whether a combination of chromosome and position
should be used for matching SNPs. By default, rbind
uses the locus name,
so this is set to FALSE. When using 'use_position=TRUE', make sure chromosomes
are coded in the same way in both gen_tibbles
(a mix of e.g. 'chr1', '1' or
'chromosome1' can be the reasons if an unexpectedly large number variants
are dropped when merging).
boolean whether to omit reporting to screen
the path and prefix of the files used to store the
merged data (it will be a .RDS to store the bigSNP
object and a .bk file
as its backing file for the FBM)
a gen_tibble
with the merged data.
rbind differs from merging data with plink, which swaps the order of allele1 and allele2 according to minor allele frequency when merging datasets. rbind flips and/or swaps alleles according to the reference dataset, not according to allele frequency.