selectSnps {GeneGeneInteR} | R Documentation

## Selects SNPs in snpMatrix and associated info data.frame, outputs of importFile.

### Description

`selectSnps` allows the user to select snps from an object output of `importFile`. It generates the same object, with the columns of the snpMatrix and the rows of the data.frame corresponding to the selected snps.

### Usage

    selectSnps(snpX, genes.info, select)

### Arguments

`snpX` | snpMatrix object. Given as output of `importFile`.
`genes.info` | Data.frame containing informations about snps. For more details, refer to `importFile` help file.
`select` | Numeric or character vector for selecting snps in `snpX` and `genes.info`. See details for more information.

### Details

The column names of the `genes.info` data.frame should correspond to the output `genes.info` object returned by `importFile` function.

The `select` argument should one of the following:

- a numeric vector with only the column number in the snpMatrix (or row number for `genes.info`) of each snp selected.

- a character vector with the names of each snp selected or each gene selected.

- a character vector which elements are position bounds of genes. Each element of the vector is either of the form "begin:end", or "chr:begin:end" if you have to precise the chromosome of the gene.

### Value

A list of two objects :

`snpX` | a snpMatrix
`genes.info` | a data frame with 4 columns, and one row per SNP selected with `select`. The columns are Chromosome, Genenames, SNPnames and Position.

An error message is displayed if the genes of snps selected are not found in the either `snpX` or `genes.info`.

### Examples

    ## Importation of the dataset
    ## Not run:
    ped <- system.file("extdata/example.ped", package="GeneGeneInteR")
    info <- system.file("extdata/example.info", package="GeneGeneInteR")
    posi <- system.file("extdata/example.txt", package="GeneGeneInteR")
    data.imported <- importFile(file=ped, snps=info, pos=posi, pos.sep="\t")

    ## End(Not run)
    ### Equivalent loading of the imported data
    load(system.file("extdata/dataImported.Rdata", package="GeneGeneInteR"))

    ## Selection of the genes DNAH9 and TXNDC5
    selec <- selectSnps(data.imported$snpX, data.imported$genes.info, c("DNAH9","TXNDC5"))

    ## Selection of the snps from position 101342000 to 101490000 on chromosome 15
    selec <- selectSnps(data.imported$snpX, data.imported$genes.info, c("15:101342000:101490000"))

[Package GeneGeneInteR version 1.13.0 Index]