setAnnotation {hapFabia} | R Documentation

## Fills in annotations of tagSNVs of a list of IBD segments

### Description

`setAnnotation`: R implementation of `setAnnotation`.

Fills in the tagSNV annotation of IBD segments given in an object of the class `IBDsegmentList`. The annotation must be given in a file where the first column contains the position of the SNV and the second the chromosome. The other columns give the annotation like "stop gain", "stop loss", "synonymous", "non-synonymous", "exonic", "intronic", "intergenic", "promotor", etc. However other annotations like whether the minor allele is identical to the Denisova or Neandertal base can be included.

### Usage

    ## S4 method for signature 'IBDsegmentList,character'
    setAnnotation(IBDsegmentList,filename)

### Arguments

`IBDsegmentList` | object of class `IBDsegmentList`.
`filename` | File containing the SNV annotations, where the first column contains the SNV position and the second the chromosome.

### Details

Implementation in R.

### Value

object of class `IBDsegmentList` in which the annotation for the tagSNVs is set.

### Author(s)

Sepp Hochreiter

### References

S. Hochreiter et al., ‘FABIA: Factor Analysis for Bicluster Acquisition’, Bioinformatics 26(12):1520-1527, 2010.

### See Also

`IBDsegment-class`, `IBDsegmentList-class`, `analyzeIBDsegments`, `compareIBDsegmentLists`, `extractIBDsegments`, `findDenseRegions`, `hapFabia`, `hapFabiaVersion`, `hapRes`, `chr1ASW1000G`, `IBDsegmentList2excel`, `identifyDuplicates`, `iterateIntervals`, `makePipelineFile`, `matrixPlot`, `mergeIBDsegmentLists`, `mergedIBDsegmentList`, `plotIBDsegment`, `res`, `setAnnotation`, `setStatistics`, `sim`, `simu`, `simulateIBDsegmentsFabia`, `simulateIBDsegments`, `split_sparse_matrix`, `toolsFactorizationClass`, `vcftoFABIA`

### Examples

    old_dir <- getwd()
    setwd(tempdir())

    data(hapRes)

    res <- hapRes$res
    sPF <- hapRes$sPF
    annot <- hapRes$annot
    nnL <- length(Z(res)[1,])
    labelsA <- cbind(as.character(1:nnL),
       as.character(1:nnL),as.character(1:nnL),
       as.character(1:nnL))
    resIBDsegmentList <-
      extractIBDsegments(res=res,sPF=sPF,
      annot=annot,chrom="1",labelsA=labelsA,
      ps=0.9,psZ=0.8,inteA=50,thresA=6,mintagSNVs=6,
      off=0,procMinIndivids=0.1,thresPrune=1e-3)

    tagSNVPositions <-
       tagSNVPositions(resIBDsegmentList[[1]])
    snvR <- sample(min(tagSNVPositions):max(tagSNVPositions),
       length(tagSNVPositions))
    snvA <- sort(unique(c(tagSNVPositions,snvR)))

    func = c("stopGain","stopLoss","synonymous",
       "non-synonymous","-","-","-","-","-","-")
    for (i in 1:length(snvA)) {

    if (i>1) {
    write(paste(snvA[i],"1",sample(func,1),sep=" "),
       file="snvAnnotation.txt",ncolumns=100,append=TRUE)
    } else {

    write(paste(snvA[i],"1",sample(func,1),sep=" "),
       file="snvAnnotation.txt",ncolumns=100,append=FALSE)
    }

    }

    tagSNVAnno(resIBDsegmentList[[1]])

    resIBDsegmentList <- setAnnotation(resIBDsegmentList,
       filename="snvAnnotation.txt")

    tagSNVAnno(resIBDsegmentList[[1]])

    setwd(old_dir)

[Package hapFabia version 1.28.0 Index]