Hello there!
I've an object that describes the genomic distribution of my ChIPPeaks: Annotated peaks generated by ChIPseeker 16887/16887 peaks were annotated Genomic Annotation Summary:
Feature Frequency
9 Promoter 80.2392373
4 5' UTR 0.8704921
3 3' UTR 0.7875881
1 1st Exon 0.9237875
7 Other Exon 1.4093682
2 1st Intron 5.6019423
8 Other Intron 2.5996329
6 Downstream (<=300) 0.4026766
5 Distal Intergenic 7.1652751
This is a list of the PeakAnno object, the structure of each of them is:
str(peakAnnoList)[[1]]
By looking at the str of the object:
.. ..@ detailGenomicAnnotation:'data.frame': 16887 obs. of 9 variables:
.. .. ..$ genic : logi [1:16887] FALSE TRUE TRUE FALSE TRUE TRUE ...
.. .. ..$ Intergenic : logi [1:16887] TRUE FALSE FALSE TRUE FALSE FALSE ...
.. .. ..$ Promoter : logi [1:16887] FALSE TRUE TRUE TRUE TRUE TRUE ...
.. .. ..$ fiveUTR : logi [1:16887] FALSE TRUE TRUE FALSE TRUE TRUE ...
.. .. ..$ threeUTR : logi [1:16887] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. ..$ Exon : logi [1:16887] FALSE TRUE TRUE FALSE TRUE TRUE ...
.. .. ..$ Intron : logi [1:16887] FALSE TRUE TRUE FALSE TRUE TRUE ...
.. .. ..$ downstream : logi [1:16887] FALSE FALSE FALSE FALSE FALSE FALSE ...
.. .. ..$ distal_intergenic: logi [1:16887] TRUE FALSE FALSE FALSE FALSE FALSE ...
This is a list of true and false and the number of the TRUE shall be the number of peaks I am searching for. How can I count all of of those TRUE in every @ detailGenomicAnnotation of peakAnnolist? Thank u!
Please format code/output with the code button (1010101) in the editor, it makes it a lot easier to read and understand. In addition, it is difficult to answer this question without additional information as to what type of object it is, code used to generate it, etc.
as.data.frame()
can be used to coerce many objects to a dataframe, so you could try that, but it really depends on the type of object.Oh sure, I am sorry. I't is a chip seeker object (PeakAnno) Used to perform a genome distribution graph.
I just wanted to understand what is in an particular "r" object. when I look at it in R studio I can see it is very similar to the R object of deseq2 (dds) for instance.
I think what I search for is in the str command:
And goes on
so that means you could, for example, use the command above for that list object: