subsetting of expressionSet
1
0
Entering edit mode
8.7 years ago

Hi I want to subset an expressionSet that includes samples from control,node negative and positive of breast cancer

I run this code

`eset <-my_eset[,my_eset$Disease== c("control","node negative breast cancer")]

but it didn't work well (some of samples dropped )

Thank you.

R bioconductor • 2.6k views
ADD COMMENT
1
Entering edit mode
8.7 years ago

The problem is your logical evaluation. The following illustrates what I mean:

> test_seq <- seq(1:10)

> test_seq==c(1,3)
[1]  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

> test_seq==1 | test_seq==3
[1]  TRUE FALSE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

> test_seq[test_seq==1 | test_seq==3]
[1] 1 3

So to fix your code, it should use the | (logical or). Also, I assume you want to subset rows, so your subsetting command should be genedata[logical_expression, ] instead of genedata[, logical_expression] so your code should be: eset <- my_eset[my_eset$Disease == "control" | my_eset$Disease == "node negative breast cancer", ]

ADD COMMENT
0
Entering edit mode

Thank you Kolea Zimmerman

ADD REPLY

Login before adding your answer.

Traffic: 2209 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