Skip to content
Prev 6579 / 21307 Next

[Bioc-devel] plotPCA for BiocGenerics

I strongly agree with Kevin's position. plotPCA() represents two separate
concerns in its very name: the computation and the rendering. Those need to
be separated, at least behind the scenes. The syntax of plot(pca(x)) is
preferable to plotPCA, because the structure of the operation is
represented by in the expression itself, not just in a non-computable
function name.

With regard to how a plot,PCA should behave: there is always a tension
between high-level and low-level APIs. In the end, we need multiple levels
of abstraction.  While high-level APIs sacrifice flexibility, we need them
because they communicate the high-level *intent* of the user in the code
itself (self-documenting code), and they enable reusability, which not only
reduces redudant effort but also ensures consistency. Once our brains no
longer need to parse low-level code, we can focus our mental power on
correctness and efficiency. To design a high-level API, one needs to
carefully analyze user requirements, i.e., the use cases. To choose the
default behavior, one needs to rate the use cases by their prevalance, and
by how closely they match the intuition-based expectations of the user.

The fact that at least 9 packages are performing such a similar task seems
to indicate that a common abstraction is warranted, but I am not sure if
BiocGenerics is the appropriate place.

Michael

On Tue, Oct 21, 2014 at 12:54 AM, Thomas Dybdal Pedersen <
thomasp85 at gmail.com> wrote: