samplePoints {Guitar} | R Documentation

## samplePoints

### Description

This function calculates the length of each sites and then samples the points from sites by using two sampling methods based on the number of sampling points. One sampling method is equidistant sampling, the N sampling points are sampled at equal intervals according to the length of the site. Another method is random sampling, and N sampling points are randomly distributed on the site.

### Usage

    samplePoints(sitesGrangelists,
                 stSampleNum = 5,
                 stAmblguity = 5,
                 pltTxType = c("tx","mrna","ncrna"),
                 stSampleModle = "Equidistance",
                 mapFilterTranscript = FALSE,
                 guitarTxdb)

### Arguments

`sitesGrangelists` | A GRangeslist object, the content of the sites information.
`stSampleNum` | The number of bases sampled at each Site. Default: 3.
`stAmblguity` | Maximum overlap between sites. Default: 5.
`pltTxType` | Transcript type mapped to guitartxdb.
`stSampleModle` | sampling "Equidistance",sampling "random". Default:"Equidistance".
`mapFilterTranscript` | Whether to filter the length of transcripts equal the original site. Default: FALSE.
`guitarTxdb` | Sites mapping on guitartxdb and finding the corresponding location on the transcript.

### Value

A GRange data list, the content of the list is the sampling point, the width is 1, the total number of data is N times the input data.

### Author(s)

Xiao Du<xiao.du@cumt.edu.cn>

### Examples

    # read genomic features
    stBedFile <- system.file("extdata", "m6A_mm10_exomePeak_1000peaks_bed12.bed", package="Guitar")
    site <-  blocks(import(stBedFile))
    #generate GuitarTxdb
    txdb_file <- system.file("extdata", "mm10_toy.sqlite", package="Guitar")
    txdb <- loadDb(txdb_file)
    guitarTxdb <- makeGuitarTxdb(txdb)
    # sample site points
    sitesPoints <- samplePoints(list(site),
                                stSampleNum = 5,
                                stAmblguity = 5,
                                pltTxType = c("tx","mrna","ncrna"),
                                stSampleModle = "Equidistance",
                                mapFilterTranscript = FALSE,
                                guitarTxdb)

[Package Guitar version 2.0.0 Index]