Forum Replies Created
Since you are doing binary analysis, there is a good possibility that you encounter this issue due to the fact that some nodes are disconnected from the network at those densities. Currently in Braph the characteristic path length is calculated as a mean over the nodal path lengths of all nodes. This averaging assumes a connected networks, and will return NaN for the networks that have disconnected nodes.
One way is to calculate characteristic path length within connected subgraphs (also available in Braph). Alternatively, you could employ a different averaging procedure that would take into account the disconnected nodes; taking a harmonic mean of the nodal measures is a possible option.
If you would like to change the code in Braph, for binary undirected graphs, the characteristic path length is calculated on the lines 463/464 in GraphBU.m file. You could use any definition of the path length on line 464 and the code would work accordingly. Otherwise, please let me know if you need help and I can help you with any modification of the code you might need.
Braph’s interface might change slightly depending whether you would need to do weighted or binary analysis. For example, in the binary analysis of global measures you have plot view and table view that show the measures as a function of density/threshold. On the other hand, in the weighted analysis the results are presented in a table only, which is due to the fact we have only a single number characterizing the network topology.
Could you please share a bit more information about the interface at which you encounter this problem and the type of analysis you would like to do. If you could send me some snapshots that would be great, so that I can try and help you fix the issue.
Thank you for using Braph.
The issue with small worldness (and characteristic path length) is that they cannot be calculated (especially for small densities) due to the disconnections of some nodes in the graph. This is due to their current implementation, in which first the nodal path lengths for each node are calculated and then they are averaged out in order to calculate the characteristic path length. Therefore, if any disconnected nodes exist in the graph, the nodal path length will return NaN and the characteristic path length cannot be calculated.
As an alternative, you might want to calculate them only within connected subgraphs, where there are no disconnected nodes. If you calculate the small worldness from the command line, you can specify a second argument (“wsg”) as a function input, which ,if set to true, will calculate the small worldness within the connected component of the network. You can find the codes for this on line 1427 in the file Graph.m (for calculating the small worldness) and on line 460 in GraphBU.m (within the method “measure”) for the differences of calculating the path length only within the connected components. Currently, the default value of this argument is set to false. If you would like to change this so that the small worldness is always calculated within the connected components you can do so by changing line 1439 of Graph.m file.
Another alternative method is to implement the harmonic mean as I explained above.
I realize that the calculation of the small-worldness takes a lot of time. This is due to the fact that in order to calculate the small-worldness the network needs to be randomized many times, and currently, the randomization algorithm implemented in Braph is very slow. We hope that we can implement faster alternative methods in Braph soon.
Hope this helps you. Please do not hesitate to ask if you would need any more help.
Dear Hojoon Lee,
Thanks for using Braph and I hope that it proves to be a valuable tool in your research.
If you would like to implement harmonic mean implementation of the path length calculation, you would need to change the file GraphBU.m. Locate the method “measure” in the GraphBU.m file. Line 459 just calculates the mean of the path length of each node (in the original code). In order to implement the harmonic mean, just substitute line 459, with the following:
tmp = g.pl();
res = mean(tmp.^(-1)).^(-1);
which is the expression for the harmonic mean.
Hope this works. If there is anything more I can help you with, please let me know.
MiteJuly 1, 2019 at 11:43 am in reply to: load connectivity matrix from fMRI data, did what posted, there is still errors #29882
I double checked the matrices you sent me and it seems that you were trying to upload the time series for the individual regions instead of uploading pre-calculated adjacency matrices. Therefore, as the matrices that you uploaded were not square matrices Braph returned an error.
I checked and you can calculate adjacency matrices (without error) if you use the correlation coefficients offered in Braph, and you do not need the modified version. However, if you pre-calculate your adjacency matrices, then you can upload and analyze them via the modified version of Braph that I provided.
Hope this helps. Please let me know if this problem remains for you and how I can further help you.
MiteJune 12, 2019 at 10:14 am in reply to: load connectivity matrix from fMRI data, did what posted, there is still errors #28738
Thank you for using Braph and your kind words. Hopefully it will be a very useful tool for you during your research.
I am not sure what the mistake it currently, but if you send me an e-mail, I could send you a modified version of Braph that is able to upload pre-calculated connectivity matrices.
Looking forward to hearing from you.
Thank you for using Braph. I hope that you will find it useful during the course of your research.
Regarding the p-values for between group comparison: The fdr column represents the highest p-value that is significant after fdr correction. This value is calculated at a given density, among the multiple comparisons performed between all regions. That is why, when the region changes, the fdr value stays the same. However, since the multiple comparisons are different for each region, the associated uncorrected p-value changes. We discussed this issue previously on this forum and you can find more detailed explanations at: http://braph.org/forums/topic/confidence-intervals-and-p-statistic/ and http://braph.org/forums/topic/eeg-graph-analysis/ .
Regarding the small worldness calculation, you are right. This situation happens when the network is unconnected. Practically, this results in NaN for the path length of the disconnected nodes which then affects the calculation of the mean. To help you with this, could you let me know what type of analysis you are running (weighted or binary undirected (or directed from the command line) so that I can send you a list of changes that need to be done in order to get the harmonic mean.
Hope these explanations help. If you need any additional help, please do not hesitate to ask.
- This reply was modified 2 years, 4 months ago by Mite Mijalkov.
Thank you for using Braph. I hope that it will be a useful tool during your research.
You cannot load the correlation matrices in the current version of the software. However, with a minor modification of the software you can adapt it so that it can accepted matrices calculated from external sources.
We discussed this problem previously on this forum, and I provided a series of steps that will accomplish your purpose. You can find the detailed explanation at: http://braph.org/forums/topic/eeg-graph-analysis/.
I hope that this works. If there is anything additional I can do for you, please do not hesitate to ask.
Thank you for using Braph. I hope it will prove to be a useful tool and very helpful for your research.
I checked the issue you were having and it originated from a small mistake into the AAL90.xlsx file. Therefore, the problem was due to the particular file and not in Braph.
If you would like to use the same AAL90 brain atlas, you could import it from the corresponding AAL90.txt file (I checked it and this works fine).
We will try to correct the mistake in the AAL90.xlsx and upload it on the website.
Hopefully, this solve your problem. However, if you need any further assistance, please do not hesitate to contact me.
Thank you for your kind thoughts. I hope that using Braph will prove beneficial for you and will help you conducting your research.
From what I understood, you have the same brain atlas for all patients, however due to process you perform, not all brain regions have time series with equal length.
However, could you please further explain whether you observe one of the following:
1) Does the scan of an individual patient results in time series that vary from region to region?
2) Or alternatively, do all brain regions in a single patient have time series with the same length, and, instead the length of the time series is different only for different patients?
I have done few preliminary trials, and I believe that the problem you are experiencing is not due to the odd number of time series points. Instead, Braph automatically fills the empty spaces in the shorter time series in order to make them of equal length and then execute the code for the calculation of the adjacency matrix.
I was wondering whether you would be able to send me a sample of your data, with only few patients that exemplify your problem. Then, I could consult with my colleagues and we will try to make the necessary adjustments to the code so that it performs the correct analysis for you.
I hope that this helps you. If you have any further questions, I will be glad to help.