eSetDimName: Get dimname from an eSet object

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/rqubic_to_c_funcs.R

Description

This function is implemented to automatically validate and choose feature (sample) names from the user input. This function is exported for the purpose of easing other Bioconductor developers performing the similar job, and is not tended to be called by end-user directly.

Usage

1
eSetDimName(eset, input, type = c("feature", "sample"))

Arguments

eset

An object of eSet class, mostly an ExpressionSet class.

input

The user input, see details below

type

Either ‘feature’ or ‘sample’, indicating which dimension should be determined

Details

The input can be one of the following three possibilities:

If none of the scenarios above was met, the function stops by raising an error.

Value

A vector of characters, the length of which determined by the dimension of the input object.

Note

A special case arises if one of the dimensions of the eset object is 1: In this case, the input value is interpreted as the new name and returned. No column name match will take place in this case.

Author(s)

Jitao David Zhang <jitao_david.zhang@roche.com>

See Also

sampleNames, featureNames, fData, pData

writeQubicInputFile calls the function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data(sample.ExpressionSet, package="Biobase")
sub.eset <- sample.ExpressionSet[1:3, 1:3]

## usage one:
eSetDimName(sub.eset, type="feature")
eSetDimName(sub.eset, type="sample")

## usage two
## "sex" is one column in the pData(sub.eset) 
eSetDimName(sub.eset, input="sex", type="sample")
## Not run: eSetDimName(sub.eset, input="foo", type="sample")

## usage three
eSetDimName(sub.eset, input=paste("Sample", 1:3), type="sample")
## Not run: eSetDimName(sub.eset, input=paste("Sample", 1:4),
type="sample")
## End(Not run)

## special case: dim equals to one
eSetDimName(sub.eset[,1], input="foo", type="sample")

rqubic documentation built on Nov. 8, 2020, 8:20 p.m.