Search
Question: Subsetting GSE data with information from two different slots
0
gravatar for A
17 days ago by
A0
A0 wrote:

Hi all, 

I was wondering if anybody could help. I have relatively simple problem, but can't seem to figure out the solution. I am trying to subset some data from a GSE sequencing data that contains 100+ sequencing samples. I am subsetting based on tissue type (and normal vs tumor).

The problem I am having is as follows: I am trying to subset two conditions from one tissue (age). Neonatal liver and adult liver. Which are named as "neonatal liver" or just "liver" for the adult liver. I am subsetting through a slot (source_name) that contains this information as follows:

gse<-getGEO("GSE78076", GSEMatrix = TRUE, getGPL = FALSE)

gse<-gse[[1]]
head(gse)
subset<- gse[,65:103]
subset

levels(subset$source_name_ch1)
lvls<-c("liver", "neonatal liver")
lvls
es<-subset[,subset$source_name_ch1 %in% lvls]
table(lvls)
boxplot(es)
es$source_name_ch1<-factor(es$source_name_ch1, levels = lvls)
es$source_name_ch1

es$source_name_ch1
 [1] liver          liver          liver          liver          liver          liver          liver          liver          liver          liver         
[11] liver          liver          liver          liver          neonatal liver neonatal liver neonatal liver
Levels: liver neonatal liver

This works fine and subsets the data into neonatal liver and adult liver. Within "liver" however, there are different treatments. normal adult liver, or liver that has been treated with a damaging agent. This is all named as "liver"

Information about the the damaging agent vs non damaging agent is in a different slot, es$description, and I am having trouble subsetting my data based on these two slots so that I can actually tease apart neonatal liver, adult liver, and then liver treated with the damaging agent.

es$description
                       V69                        V70                        V71                        V72                        V73 
     primary cells, normal      primary cells, normal      primary cells, normal      primary cells, normal      primary cells, normal 
                       V74                        V75                        V76                        V77                        V78 
primary cells, DDC-treated primary cells, DDC-treated primary cells, DDC-treated primary cells, DDC-treated primary cells, DDC-treated 
                       V79                        V80                        V81                        V82                        V87 
primary cells, DDC-treated primary cells, DDC-treated primary cells, DDC-treated primary cells, DDC-treated      primary cells, normal 
                       V88                        V89 
     primary cells, normal      primary cells, normal 
Levels: metastatic tumor primary cells, DDC-treated primary cells, normal primary tumor

Can somebody please help subset my subset even further to now separate the adult liver from damaged liver which are all currently labelled as just liver as now I am struggling to make the correct comparisons!

Thank you in advance and apologies if any of the code is out of place/you need further information as I am new to this. I'd be happy to provide any further information! I have looked for a solution to this but as far as I can search I cannot find what I am looking for, so apologies if this has been answered before!

Many thanks!

 

ADD COMMENTlink modified 16 days ago by Axel Klenk820 • written 17 days ago by A0
1
gravatar for Axel Klenk
16 days ago by
Axel Klenk820
Switzerland
Axel Klenk820 wrote:

Dear A,

like any subsetting in R, e.g.:

sub <- es[, es$source_name_ch1 == "liver" & es$description == "primary cells, normal"]

Rather a question for R-help or StackOverflow.

HTH,

 - axel

 

ADD COMMENTlink written 16 days ago by Axel Klenk820

Awesome! Thank you so much for clearing that up, and yes will save these R related questions for those forums. Many thanks again!

A

ADD REPLYlink written 15 days ago by A0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 147 users visited in the last hour