[BioC] about autoplot in ggbio
Bogdan Tanasa
tanasa at gmail.com
Thu Sep 26 19:44:47 CEST 2013
Dear Michael, and Tengfei,
thank you again for your suggestions. When you have a few more minutes, if
I may ask for further advice :
I am using the R code below,
er_ranges <- rtracklayer::import("ESR_chr2.bed", format = "bed")
er_plots <- autoplot(er_ranges,geom="bar",aes(col=score)) + xlim(regionb)
and/or
er_plots <- autoplot("ESR_chr2.bed") + xlim(regionb)
and the input file "ESR_chr2.bed" (attached) ,
however the output looks different than expected (please see the attached
png files).
I would love to display the data only in the specified genome interval -
and I would appreciate any further advice.
thank you so much, with much appreciation,
Bogdan
On Thu, Sep 26, 2013 at 7:37 AM, Tengfei Yin <tengfei.yin at sbgenomics.com>wrote:
> Hi Bogdan,
>
> Sorry that I missed your email in my gmail account, I just replied.
>
> Thanks Michael for the suggestion.
>
> btw, the gene symbol support for txdb view you mentioned in your email
> will be solved in October release, I was just working on that yesterday.
>
> cheers
>
> Tengfei
>
>
>
>
> On Thu, Sep 26, 2013 at 9:25 AM, Michael Lawrence <
> lawrence.michael at gene.com> wrote:
>
>> Hi, couple of tips below:
>>
>>
>> On Wed, Sep 25, 2013 at 11:19 PM, Bogdan Tanasa <tanasa at gmail.com> wrote:
>>
>> > Dear all,
>> >
>> > I would need a simple suggestion : I am using AUTOPLOT function in GGBIO
>> > package in order to display a set of ChIP-seq peaks in a specific region
>> > (chr-start-end).
>> >
>> > I am reading the set of ChIP-seq peaks in BED format, please could you
>> let
>> > me know how I could display the data only in the specific region
>> > (chr-start-end).
>> >
>> > The R code I am using is :
>> >
>> > -------------------to specify the region -------------------
>> > chr <-"chr2"
>> > start <- 10898631
>> > end <- 11859944
>> > region <- GRanges(chr, IRanges(start,end))
>> >
>> > --------------------to read the file with ChIP-seq peaks
>> ----------------
>> >
>> > er<-read.delim("ChIP-seq.peaks",header=TRUE)
>> > er_ranges <-
>> >
>> >
>> GRanges(seqnames=er$chr,IRanges(er$start,er$end),strand="*",score=er$intensity)
>> >
>> >
>> For the above, you could use:
>>
>> er_ranges <- rtracklayer::import("ChIP-seq.peaks", format = "bed"))
>>
>>
>> > --------------------------to display the data in the region "region"
>> > ---------------------
>> >
>> > er_plots <- autoplot(er_ranges,geom="bar",aes(col=score)) +
>> xlim(start,end)
>> >
>> >
>> You could do something like:
>>
>> er_plots <- autoplot(er_ranges, geom = "bar", aes(fill=score)) +
>> xlim(region)
>>
>> That is, there is an xlim method for GRanges. Also note that you probably
>> want "fill" instead of "col" for the aesthetic, because you are filling
>> the
>> bars. The color will only affect the lines (border). But note that since
>> you already have the height mapped to score, I'm not sure you need the
>> color.
>>
>> Btw, it's also possible to pass the filename directly to ggbio, as long as
>> its file extension is "bed". In the future, we should support rtracklayer
>> file objects, but for now you need to rename to do this:
>>
>> er_plots <- autoplot("ChIP-seq.peaks.bed") + xlim(region)
>>
>> If "score" is present, it automatically uses the bar geom. Not sure if
>> this
>> is the best behavior...
>>
>>
>> OR
>> >
>> > er_plots <- autoplot(er_ranges,geom="bar",which = regionb, stat =
>> > "identity", color = "blue", fill = "blue")
>> >
>>
>>
>> -------------------------------------------------------------------------------------------------------------
>> >
>> > thank you very much !
>> >
>> > Bogdan
>> >
>> > [[alternative HTML version deleted]]
>> >
>> > _______________________________________________
>> > Bioconductor mailing list
>> > Bioconductor at r-project.org
>> > https://stat.ethz.ch/mailman/listinfo/bioconductor
>> > Search the archives:
>> > http://news.gmane.org/gmane.science.biology.informatics.conductor
>> >
>>
>> [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives:
>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>
>
>
>
> --
> Tengfei Yin, PhD
> Seven Bridges Genomics
> sbgenomics.com
> 625 Mt. Auburn St. Suite #208
> Cambridge, MA 02138
> (617) 866-0446
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ESR_chr2_version1.png
Type: image/png
Size: 12222 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/bioconductor/attachments/20130926/4841b3d7/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ESR_chr2_version2.png
Type: image/png
Size: 5752 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/bioconductor/attachments/20130926/4841b3d7/attachment-0001.png>
More information about the Bioconductor
mailing list