Excluding samples as referenced in SummarizedExperiment vignette
1
0
Entering edit mode
@11703f46
Last seen 7 weeks ago
Australia

Hi,

Just a really quick question as I'm fairly new to working with SummarizedExperiment container and just hoping someone can give a snippet of what the community standard code is for the following. From SummarizedExperiment Vignette: "if you want to exclude a given sample you can do for both the meta-data and assay in one operation, which ensures the meta-data and observed data will remain in sync."

SummarizedExperiment vignette • 190 views
0
Entering edit mode
ATpoint ★ 1.3k
@atpoint-13662
Last seen 5 hours ago
Germany

Nothing special here, same rules as filtering other data types such as data.frame or matrix apply.

#/ only the first three columns to retain
se_filter <- se[,c(1,2,3)]

#/ if rownames are genes only keep those with a pattern, e.g. starting with "mt-"
se_filter <- se[grep("^mt-", rownames(se)),]


The assays, col- and rowData are automatically filtered so everything is kept "in sync".

0
Entering edit mode

Perfect, thank you.