Excluding samples as referenced in SummarizedExperiment vignette
1
0
Entering edit mode
@11703f46
Last seen 14 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 • 883 views
ADD COMMENT
0
Entering edit mode
ATpoint ★ 4.5k
@atpoint-13662
Last seen 3 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: 716 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