Sure....will wait for your e-mail...

--Yadav

On Tue, Apr 3, 2012 at 2:06 PM, Tengfei Yin <yintengfei@gmail.com> wrote:

>
>
> On Tue, Apr 3, 2012 at 2:50 PM, Yadav Sapkota <ysapkota@ualberta.ca>wrote:
>
>> Hi Tengfei,
>>
>> Thanks for the info. It worked so far using the following code:
>>
>> source("http://bioconductor.org/biocLite.R")
>> biocLite("GenomicRanges")
>> library(GenomicRanges)
>> mydata=read.table('C:/......Book1.csv', header=T, sep=',')
>> attach(mydata)
>> gr.cnv=GRanges(Chr, IRanges(Start, Stop), pvalue=mydata$P1)
>> source("http://bioconductor.org/biocLite.R")
>> biocLite("ggbio")
>> library(ggbio)
>> plotGrandLinear(gr.cnv, y=pvalue, geom='point', color.type='twocolor',
>> two.color=c('red', 'blue'), xlab='Chromosomes', ylab=substitute('-log10
>> p-value'))+theme_bw()
>>
>> Hi Yadav,
>
> Thanks for your nice feedback.
>
>>
>>    - In the generated plot, I have some chromosomes overlapping, due to
>>    which its hard to see these. I know the reason as there are too little
>>    signatures to plot. Is there any way that I can manipulate the code so that
>>    I will have a 'FIXED' size for all the chromosomes? This would avoid the
>>    overlapping the chromosomes despite the number of signatures to plot.
>>
>> That's exactly what I am doing now, when I mention it's under going some
> change, it's not in plotGrandLinear function yet(some lower level function
> have that features),  the strategy will be
> 1. it first parse seqlengths with you could set on your GRanges object
> with fixed width.
> 2. if you don't have seqlengths defined, it will use data space.
> 3. allow you add buffer in between
>
>
>>    - Another thing, chromosomes in the plot appear like 1, 10,
>>    11.......2, 20, 21, 3, 4, 5....X. I tried to sort using 'order' function
>>    but I think this does not work in GRanges objects. How do I order these
>>    chromosomes like 1, 2,3,4,5,6,7,8,9,10,.....X?
>>
>>
> I leave that to users, your should re-order your seqname and remove your
> unused seqlevels for your gr.cnv,
> please check ?keepSeqlevels and ?renameSeqlevels in package GenomicRanges.
>
> Let's keep in touch, I will update a case study on-line
> and plotGrandLinear  function in these two days, and will let you know then
> you can test with your data.
>
> cheers
>
> Tengfei
>
>
>>
>>
>> Your advice would be much appreciated.
>>
>> Regards,
>> Yadav
>>
>>
>>
>>
>> On Tue, Apr 3, 2012 at 12:18 PM, Tengfei Yin <yintengfei@gmail.com>wrote:
>>
>>> Hi Yadav,
>>>
>>> if you are going to use *ggbio* package, it require GRanges as input
>>> for your Manhattan plot, you need to *rearrange* your results into a
>>> GRanges object,  generally you have to parse chromosome names and region
>>> from your original data and use GRanges constructor for saving them as a
>>> GRanges object. like
>>>
>>> library(GenomicRanges)
>>> gr.snp <- GRanges(chrs,
>>>                   IRanges(start = your_start_pos, end = your_end_pos),
>>>                    pvalue =  your_pvalue))
>>>
>>> ## where chrs are your chromosome vectors, and your_start_pos,
>>> your_end_pos defines your region, you put your p-value, as your extra
>>> elementMetadata column.
>>>
>>> ## then
>>> library(ggbio)
>>> plotGrandLinear(gr.snp, y = pvalue, geom = "point") + theme_bw()
>>>
>>> you can check example ?plotGrandLinear
>>>
>>> FYI: this is going to be a separate transformation stage in the very
>>> near future, it is undergoing some change,so if you came across any issues,
>>> you could file a issue at https://github.com/tengfei/ggbio/issues, or
>>> email me back.
>>> This week I am renewing the website, I will put a example for Manhattan
>>> plot as one of the case studies on the website. Will sent you an email
>>> later.
>>>
>>> HTH
>>>
>>> Tengfei
>>>
>>>
>>>
>>>
>>>
>>> On Tue, Apr 3, 2012 at 12:45 PM, Yadav Sapkota <ysapkota@ualberta.ca>wrote:
>>>
>>>> Hello,
>>>>
>>>> I am trying to generate a Manhattan plot using the association results
>>>> from
>>>> CNVs. Following is the example data:
>>>>
>>>>  Regions P value =-LOG10(P value)  chr1:100132667-100143425 0.2238316
>>>> 0.650078601  chr1:100274010-100276481 0.2766402 0.55808471
>>>> chr1:100295062-100304021 0.3608504 0.442672809  chr1:100763109-100777987
>>>> 0.8155034 0.088574224  chr1:100797078-100799030 1 0
>>>> chr1:100910270-100930160 1 0  chr1:100943609-100975280 0.4864253
>>>> 0.312983845
>>>>
>>>> I would appreciate if anyone knows any package or script for this.
>>>>
>>>>
>>>> Regards,
>>>> Yadav
>>>>
>>>>        [[alternative HTML version deleted]]
>>>>
>>>> _______________________________________________
>>>> Bioconductor mailing list
>>>> Bioconductor@r-project.org
>>>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>>>> Search the archives:
>>>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>>>
>>>
>>>
>>>
>>> --
>>> Tengfei Yin
>>> MCDB PhD student
>>> 1620 Howe Hall, 2274,
>>> Iowa State University
>>> Ames, IA,50011-2274
>>> Homepage: www.tengfei.name
>>>
>>>
>>
>
>
> --
> Tengfei Yin
> MCDB PhD student
> 1620 Howe Hall, 2274,
> Iowa State University
> Ames, IA,50011-2274
> Homepage: www.tengfei.name
>
>
>


-- 
Yadav Sapkota
PhD Candidate
Dept. of Laboratory Medicine and Pathology, UofA
Cross Cancer Institute
11560 University Avenue, Edmonton AB T6G 1Z2
Phone: 780-5778092

	[[alternative HTML version deleted]]

