Chris,

Please type help(is.na) in a R session to access the menu about is.na function. Please use & for and, | for or inside the [ ] for combining selection criteria. The online book at http://cran.r-project.org/doc/manuals/R-intro.pdf is a very useful resource, it helped me a lot when I started.

FeatureIDs = annotatedPeak[!is.na(annotatedPeak$distancetoFeature) & abs(annotatedPeak$distancetoFeature<5000000) & annotatedPeak$ insideFeature %in% c("upstream" , "inside" , "overlapStart"),]$feature

Best regards,

Julie

On 1/20/11 4:52 PM, "Christopher Ricupero" <ricupero@eden.rutgers.edu> wrote:

Hi Julie

Thanks for the quick reply. Could I potentially bother you one more time.  If you could send me some info on how to manipulate the ranged data that would be great.

This function did work, but I wanted to take it 1 step further: To take only (5000 upstream, inside, overlap) and limit to only (500 bp downstream)

My questions are:
1.       What is the [!is.na mean?

2.       I would like to combine my arguments. Instead of taking just the absolute value of 50000000 in distance to feature. I would like to take 50000 distance to feature plus insideFeature : upstream, inside, overlapStart, etc.. but then only 500 bp downsteam.  I am sure there is a way to do this, I am just unsure of the syntax and how to combine the arguments.

Could I say  something like :

abs(annotatedPeak$distancetoFeature<5000000) and annotatedPeak$ insideFeature=”upstream”, “inside”, “overlapStart”)]?

Thanks, Chris





From: Zhu, Lihua (Julie) [mailto:Julie.Zhu@umassmed.edu]
Sent: Thursday, January 20, 2011 3:36 PM
To: Christopher Ricupero; Ou, Jianhong
Cc: bioconductor@stat.math.ethz.ch
Subject: Re: ChIPpeak Anno RangedData question

Chris,

Thanks for your kind comment!

The following code snippets should do.

FeatureIDs = annotatedPeak[!is.na(annotatedPeak$distancetoFeature) & abs(annotatedPeak$distancetoFeature<5000000),]$feature
library(org.Hs.eg.db)
EnrichedGO = GetEnrichedGO(featureIDs, orgAnn="org.Hs.eg.db", maxP=0.01, multiAdj=FALSE, minGOterm=10, multiAdjMethod="")

Best regards,

Julie

On 1/20/11 3:13 PM, "Christopher Ricupero" <ricupero@eden.rutgers.edu> wrote:
Hello Dr. Zhu,

I have recently been introduced to your ChIPpeakAnno package and think it is great.

However, I am having some difficulties when working with the RangedData dataset once it is convereted and then annotated.

I followed your manuscript and exported the annotated Peak file into excel, but I would like to do something different.

What I am trying to accomplish is to filter the annotated peak Ranged Data by either the “distancetoFeature” or “shortestDistance” variables.  I am only interested in peaks that are very close to the promoter regions and TSS so I wanted to limit these distances by approx 5000 kb.  After this , I would then run the GO analysis.

Is this possible to select on this variable to get a subset of my annotated peaks before I run the enrichedGo function?

Thank  you,

Chris

Christopher Ricupero
Graduate Fellow
Rutgers Univeristy
Piscataway, NJ 08854






	[[alternative HTML version deleted]]

