toSPIAData: Function to code SNPs data into SPIA format

Description Usage Arguments Value Author(s) Examples

View source: R/toSPIAData.R

Description

Function toSPIAData encodes SNPs information in a format accepted by SPIA, i.e., 0 for AA, 1 for BB, 2 for AB, NA for NoCall.

Usage

1
toSPIAData(SNPMatrix, encoding)

Arguments

SNPMatrix

a matrix with a column for each cell line and a row for each SNP

encoding

a four elements ecnoding vector describing the encoding used in SNPMatrix. For instance, (0,2,1,-1) says that SNPMatrix uses 0 for AA, 2 for BB, 1 for AB, and -1 for NoCall

Value

a matrix with a column for each cell line and a row for each SNP encoded with the SPIA format

Author(s)

Francesca Demichelis <francesca.demichelis@unitn.it>, Davide Prandi <davide.prandi@unitn.it>

Examples

1
2
3
4
5
   SNPcall <- c("snp1",0,1,2,-1)
   encoding <- c(0,2,1,-1)
   SPIA_SNPcall <- toSPIAData(SNPcall, encoding)
   print(SNPcall)
   print(SPIA_SNPcall)

Example output

SPIA: encoding completed.
[1] "snp1" "0"    "1"    "2"    "-1"  
[1] "snp1" "0"    "2"    "1"    NA    

SPIAssay documentation built on May 1, 2019, 11:12 p.m.