Skip to content

?imgRaster should offer a choice between the SpatialExperiment and SpatialImage methods #111

Open

Description

@LTLA

I don't know how many other generics have methods for both classes, but methods for both classes should respond to ?<method-name>. Otherwise users have to type out ?"imgRaster,SpatialExperiment-method", which is not obvious.

Activity

  1. LTLA commented on Aug 10, 2022

    @LTLA
    ContributorAuthor

    On a related note, ?imgSource doesn't appear to be actually documented.

  2. HelenaLC commented on Aug 11, 2022

    @HelenaLC
    Collaborator

    Yeah, I found this not straightforward and really confusing to document actually... Could you clarify what you mean by "should respond to ?<method-name>"? I.e., what behavior would you expect / want to be supported? I think the issue is that most people (including me) will just do ?imgX, and it's not clear whether this should point to the SPI or SPE's imgData-methods doc. And yes, good point re imgSource; it's currently only documented under ?imgData-methods`...

  3. LTLA commented on Aug 11, 2022

    @LTLA
    ContributorAuthor

    Could you clarify what you mean by "should respond to ?"? I.e., what behavior would you expect / want to be supported?

    Basically, if I do ?imgRaster, I should get a prompt like:

    > ?cbind
    Help on topic ‘cbind’ was found in the following packages:
    
      Package               Library
      BiocGenerics          /Users/luna/Software/R/R-4-2-branch/library
      base                  /Users/luna/Software/R/devel/library
    
    Choose one
    
    1: Combine objects by rows or columns {BiocGenerics}
    2: Combine R Objects by Rows or Columns {base}
    
    Selection:
    

    In this case, the two choices would be between the documentation pages for the SPExperiment and VSImage methods.

    I believe this can be achieved by making an @aliases imgRaster on the documentation page for the SPE. Currently ?imgRaster goes directly to the VSI one.

  4. HelenaLC commented on Aug 12, 2022

    @HelenaLC
    Collaborator

    I think this doesn't work. The above prompt upon ?<method> appears when multiple packages export <method>. However, when I add @alises imgRaster to the imgData-methods help page, ?imgRaster still goes directly to the SpatialImage-class one. Looks like having the same alias appear in multiple docs is ignored, and the first doc (whatever first means here) is shown silently.

  5. LTLA commented on Aug 12, 2022

    @LTLA
    ContributorAuthor

    Hm. In that case, it may be worth having an explicit page for the img* generic, so that anyone typing ?imgRaster will get to the documentation for the method rather than the class.

    In general, it seems like we should document by generic, rather than by class, with the assumption that someone doing ?generic would prefer to know the generic rather than one of the classes it operates on.

    The exception would be for generics that only apply to a single class, which can be grouped in the docpage for that class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions