Combine two gen_tibbles
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.
Usage
# S3 method for class 'gen_tbl'
rbind(
...,
as_is = FALSE,
flip_strand = FALSE,
use_position = FALSE,
quiet = FALSE,
backingfile = NULL
)
Arguments
- ...
two
gen_tibble
objects. Note that this function can not take more objects,rbind
has to be done sequentially for large sets of objects.- as_is
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.- flip_strand
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
- use_position
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 bothgen_tibbles
(a mix of e.g. 'chr1', '1' or 'chromosome1' can be the reasons if an unexpectedly large number variants are dropped when merging).- quiet
boolean whether to omit reporting to screen
- backingfile
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)
Value
a gen_tibble
with the merged data.