sub-.rMSIprocPeakMatrix: Subsetting operator for rMSIproc peak matrices.

Description Usage Arguments Value Examples

Description

Subsetting operator for rMSIproc peak matrices.

Usage

1
2
## S3 method for class 'rMSIprocPeakMatrix'
x[pixels = 1:sum(x$numPixels), columns = 1:length(x$mass)]

Arguments

x

rMSIproc peak matrix object.

pixels

the selected rows to retain in the peak matrix. This argument can be an integer, a boolean or a character.

columns

an integer vector with the peak matrix columns to retain.

Value

rMSIproc peak matrix object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#For the following example we will load an rMSIproc peak matrix in the pks variable:
pks <- rMSIproc::LoadPeakMatrix("/path/to/my/peak/matrix.zip")

#Subsetting a peak marix by pixel ID's:
pks1_100 <- pks[1:100, ]

#Subsetting a peak matrix using a boolean expression:
clus <- kmeans(pks$intensity/pks$normalizations$TIC, centers = 5) #perform a kmeans clustering with the whole peak matrix (TIC normalized)
clus2SubImg <- pks[clus$cluster==2, ] #Creat a subdataset with only pixels belonging to cluster 2

#Subsetting a peak matrix using image names:
pks_brain1 <- pks["Brain_img1", ]

#Subsetting to a specific column range:
pks_massrange <- pks[, 10:50]

#Subsetting by columns and rows:
pks_brain1 <- pks["Brain_img1", 10:50]

prafols/rMSIproc documentation built on Dec. 12, 2021, 7:31 p.m.