neurodata / ndgrutedb

Pipeline and tools for estimating human connectomes from Diffusion, Structural, and Functional MRI
http://neurodata.io
Apache License 2.0
29 stars 13 forks source link

Add support for vertex attributes mat -> graphml #206

Open disa-mhembere opened 8 years ago

gkiar commented 8 years ago

How are the attributes represented in the mat format? Is the graph a structure (more like an actual graph) instead of an adjacency matrix? Do you have a sample file from Avner to go off of?

Greg Kiar gkiar07@gmail.com

On Thu, Dec 10, 2015 at 10:16 PM, Disa Mhembere notifications@github.com wrote:

— Reply to this email directly or view it on GitHub https://github.com/openconnectome/m2g/issues/206.

disa-mhembere commented 8 years ago

I was thinking of using matlab cells but the user would have to specify each the vertex attribute each dimension would assume. Also not sure scipy.io has a reader. EDIT: It does Alternatively users can provide a stack of 2D arrays and vertex attribute names that are then interpreted in a certain way for graphml.

Any suggestions? Oh and there is no sample until i figure out the design ..

On Fri, Dec 11, 2015 at 8:55 AM, Greg Kiar notifications@github.com wrote:

How are the attributes represented in the mat format? Is the graph a structure (more like an actual graph) instead of an adjacency matrix? Do you have a sample file from Avner to go off of?

Greg Kiar gkiar07@gmail.com

On Thu, Dec 10, 2015 at 10:16 PM, Disa Mhembere notifications@github.com wrote:

— Reply to this email directly or view it on GitHub https://github.com/openconnectome/m2g/issues/206.

— Reply to this email directly or view it on GitHub https://github.com/openconnectome/m2g/issues/206#issuecomment-163941645.

gkiar commented 8 years ago

I think a cell array might be the right choice. I can't see a way around needing two data structures in the .mat format, though, because if a graph were allowed self-loops then there is no where we can put node attributes in the NxN adjacency matrix. So perhaps an Nx1 which is a cell array, the first element being node id, all following being key-value pairs, and an NxN cell matrix where the first element of each cell is the edge weight and similarly the rest are all key-value pairs.

Thoughts?

Greg Kiar gkiar07@gmail.com

On Fri, Dec 11, 2015 at 12:18 PM, Disa Mhembere notifications@github.com wrote:

I was thinking of using matlab cells but the user would have to specify each the vertex attribute each dimension would assume. Also not sure scipy.io has a reader. Alternatively users can provide a stack of 2D arrays and vertex attribute names that are then interpreted in a certain way for graphml.

Any suggestions? Oh and there is no sample until i figure out the design ..

On Fri, Dec 11, 2015 at 8:55 AM, Greg Kiar notifications@github.com wrote:

How are the attributes represented in the mat format? Is the graph a structure (more like an actual graph) instead of an adjacency matrix? Do you have a sample file from Avner to go off of?

Greg Kiar gkiar07@gmail.com

On Thu, Dec 10, 2015 at 10:16 PM, Disa Mhembere < notifications@github.com> wrote:

— Reply to this email directly or view it on GitHub https://github.com/openconnectome/m2g/issues/206.

— Reply to this email directly or view it on GitHub <https://github.com/openconnectome/m2g/issues/206#issuecomment-163941645 .

— Reply to this email directly or view it on GitHub https://github.com/openconnectome/m2g/issues/206#issuecomment-163995343.

wrgr commented 8 years ago

what about trying to mirror the way attributes are stored in networkx or igraph?

@jovo

jovo commented 8 years ago

maybe brain connectivity toolbox (in matlab) has a solution already that we could use. i also don't think this is a high priority for me.

disa-mhembere commented 8 years ago

Yes I would prefer an established format of some kind as well.

On Fri, Dec 11, 2015 at 5:00 PM, joshua vogelstein <notifications@github.com

wrote:

maybe brain connectivity toolbox (in matlab) has a solution already that we could use. i also don't think this is a high priority for me.

— Reply to this email directly or view it on GitHub https://github.com/openconnectome/m2g/issues/206#issuecomment-164061277.

disa-mhembere commented 8 years ago

Thanks guys -- I like this solution best so far. There is an actual MATLAB graph format that was created to handle such a task. I prefer to use this.

All not in favor say nay ..

jovo commented 8 years ago

good find. let's use that

disa-mhembere commented 8 years ago

Balls! When read as both a matlab matrix by scipy or as an hdf5 file the data is unintelligible -- matlab does not release a description of their data structures so we cannot binary read these even if we wanted to ... We may have to fall back on one of the other suggestions ...

gkiar commented 8 years ago

Ahhhh that's the worst. Thanks for sorting this out!

Greg Kiar gkiar07@gmail.com

On Thu, Dec 17, 2015 at 6:46 PM, Disa Mhembere notifications@github.com wrote:

Balls! When read as both a matlab matrix by scipy or as an hdf5 file the data is unintelligible -- matlab does not release a description of their data structures so we cannot binary read these even if we wanted to ... We may have to fall back on one of the other suggestions ...

— Reply to this email directly or view it on GitHub https://github.com/openconnectome/m2g/issues/206#issuecomment-165617552.

jovo commented 8 years ago

i vote we push this down on the priority list...

On Thu, Dec 17, 2015 at 6:55 PM, Greg Kiar notifications@github.com wrote:

Ahhhh that's the worst. Thanks for sorting this out!

Greg Kiar gkiar07@gmail.com

On Thu, Dec 17, 2015 at 6:46 PM, Disa Mhembere notifications@github.com wrote:

Balls! When read as both a matlab matrix by scipy or as an hdf5 file the data is unintelligible -- matlab does not release a description of their data structures so we cannot binary read these even if we wanted to ... We may have to fall back on one of the other suggestions ...

— Reply to this email directly or view it on GitHub <https://github.com/openconnectome/m2g/issues/206#issuecomment-165617552 .

— Reply to this email directly or view it on GitHub https://github.com/openconnectome/m2g/issues/206#issuecomment-165618981.

the glass is all full: half water, half air. neurodata.io

disa-mhembere commented 8 years ago

Yeah I spent 2 hours on it today and I'm happy to do so. On Dec 17, 2015 7:09 PM, "joshua vogelstein" notifications@github.com wrote:

i vote we push this down on the priority list...

On Thu, Dec 17, 2015 at 6:55 PM, Greg Kiar notifications@github.com wrote:

Ahhhh that's the worst. Thanks for sorting this out!

Greg Kiar gkiar07@gmail.com

On Thu, Dec 17, 2015 at 6:46 PM, Disa Mhembere <notifications@github.com

wrote:

Balls! When read as both a matlab matrix by scipy or as an hdf5 file the data is unintelligible -- matlab does not release a description of their data structures so we cannot binary read these even if we wanted to ... We may have to fall back on one of the other suggestions ...

— Reply to this email directly or view it on GitHub < https://github.com/openconnectome/m2g/issues/206#issuecomment-165617552 .

— Reply to this email directly or view it on GitHub <https://github.com/openconnectome/m2g/issues/206#issuecomment-165618981 .

the glass is all full: half water, half air. neurodata.io

— Reply to this email directly or view it on GitHub https://github.com/openconnectome/m2g/issues/206#issuecomment-165620926.