Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ideas for improving the print method #4

Open
karoliskoncevicius opened this issue Apr 30, 2023 · 0 comments
Open

Ideas for improving the print method #4

karoliskoncevicius opened this issue Apr 30, 2023 · 0 comments
Labels

Comments

@karoliskoncevicius
Copy link
Owner

karoliskoncevicius commented Apr 30, 2023

This issue is dedicated for collecting ideas about improvements to annmatrix print method.

Currently print.annmatrix does quite a good job of displaying annmatrix and possible annotations in a compact form:

X

             [,1]        [,2]        [,3]        [,4]                    [,6]
 [1,] -0.66184983 -0.38282188 -1.26681476 -1.42199245 ........... -1.86544873
 [2,]  1.71895416  0.29942160 -0.19858329 -0.32822829 ...........  1.82998433
 [3,]  2.12166699  0.67423976  0.13886578  0.28457007 ........... -0.99111590
 [4,]  1.49715368 -0.29281632 -0.27933600  0.71933588 ........... -1.45043462
      ........... ........... ........... ........... ........... ...........
[10,]  1.04318309  1.08808601 -1.42776759  0.01587026 ........... -0.14174471

rann: chr, pos
cann: group, sex

However, it doesn't show anything about the types or actual values of those annotations.
Maybe it would be possible to add them nicely somewhere, similar to what @HenrikBengtsson did in his Wishlist-for-R:

X

     male female
       43     28
        B      C
[1,]    4      7
[2,]    5      8
[3,]    6      9

Seems like this would only work for a small number of short annotations and it might be tricky to get it right in practice.
Here is one prototype with a small amount of annotations:

                        sex       "F"        "M"       "F" 
                        age        22         39        73
                      group    "case"  "control"    "case"

 chr     position                [,1]       [,2]      [,3]
 "chr1"    100103      [1,]      20.3       17.2        10
 "chr1"    100203      [2,]        13        0.5      -0.1
 "chr2"      3030      [3,]       9.3        1.1      10.5
 "chr3"     14140      [4,]        -4          0      22.2

But in general case both the number of annotations and the annotation entry lengths might have to be truncated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant