queryCounts: Query dataset for top genes

Description Usage Arguments Value Examples

View source: R/queryCounts.R

Description

Filter and sort the given dataset (must be of counts, output by getSNPCounts) based on user- defined parameters.

Usage

1
queryCounts(countsData, minLength = 0, minCounts = 0, sortBy = "counts")

Arguments

countsData

A dataframe. Output of getSNPCounts.

minLength

The minimum length of genes to filter by. Default is 0 (removes nothing).

minCounts

The minimum number of observed SNPs to filter by. Default is 0 (removes nothing).

sortBy

A string that decides the sorting setting of the output. If none of the below arguments are used, use default sorting. Potentional arguments:

  • counts - The default argument. Sort by decreasing SNP counts.

  • length - Sort by decreasing gene length

  • none - No sorting is performed, and the subset is returned as is.

Value

A subset of the countsData data frame that satisfies the user inputs.

Examples

1
2
3
4
countsData <- getSNPCounts(snpPositions)
topHits1 <- queryCounts(countsData, 10000, 150)
topHits2 <- queryCounts(countsData, 10000, 150, sortBy="length")
topHits3 <- queryCounts(countsData, 10000, 150, sortBy="asdf")

LZhang98/nsSNPHotspotViewer documentation built on Dec. 31, 2020, 2:14 p.m.