al2na / methylKit

R package for DNA methylation analysis
https://bioconductor.org/packages/release/bioc/html/methylKit.html
210 stars 96 forks source link

PCASamples options #319

Closed Hannah1746 closed 5 months ago

Hannah1746 commented 6 months ago

Hello,

I am hoping to get some information on the command PCASamples.

Every time I plot a PCA with this software it cuts off the labels so I can't see what is falling where. I was wondering if there was a way to play with the setting of the PCA plot. If not could we find a way to get the intermediate files that are used to make the PCA plot so we could then plot it with plotPCA and customize it as we please? Other things I would like to play around with is the color of the point and "Proportion of Variance" for the x and y axes labels.

Thank you for your time, Hannah

alexg9010 commented 5 months ago

Hi @Hannah1746,

Concerning your first question

Every time I plot a PCA with this software it cuts off the labels so I can't see what is falling where. I was wondering if there was a way to play with the setting of the PCA plot.

Please see the adj.lim argument of the function, which can be used for adjusting the visibility of sample labels on the on the PCA plot.

Regarding the second question:

If not could we find a way to get the intermediate files that are used to make the PCA plot so we could then plot it with plotPCA and customize it as we please?

There is the argument obj.return does exactly this, it returns the result of the prcomp after all the filtering applied by PCASamples. If you want to know how exactly the filtering and plotting is done, please feel free to have a look at the underlying code of the PCASamples function.

Best, Alex