如果probeID
列与coMeth_ls
列表中的cg*
项之一匹配,我希望对distal.results.stratified.model.1
Dataframe 进行子集化。我的代码返回空数据框。
distal.dmr.cpgs.1a <- distal.results.stratified.model.1a[
sapply(
strsplit(distal.results.stratified.model.1a$probeID, ' '),
function(x) any(x %in% coMeth_ls)), ]
数据:
> dput(distal.results.stratified.model.1a[1:3,1:3])
structure(list(regionID = c("chr1:1355332-1355333", "chr1:15934516-15934517",
"chr1:15934516-15934517"), probeID = c("cg03324138", "cg01522970",
"cg01522970"), target = c("ENSG00000162576", "ENSG00000065526",
"ENSG00000065526")), row.names = c(NA, 3L), class = "data.frame")
> dput(coMeth_ls[1:10])
list(`chr1:2250410-2250796` = c("cg03324138", "cg02237208", "cg00567930"
), `chr1:2886792-2886868` = c("cg01977798", "cg00050294", "cg04080530"
), `chr1:8271997-8272277` = c("cg02847588", "cg00590817", "cg06780032"
), `chr1:10895950-10896004` = c("cg02971581", "cg09510180", "cg00944431"
), `chr1:12600225-12600529` = c("cg07586026", "cg07242540", "cg00003578"
), `chr1:16553267-16553456` = c("cg03969515", "cg03522107", "cg02987928"
), `chr1:19665131-19665240` = c("cg09356672", "cg05348366", "cg04928049"
), `chr1:23003462-23003569` = c("cg01795776", "cg09062638", "cg02623028"
), `chr1:28573736-28573940` = c("cg05045517", "cg03226554", "cg07148744",
"cg07913096"), `chr1:29460817-29461070` = c("cg06155303", "cg09264065",
"cg08597839", "cg00107241"))
1条答案
按热度按时间z9smfwbn1#
不完全确定你想要什么,但如果你想选择
distal.results.stratified.model.1a
的行,其中probeID
匹配列表coMeth_ls
的任何子元素,那么用途: