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

SnpArray view vs SnpArray.data matrix [question] #110

Open
pdimens opened this issue Sep 6, 2021 · 3 comments
Open

SnpArray view vs SnpArray.data matrix [question] #110

pdimens opened this issue Sep 6, 2021 · 3 comments

Comments

@pdimens
Copy link

pdimens commented Sep 6, 2021

Hello and I apologize for posting this as a question since there is no Discussion component to the repository.

The components of a SnpArray include the data and row/column counts, however I cannot find the show function in the source code. I'm trying to understand the discrepancy between

# load the mouse data
julia> mouse = SnpArray("data/mouse.bed")
1940×10150 SnpArray:
 0x02  0x02  0x02  0x02  0x03    0x03  0x03  0x03  0x03  0x03
 0x02  0x02  0x03  0x02  0x02     0x03  0x03  0x03  0x03  0x03
 0x03  0x03  0x03  0x03  0x03     0x03  0x03  0x03  0x03  0x03
 0x02  0x02  0x02  0x02  0x02     0x03  0x03  0x03  0x03  0x03
 0x03  0x03  0x03  0x03  0x03     0x02  0x02  0x02  0x02  0x02
 0x02  0x02  0x02  0x02  0x03    0x03  0x03  0x03  0x03  0x03
                                                       
 0x03  0x03  0x03  0x03  0x03     0x03  0x03  0x03  0x03  0x03
 0x02  0x02  0x02  0x02  0x03    0x03  0x03  0x03  0x03  0x03
 0x02  0x02  0x03  0x02  0x02     0x03  0x03  0x03  0x03  0x03
 0x02  0x02  0x03  0x02  0x02     0x03  0x03  0x03  0x03  0x03
 0x02  0x02  0x02  0x02  0x02     0x01  0x01  0x01  0x01  0x01
 0x00  0x00  0x00  0x00  0x03     0x03  0x03  0x03  0x03  0x03

but the underlying SnpArray.data is a matrix of 485x10150

julia> mouse.data
485×10150 Matrix{UInt8}:
 0xba  0xba  0xbe  0xba  0xbb  …  0xff  0xff  0xff  0xff  0xff
 0xab  0xab  0xeb  0xab  0xbf     0xfe  0xfe  0xfe  0xfe  0xfe
 0xbe  0xbe  0xbf  0xbe  0xfe     0xcb  0xcb  0xcb  0xcb  0xcb
 0xab  0xab  0xab  0xab  0xff     0xf4  0xf4  0xf4  0xf4  0xf4
 0x8e  0x8e  0x8f  0x8e  0xfe     0xff  0xff  0xff  0xff  0xff
 0xae  0xae  0xaf  0xae  0xfe  …  0xfb  0xfb  0xfb  0xfb  0xfb
    ⋮                          ⋱     ⋮                    
 0x8c  0x8c  0xce  0x8c  0xbe     0xbf  0xbf  0xbf  0xbf  0xbf
 0x23  0x23  0x33  0x23  0xef  …  0xbb  0xbb  0xbb  0xbb  0xbb
 0xff  0xff  0xff  0xff  0xff     0xff  0xff  0xff  0xff  0xff
 0xaf  0xaf  0xaf  0xaf  0xef     0xff  0xff  0xff  0xff  0xff
 0xbb  0xbb  0xbb  0xbb  0xff     0xff  0xff  0xff  0xff  0xff
 0x2a  0x2a  0x2f  0x2a  0xea     0xdf  0xdf  0xdf  0xdf  0xdf
  • How is the SnpArray showing a matrix with 4x more rows than the underlying data?
  • What is the conversion between what seems like hex to binary?
  • Where is the show method for this?

Thank you!

@Hua-Zhou
Copy link
Member

Hua-Zhou commented Sep 6, 2021 via email

@pdimens
Copy link
Author

pdimens commented Sep 6, 2021

Thanks for the response. If the SnpArray has multiple fields, how is the default show method showing only this matrix? I'm also not clear on where in the source code this conversion occurs.

@Hua-Zhou
Copy link
Member

Hua-Zhou commented Sep 6, 2021 via email

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

No branches or pull requests

2 participants