Ok, so when you are done with your analysis, you will have an object
containing the results of your run. In the vignette this is called
CDPost.NBML. If you now invoke the plotMA function like below, you get
what you want:
plotMA.CD(CD, samplesA = "simA", samplesB = "simB", col =
ifelse(exp(CDPost.NBML at posteriors[,2]) > 0.3, "red", "black"))
Some remarks: The samples of the two groups are called simA and simB
in
the baySeq vignette but might be called by you however you want. The
posteriors are in the slot @posteriors of your resulting object. If
you
have done everything like in the vignette, the posteriors for the
differential expression model are in the second column, therefore
CDPost.NBML at posteriors[,2]. The posteriors in baySeq are natural
logarithmic values, so by using exp(x) you get posterior values which
range from 0 to 1 and 0.3 is the cutoff value recommended by the
authors
of the method.
Best, severin
On 02/06/2012 06:21 PM, Tina Asante Boahene wrote:
> Hi Severin,
>
>
> Thank you for the quick reply.
>
> Sorry for the confusion what I might was the posteriors.
>
> Referring back to the MA-plot in the baySeq vignette shown below,
> the differentially expressed DE genes of the two samples were
identified by colouring the first 100 red and the rest black.
> This I believe was because they already knew which genes DE.
>
> plotMA.CD(CD, samplesA = c(1,3,6,8,10), samplesB = c(2,4,5,7,9), col
= c(rep("red",
> 100), rep("black", 900)))
>
> However, I wanted to understand how I could generalise my dataset to
produce an MA-plot displaying all the DE genes in my dataset.
>
> If it is still not clear, please do let me know.
>
> Thank you once again for your help.
>
>
>
>
>
> Kind Regards
>
> Tina
> ________________________________________
> From: Severin Uebbing [severin.uebbing at ebc.uu.se]
> Sent: 06 February 2012 16:40
> To: Tina Asante Boahene
> Subject: Re: [BioC] baySeq
>
> Hi Tina,
>
> I'm not quite sure what you mean with your question about the plotMA
> function. However, if you want to create a plot, where a subset of
genes
> is plotted in red, whereas the rest is plotted in black, you can
> certainly do so. You could, e.g. create a vector which contains
either
> "red" or "black" (much like the example in the baySeq vignette), but
> according to your wishes. If you want to have all differentially
> expressed genes coloured red, then you might want to create a
vector,
> where all genes with a posterior probability of exp(DE)> 0.3 are
"red".
> All you need to do to get your coloured plot is to use plotMA(...,
col =
> my_colour_vector). Is that what you are looking for?
>
> The second question should also be solvable. The object where you
saved
> your priors in, e.g. according to manual:
>
> CDP.NBML<- getPriors.NB(...)
>
> contains a slot called @priors with an object $priors. So if you
want to
> export this vector, you can do so using the command
>
> write.table(CDP.NBML at priors$priors,file = "my_file.csv", sep =
"\t",
> row.names = F, quote = F)
>
> This will create a tab delimited file which you can also open in
Excel
> if you like.
>
> Out of curiosity, why are you interested in the priors? Shouldn't
you
> want to look at the posteriors?
>
> Severin
>
> On 02/06/2012 02:37 PM, Tina Asante Boahene wrote:
>> Dear All,
>>
>> I just hoping if you would not mind help me answer these questions
>>
>> With regard to the plotMA I have realised that this plot was tailor
to the data used my the author.
>> However, is there a general way to approach this to incorporate
with different dataset.
>>
>> plotMA.CD(CD, samplesA = c(1,3,6,8,10), samplesB = c(2,4,5,7,9),
col = c(rep("red",
>> 100), rep("black", 900)))
>>
>> Also is there a way to write the output of the priors to a
spreadsheet eg Excel.
>>
>> Thank you.
>>
>>
>> Kind Regards
>>
>> Tina
>> _______________________________________________
>> 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
>>
>
> --
> Severin Uebbing
> Dept. Ecology& Genetics | Evolutionary Biology
> Evolutionary Biology Centre
> Uppsala University
> Norbyv?gen 18D
> SE-752 36 Uppsala, Sweden
> Phone: +46-18 471 28 27