baySeq
3
0
Entering edit mode
@tina-asante-boahene-5065
Last seen 10.3 years ago
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
• 1.5k views
ADD COMMENT
0
Entering edit mode
@severin-uebbing-5101
Last seen 10.3 years ago
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
ADD COMMENT
0
Entering edit mode
@iain-gallagher-2532
Last seen 9.4 years ago
United Kingdom
Hi Tina From the baySeq vignette: "The calculated priors are stored in the @priors slot of the countData object produced as before... we build an empirical prior distribution which we record in the list object $priors of the slot @priors. Each member of this list object corresponds to one of the models defined by the group slot of the countData object and contains the estimated parameters for each of the individual counts selected under the models. The vector $sampled contained in the slot @priors describes which rows were sampled to create these sets of parameters." So if you're following along using the code in the vignette you should be able to get the priors with: write.table(CDP.NBML@priors$priors, 'test.txt', sep='\t', quote=F) Best Iain ________________________________ From: Tina Asante Boahene <ma08tta@brunel.ac.uk> To: Bioconductor mailing list <bioconductor@r-project.org> Sent: Monday, 6 February 2012, 13:37 Subject: [BioC] baySeq 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@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]]
ADD COMMENT
0
Entering edit mode
@tina-asante-boahene-5065
Last seen 10.3 years ago
Hi all, Is it possible to find the FDR of DE genes in baySeq at a set percentage. Is there a function used in the baySeq vignette to find the FDR at a set percentage. Example to find the FDR for a topCounts at say 1% within baySeq. TopCountP<-topCounts(CDPost.Poi, number = 22490, group = 2) This will give all the FDR for this dataset, however is there a way to just have the result with a pre-set FDR. Also is there something similar for the DEGseq package. Thanks. Kind Regards Tina ________________________________________ From: Severin Uebbing [severin.uebbing@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
ADD COMMENT
0
Entering edit mode
Hi Tina, The easiest way to do this would be to add an additional line; TopCountP[TopCountP$FDR < 0.01,] There's nothing built into the topCounts function, or elsewhere, that gives you the table with this cutoff built in - it's a useful suggestion, though, and should probably be added to the next release. Thanks, Tom On 08/02/2012 01:38, Tina Asante Boahene wrote: > Hi all, > > Is it possible to find the FDR of DE genes in baySeq at a set percentage. > > Is there a function used in the baySeq vignette to find the FDR at a set percentage. > > Example to find the FDR for a topCounts at say 1% within baySeq. > > TopCountP<-topCounts(CDPost.Poi, number = 22490, group = 2) > > This will give all the FDR for this dataset, however is there a way to just have the result with a pre-set FDR. > > Also is there something similar for the DEGseq package. > > Thanks. > > 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
ADD REPLY

Login before adding your answer.

Traffic: 835 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6