hlaGenoCombine {HIBAG} | R Documentation

## Combine two genotypic data sets into one

### Description

To combine two genotypic data sets into one dataset.

### Usage

    hlaGenoCombine(geno1, geno2,
        match.type=c("RefSNP+Position", "RefSNP", "Position"),
        allele.check=TRUE, same.strand=FALSE, verbose=TRUE)

### Arguments

`geno1` | the first genotype object of `hlaSNPGenoClass`
`geno2` | the second genotype object of `hlaSNPGenoClass`
`match.type` | `"RefSNP+Position"` (by default) – using both of RefSNP IDs and positions; `"RefSNP"` – using RefSNP IDs only; `"Position"` – using positions only
`allele.check` | if `TRUE`, call `hlaGenoSwitchStrand` to check and then switch allele pairs if needed
`same.strand` | `TRUE` assuming alleles are on the same strand (e.g., forward strand); otherwise, `FALSE` not assuming whether on the same strand or not
`verbose` | show information, if TRUE

### Details

The function merges two SNP dataset `geno1` and `geno2`, and returns a SNP dataset consisting of the SNP intersect between `geno1` and `geno2`, and having the same SNP information (allele and position) as `geno1`.

### Value

An object of `hlaSNPGenoClass`.

### Author(s)

Xiuwen Zheng

### See Also

`hlaMakeSNPGeno`, `hlaGenoSubset`

### Examples

    # import a PLINK BED file
    bed.fn <- system.file("extdata", "HapMap_CEU.bed", package="HIBAG")
    fam.fn <- system.file("extdata", "HapMap_CEU.fam", package="HIBAG")
    bim.fn <- system.file("extdata", "HapMap_CEU.bim", package="HIBAG")
    hapmap.ceu <- hlaBED2Geno(bed.fn, fam.fn, bim.fn, assembly="hg19")

    # combine two datasets together
    geno <- hlaGenoCombine(HapMap_CEU_Geno, hapmap.ceu)
    summary(geno)

[Package HIBAG version 1.24.0 Index]