Excluding samples as referenced in SummarizedExperiment vignette
1
0
Entering edit mode
@11703f46
Last seen 15 months 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 • 902 views
ADD COMMENT
0
Entering edit mode
ATpoint ★ 4.6k
@atpoint-13662
Last seen 13 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".

ADD COMMENT
0
Entering edit mode

Perfect, thank you.

ADD REPLY

Login before adding your answer.

Traffic: 840 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6