selectSnps: Selects SNPs in snpMatrix and associated info data.frame,...

Description Usage Arguments Details Value Examples

View source: R/selectSnps.R

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

1
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:

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## 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"))

GeneGeneInteR documentation built on Nov. 1, 2018, 2:22 a.m.