2024-02-20
- Fix bug in
import_scn
when importing data that includes subcortical gray matter - Export the atlas in
sim.rand.graph.par
when controlling for clustering coefficient - Fix indexing bug in
within_module_deg_z_score
- Refactor GUI code to avoid global variables (although
RGtk2
andcairoDevice
have been archived)
- Add colors and labeling to
plot
method forbrainGraph_resids
objects
2021-02-03
- Use edge weights to calculated weighted gateway coefficient, participation coefficient, and within-module degree z-score
2020-10-19
- Assigning dimnames to null.max.all in
mtpc
no longer throws an error - Creating connected random graphs (from
analysis_random_graphs
) will no longer throw an error from within the hidden functionget_rand_attrs
graph_attr_dt
no longer throws an error if subnet is a graph-level attribute
2020-09-28
- There are a few dozen new S3 methods for
bg_GLM
objects. Seemethods(class='bg_GLM')
for the full list.coeff_determ
calculates the coefficient of determination.coeff_table
returns the coefficients table (same assummary.lm(x)$coefficients
) for each region. - There are new GLM fitting functions (prefixed with
fastLmBG
) that are significantly faster and work with matrix/array inputs. You can see these with the codeapropos('fastLm')
. - New functions
randomise
andrandomise_3d
can be called directly (although not recommended), and thepartition
function is now exported. Each of these is for permutation-based analysis of linear models. Furthermore, there are new permutation methods (manly
,draperStoneman
, andstillWhite
). - New object
brainGraphList
for a collection of all graphs at a single density/threshold. There are multiple S3 methods for this object, including the creation methodmake_brainGraphList
. make_brainGraph
is now a S3 method.- There are several new matrix utility functions.
inv
calculates the the "unscaled covariance" matrix used in linear models.pinv
calculates the pseudoinverse.qr
calculates the QR decomposition for each matrix in a 3D array.colMax
,colMin
, andcolMaxAbs
calculate the max, min, and max of the absolute value across matrix columns.is_binary
determines if a matrix consists only of 0's and 1's.symmetrize
is now a S3 method.symm_mean
symmetrizes a matrix using the mean of off-diagonal elements. - There are 4 new atlases:
hcp_mmp1.0
(HCP multimodal atlas),power264
,gordon333
, andbrainnetome
- New function
sim.rand.graph.hqs
generates random graphs from random covariance matrices for structural covariance networks using the HQS algorithm. - New plotting function
slicer
plots multiple graphs in a single figure. - Fewer package dependencies.
mean_distance_wt
calculates weighted shortest path lengths.
count_interlobar
is replaced bycount_inter
make_mediate_brainGraph
is replaced by themake_brainGraph
S3 method.plot_brainGraph
is replaced by theplot
S3 method forbrainGraph
objects.
2019-10-20
- The
mediation
package no longer exportssummary.mediate
, so it has to be removed frombrainGraph
- Move
mediation
to Suggests, as well
- Move
2019-06-29
- Fix bug in
import_scn
so the Study.ID column is always read ascharacter
- Remove deprecated function
brainGraph_init
2018-12-15
import_scn
replacesbrainGraph_init
, with a few changes in behavior:- It is no longer necessary to abbreviate region names yourself; the function does it automatically
- Expects files with the name
${parcellation}_${hemi}_${modality}.csv
in thedatadir
- Here,
${parcellation}
could beaparc
, for example - Also,
${modality}
could bethickness
- Here,
- If the atlas you are using includes
scgm
, there should be aasegstats.csv
file
aop
andloo
now return S3 objects, with class nameIC
- These also have
summary
andplot
methods - Furthermore, these objects return some more information
- These also have
- The
exclude
argument toget.resid
is nowexclude.cov
to highlight that it is for specifying covariates to exclude from the GLM
2018-12-07
- Fix bug in
partition
, changingmethod
topart.method
- Add some checks in
robustness
so it doesn't throw an error
2018-09-04
- Fixed bug in
count_homologous
that affected a subset of atlases- Performance is modestly improved (approx. 2-3x faster)
count_inter
replacescount_interlobar
; the new function calculates inter- and intra-group edge counts, where a group of vertices can be a lobe, hemisphere, network (for thedosenbach160
atlas), or class (for thedestrieux
atlases)- The return object is now more informative; the function returns a matrix of all inter- and intra-group edge counts, in addition to a data.table containing a summary (that matches the output of previous versions)
rich_core
now calculates the rich core for weighted networks- In addition, the function runs considerably faster:
- for smaller sparse graphs, it is ~40-80x faster
- for larger dense graphs, it is more than 2,000x faster
- In addition, the function runs considerably faster:
robustness
now returns a data.table containing much more information (in addition to the max. connected component ratio)- This makes plotting outputs simpler; see Chapter 14 of the User Guide
- When
type='edge'
, the function is about 2-3x faster than previous versions
plot.mtpc
: the stats displayed in the caption have been "transposed", such thatS.crit
andA.crit
are in the top row
2018-09-01
- Fixed regression bug in
NBS
(introduced byv2.0.0
) which only occurred ifalternative='less'
when calculating the minimum statistic of permuted networks
- Updated code that symmetrizes matrices:
- Introduced new function,
symm_mean
, that more quickly symmetrizes a matrix about the diagonal by assigningmean(c(A[i, j], A[j, i]))
to the off-diagonal elements - Uses
pmin
andpmax
for symmetrizing matrices based on the off-diagonal minimum and maximum, respectively
- Introduced new function,
- Optimized code in a few functions for faster execution:
sim.rand.graph.clust
is about 2x faster due to improvement in thechoose.edges
helper functioncentr_lev
andedge_asymmetry
are also faster
2018-07-21
hubness
: new function for determining which vertices are hubsset_brainGraph_attr
- New argument
clust.method
lets the user choose which clustering (community detection) method to use.- The default is still the
louvain
algorithm. - If you select
spinglass
, but the graph is unconnected, thenlouvain
is used instead. - If there are any negative edge weights, and you choose anything other than
walktrap
orspinglass
, thewalktrap
method is used.
- The default is still the
- Now calculates
num.hubs
using the newhubness
function, and calculates separate values for weighted and unweighted networks
- New argument
2018-07-06
- Fixed bugs in
rich_club_norm
that would throw an error if certain graph attributes weren't present
rich_club_all
- new function that is a wrapper forrich_club_coeff
, applying over all possible degree values
2018-06-25
- Fixed regression bug in
plot.brainGraph
, which occurred when choosingplane='sagittal'
2018-06-22
- Fixed regression bug when fitting GLM models with a
F contrast
- Fixed minor bug in
make_nbs_brainGraph
which did not properly assign thep.nbs
attribute to all vertices
- The elements of the
NBS
output object,p.mat
andT.mat
, are now 3-dimensional arrays (with extent equal to the # of contrasts) instead of lists of matrices
2018-06-20
- Fixed a bug in
brainGraph_permute
that I didn't catch before
2018-06-20
brainGraph_boot
andcorr.matrix
:- Incorrectly calculated
E.global.wt
before; now it transforms edge weights - To do so, includes argument
xfm.type
- Fixed bug when calling
corr.matrix
(addedrand=TRUE
) - Also had to update the return object of
corr.matrix
for this purpose
- Incorrectly calculated
mtpc
- Previously gave some incorrect results when
alt='less'
; fixed - The
plot
method also now gives correct values whenalt='less'
- Previously gave some incorrect results when
brainGraph_GLM
now returns the correct null.thresh whenalt != 'greater'
plot.brainGraph
: fixed bug that occurred whenplane='sagittal'
and ahemi
value was not suppliedplot_rich_norm
: didn't plot values for all degrees present in the networks under certain scenarios
set_brainGraph_attr
now calculates a graph-levelLp.wt
, which equals:
Lpv.wt <- distances(g)
Lpv.wt[is.infinite(Lpv.wt)] <- NA
g$Lp.wt <- mean(Lpv.wt[upper.tri(Lpv.wt)], na.rm=T)
plot_rich_norm
: new argumentsmooth
lets you plot with a smoother in the case of single-subject data, as opposed to the previous default of a line plot for all subjects
- GLM-related and other functions will now:
- Allow for the
Study.ID
column to be numeric; they will convert it to class character - Creates a character vector of integers if
Study.ID
is not present in the data
- Allow for the
- The
summary.mtpc
method now also prints the value ofclust.size
2018-05-28
- Moved
RGtk2
andcairoDevice
to Suggests (from Depends) to allow installation on headless servers- Thanks to
@michaelhallquist
for the pull request!
- Thanks to
- Functions
boot_global
,permute.group
, andplot_group_means
are no longer accessible (deprecated since v2.0.0)
2018-05-03 (mostly changes to structural covariance network functionality)
- Fixed a bug in
mtpc
that was introduced inv2.0.1
brainGraph_GLM_design
has a new argumentfactorize
which specifies whether or not to convert all character columns (excluding Study.ID) to factor variables. The default isTRUE
. Previously, character columns were ignored.get.resid
- In the function call, you can choose whether or not to test a linear model for all groups together or separately, via the
method
argument - The
plot
method now returns a list of ggplot objects, and is similar to theplot
methods forbg_GLM
andmtpc
- In the function call, you can choose whether or not to test a linear model for all groups together or separately, via the
corr.matrix
- The
resids
argument must be the output ofget.resid
(not a data.table as before) - Correlations will be calculated separately for all subject groups (as this information is stored in the output of
get.resid
); you no longer need to loop (orlapply
) across groups - In the function call, you can choose whether to correlate the residuals or raw structural values, via the
what
argument - The
exclusions
argument was renamed toexclude.reg
to highlight that you should specify region names to be excluded (if any) - You can explicitly choose whether to calculate Pearson or Spearman correlations, via the
type
argument (previously, this behavior was "hidden")
- The
brainGraph_init
: themodality
argument now will accept any character string; the default is still thickness. The files with the string you supply still must be present on your system.- Due to
corr.matrix
expecting different input, the following functions also require, for theirresids
argument, the output ofget.resid
(instead of a data.table):aop
brainGraph_boot
brainGraph_permute
loo
2018-04-28
gateway_coeff
: no longer throws an error for very sparse graphs; instead, it returns a vector withNaN
values for unconnected verticesmake_mediate_brainGraph
: did not return correct values (for the treatment condition) whenINT=TRUE
(it recycled the values for the control condition)make_intersection_brainGraph
- Previously exited with error if any of the input graphs did not contain vertices meeting the desired
subgraph
condition - Now returns an empty graph if none of the input graphs meet the
subgraph
condition
- Previously exited with error if any of the input graphs did not contain vertices meeting the desired
NBS
:- When getting the indices for which matrix elements to transpose (so that result is symmetric), the result was slightly wrong for
alt='greater'
- Calculation of edge counts in
summary
method contained an error
- When getting the indices for which matrix elements to transpose (so that result is symmetric), the result was slightly wrong for
- All
summary
methods now provide aDT.sum
element in the returned list; previously it was inconsistent
2018-04-26
- In
mtpc
, the stats table that is returned previously was not always unique mtpc
did not return a list with a named elementclust.size
(it was unnamed)- In
plot.mtpc
, if the user selected a contrast other than the first, it would not plot the correct null statistics (green dots)
2018-02-23
Release on CRAN; bugfix release.
- Fixed a bug in
create_mats
in which the ordering (along the 3rd dimension) of the arrays inA.norm.sub
did not match the ordering of the input matrix files (and therefore the ordering along the 3rd dimension of the arraysA
andA.norm
).- In the case that the input matrix files were already ordered by Group and Study.ID, then this is not a "bug", in that the ordering was already correct. So, if your subject groups are
groups <- c('Control', 'Patient')
, and the matrix files are separated on the filesystem by group, there is no change in behavior. - This bug only appeared when
threshold.by='consistency'
orthreshold.by='consensus'
(the default option).
- In the case that the input matrix files were already ordered by Group and Study.ID, then this is not a "bug", in that the ordering was already correct. So, if your subject groups are
2018-02-07
- Fixed error in
mtpc
when creating the MTPC statisticsdata.table
2018-02-05
2nd major release; 6th CRAN release. (The previous CRAN release was at v1.0.0)
For other updates and bug fixes, see the minor release notes below.
- Mediation analysis is now possible through
brainGraph_mediate
. - I have introduced some simple S3 classes and methods. All of the classes have
plot
(exceptNBS
) andsummary
methods. The classes and corresponding "creation functions" are:
Class | Creation func. | Description |
---|---|---|
brainGraph | make_brainGraph | Any graph with certain attributes |
bg_GLM | brainGraph_GLM | Results of GLM analysis |
NBS | NBS | Results of NBS analysis |
mtpc | mtpc | Results of MTPC analysis |
brainGraph_GLM | make_glm_brainGraph | Graphs from GLM analysis |
brainGraph_NBS | make_nbs_brainGraph | Graphs from NBS analysis |
brainGraph_mtpc | make_glm_brainGraph | Graphs from MTPC analysis |
brainGraph_mediate | make_mediate_brainGraph | Graphs from mediation analysis |
brainGraph_boot | brainGraph_boot | Results of bootstrap analysis |
brainGraph_permute | brainGraph_permute | Results of permutation tests |
brainGraph_resids | get.resid | Residuals for covariance networks |
- Multiple contrasts (in the same function call), as well as F-contrasts, are now allowed in the GLM-based functions:
brainGraph_GLM
,mtpc
,NBS
, andget.resid
.- There is a new function argument,
con.type
, for this purpose. - Since both contrast types are now specified in the form of a contrast matrix, the argument
con.vec
has been replaced bycon.mat
.
- There is a new function argument,
- Designs with 3-way interactions (e.g.,
2 x 2 x 2
) are now allowed for GLM-based analyses. - Permutations for GLM-based analyses are now done using the Freedman-Lane method (the same as in FSL's randomise and in PALM).
- Plot the "diagnostics" from GLM analyses through the
plot.bg_GLM
method to the output ofbrainGraph_GLM
. - Plot the statistics from MTPC analyses through the
plot.mtpc
method formtpc
results. aop
has a new argumentcontrol.value
allowing you to specify the control group; all comparisons will be to that group.- Removes the need to loop through patient groups in the console (if you have more than 1).
- Most of the GLM-based functions have a new argument,
long
, which will not return all of the permutation results iflong=FALSE
.
boot_global
was renamed tobrainGraph_boot
.check.resid
was removed; you now just call theplot
method to outputs ofget.resid
.permute.group
:- Function was renamed to
brainGraph_permute
. - The arguments are slightly re-ordered
- Argument
permSet
was renamed toperms
. - New argument
auc
lets you explicitly define whether or not you want statistics for the area under the curve (AUC).
- Function was renamed to
plot_boot
was removed; you now just call theplot
method to outputs ofbrainGraph_boot
.plot_brainGraph_mni
has been removed; this functionality can be changed by themni
argument toplot.brainGraph
(i.e., the plot method for objects of classbrainGraph
)plot_group_means
was renamed toplot_volumetric
, as it works specifically for structural covariance networks.plot_perm_diffs
was removed; you now just call theplot
method to outputs ofbrainGraph_permute
.
NBS
now automatically symmetrizes the input matrices. This is partly for speed and partly becauseigraph
symmetrizes the matrices anyway.- There is a new function argument,
symm.by
(which is the same as that forcreate_mats
) for this purpose.
- There is a new function argument,
corr.matrix
:- Now expects as its first input the residuals from
get.resid
. - You may specify multiple
densities
(orthresholds
), - Returns a list including the binarized, thresholded matrices as an array (still named
r.thresh
).
- Now expects as its first input the residuals from
get.resid
now allows for any design matrix for getting LM residuals (similar tobrainGraph_GLM
).- Must supply a
data.table
of covariates. - You may pass on arguments to
brainGraph_GLM_design
for creating the correct design matrix.
- Must supply a
mtpc
accepts 2 new arguments (in addition to explicitly naming required arguments that pass on tobrainGraph_GLM
):clust.size
lets you change the "cluster size", the number of consecutive thresholds needed to deem a result significant (default:3
)res.glm
lets you input theres.glm
list element from a previousmtpc
run. This is only useful if you would like to compare results with different values forclust.size
.
permute.group
(see above section for changes)rich_club_norm
now returns adata.table
, which simplifies working with the data (and plotting).set_brainGraph_attr
: multiple (explicit) arguments were removed; these are now passed on tomake_brainGraph
and can still be specified in the function call.- I now use the
ggrepel
package for anyggplot
objects with text labels.
2017-09-14
brainGraph_init
: fixed bug regarding the use of a custom atlas
- Some function arguments have been modified to reflect the object type (e.g., changing
g
tog.list
if the function requires a list object). brainGraph_init
:- New argument
custom.atlas
allows you to use an atlas that is not in the package (you must also specifyatlas="custom"
). - This requires that the atlas you specify already be loaded into the R environment and meet the specifications of the package's atlases
- It should be a
data.table
, and have columns name, x.mni, y.mni, z.mni, lobe, hemi (at a minimum).
- It should be a
- New argument
permute.group
: can now calculateev.cent
2017-08-31
boot_global
: fixed bug in modularity calculation
boot_global
:- can omit display of the progress bar (by setting
.progress=FALSE
) - can now create weighted networks; to do so, you must choose a weighted metric in the function argument
measure
- added some weighted metrics as options for
measure
(strength, mod.wt, E.global.wt) - can specify the confidence level (for calculating confidence intervals) via the
conf
argument (default: 0.95)
- can omit display of the progress bar (by setting
set_brainGraph_attr
:- New argument
xfm.type
, which allows you to choose how edge weights should be transformed for calculating distance-based metrics. - The default is the reciprocal (which is what was hard-coded in previous versions).
- Other options are:
1-w
(subtract weights from 1); and-log(w)
(take the negative natural logarithm of weights).
- New argument
symmetrize_array
: a convenience function that appliessymmetrize_mats
along the third dimension of an arrayxfm.weights
: utility function to transform edge weights (necessary when calculating distance-based metrics).
graph_attr_dt
andvertex_attr_dt
will now includeweighting
, if presentset_brainGraph_attr
has 2 new arguments:weighting
will create a graph-level attribute indicating how the edges are weighted (e.g., 'fa' for FA-weighted tractography networks)threshold
will create a graph-level attribute indicating the (numeric) threshold used to create the network (if applicable)
2017-06-10
mtpc
: fixed a bug that would incorrectly calculateA.crit
apply_thresholds
: threshold an additional set of matrices (e.g., FA-weighted matrices in DTI tractography) based on a set of matrices that have already been thresholded (e.g., streamline-weighted matrices in DTI tractography)
analysis_random_graphs
: no longer requires a covars argument
2017-04-30
create_mats
- fixed bug for deterministic tractography when the user would like to normalize the matrices by ROI size.
- Fixed bug for when
threshold.by='density'
. Previously, it would keep the top X% for each subject
create_mats
threshold.by='consensus'
is the name of the new default, as this is what is called "consensus-based" thresholding in the literature.threshold.by='consistency'
is a new option, for performing consistency-based thresholding. See Roberts et al., 2017.
set_brainGraph_attr
no longer calculates the graph's clique number, which takes exceedingly long in denser and/or larger graphs (e.g.,craddock200
)
2017-04-29
plot_brainGraph
: now returnsNA
(instead of throwing an error) if the specified subgraph expression results in a network with 0 vertices.edge_asymmetry
fixed bug when the input graph had only one contralateral connection (usually only encountered in the GUI with neighborhood plots)
create_mats
: you can specifythreshold.by='mean'
, which will threshold the matrices such that a connection will be kept ifmean(A_ij) + 2*sd(A_ij) > mat.thresh
, for each ofmat.thresh
.
make_empty_brainGraph
: this is not a new function, but rather was not exported in previous versionss_core
: calculate the s-core membership of a graph's vertices (Eidsaa & Almaas, 2013)- Adds a vertex attributes called
s.core
to the graph throughset_brainGraph_attr
. - Analogous to the k-core but for weighted networks.
- The vertex attribute for k-core has been changed from
coreness
tok.core
to distinguish these metrics.
- Adds a vertex attributes called
2017-04-22
plot_brainGraph_gui
had multiple issues and a few features have been changed:- Overall execution should be faster than in previous versions
- Lobe, neighborhood, and community selection are now in "scrolled windows" instead of drop-down lists. Multiple selections can be made either by pressing
Ctrl
and clicking, or by holdingShift
and moving the arrow keys - Fixed problem with vertex colors
- When choosing to plot neighborhoods, you can color the vertices based on which neighborhood they belong to (useful if multiple vertices are selected)
gateway_coeff
returned an error if the number of communities equals 1; this has been fixed
centr_betw_comm
: calculate vertex communicability betweenness centrality (Estrada et al., 2009)communicability
: calculate network communicability (Estrada & Hatano, 2008)mtpc
: the multi-threshold permutation correction (MTPC) method for statistical inference of either vertex- or graph-level measures (Drakesmith et al., 2015)symmetrize_mats
: symmetrize a connectivity matrix by either the maximum, minimum, or average of the off-diagonal elements. You may select one of these as an argument tocreate_mats
.
brainGraph_GLM
has 2 new function arguments:level
allows you to perform inference for graph- or vertex-level measuresperms
lets you specify the permutation set explicitly
create_mats
: AllA.norm.sub
matrices will be symmetrized, regardless of the value ofthreshold.by
(previously they were only symmetrized if usingthreshold.by='density'
).- This should not pose a problem, as the default (to take the maximum of the off-diagonal elements) is also the default when creating graphs in
igraph
.
- This should not pose a problem, as the default (to take the maximum of the off-diagonal elements) is also the default when creating graphs in
get.resid
: no longer requires a covars argument, as it was redundantsim.rand.graph.par
: the argument clustering is no longer TRUE by default
2017-04-10
First major release; Fifth CRAN release
plot_perm_diffs
previously didn't work with a low number of permutations, but now will work with any numbersim.rand.graph.par
previously didn't work with graphs lacking adegree
vertex attribute- Fixed problem with
plot_brainGraph_GUI
when plotting in the sagittal view for neighborhood graphs
- Multiple functions now run significantly faster after I updated the code to be more efficient
permute.group.auc
has been removed, and nowpermute.group
accepts multiple densities and returns the same results. It can still take a single density for the old behavior- The
lobe
andnetwork
vertex attributes are now character vectors NBS
now handles more complex designs and contrasts throughbrainGraph_GLM_design
andbrainGraph_GLM_fit
. The function arguments are different from previous versionsSPM
has been removed and is replaced bybrainGraph_GLM
- Added atlas
craddock200
(with coordinates fromDPABI/DPARSF
)
brainGraph_GLM
: replacesSPM
and allows for more complex designs and contrastsbrainGraph_GLM_design
: function that creates a design matrix from adata.table
brainGraph_GLM_fit
: function that calculates the statistics from a design matrix and response vectorcreate_mats
: replacesdti_create_mats
and adds functionality for resting-state fMRI data; also can create matrices that will have a specific graph densitygateway_coeff
: calculate the gateway coefficient (Vargas & Wahl, 2014); graphs will have vertex attributesGC
orGC.wt
(if weighted graph)plot_brainGraph_multi
: function to write a PNG file of 3-panel brain graphs (see User Guide for example)
efficiency
replacesgraph.efficiency
; the old function name is still accessible (but may be removed eventually)set_brainGraph_attr
replacesset.brainGraph.attributes
; the old function name is still accessible (but may be removed eventually)part_coeff
replacespart.coeff
- All of the
rich.
functions have been renamed. The period/point/dot in each of those functions is replaced by the underscore. So,rich.club.norm
is nowrich_club_norm
, etc. set_vertex_color
andset_edge_color
replacecolor.vertices
andcolor.edges
(these functions are not exported, in any case)contract_brainGraph
replacesgraph.contract.brain
make_ego_brainGraph
replacesgraph_neighborhood_multiple
(so it is a similar name to igraph's functionmake_ego_graph
)write_brainnet
replaceswrite.brainnet
- In the GUI, vertex order in circle plots now more closely reflect their anatomical position, being ordered by y- and x-coordinates (and within lobe)
2016-10-10
Fourth CRAN release
sim.rand.graph.clust
previously returned a list; now it correctly returns anigraph
graph objectaop
andloo
: regional contributions were calculated incorrectly (without an absolute value)rich.club.norm
: changed the p-value calculation again; this shouldn't affect many results, particularly if N=1,000 (random graphs)NBS
:- the
t.stat
edge attribute was, under certain situations, incorrectly assigning the values; this has been fixed in the latest version - fixed bug when permutations didn't result in any connected components
- fixed bug w/ data randomization; the bug didn't seem to affect the results
- the
SPM
:- the permutation p-values were previously incorrect; has been fixed
- added an argument to remove
NA
values
vec.transform
: fixed bug which occurred when the input vector is the same number repeated (i.e., whenrange(x) = 0
)
dti_create_mats
: new function argumentalgo
can be used to specify either 'probabilistic' or 'deterministic'. In the case of the latter, when dividing streamline count by ROI size, you can supply absolute streamline counts with themat.thresh
argument.- Changed instances of
.parallel
touse.parallel
; also, added it as an argument toset.brainGraph.attributes
to control all of the functions that it calls; also added the argument topart.coeff
andwithin_module_deg_z_score
- Added atlases
aal2.94
,aal2.120
, anddosenbach160
plot_brainGraph
: can now specify the orientation plane, hemisphere to plot, showing a legend, and a character string of logical expressions for plotting subgraphs (previously was inplot_brainGraph_list
)
auc_diff
: calculates the area-under-the-curve across densities for two groupscor.diff.test
: calculates the significance of the difference between correlation coefficientspermute.group.auc
: does permutation testing across all densities, and returns the permutation distributions for the difference in AUC between two groupsrich.club.attrs
: give a graph attributes based on rich-club analysis
- Removed the
x
,y
, andz
columns from the atlas data files; now only the MNI coordinates are used. This should simplify adding a personal atlas to use with the package - Added a column,
name.full
to some of the atlas data files NBS
:- New edge attribute
p
, the p-value for that specific connection - Returns the
p.init
value for record-keeping
- New edge attribute
brainGraph_init
: can now provide acovars
data table if you want to subset certain variables yourself, or if the file is named differently fromcovars.csv
plot_brainGraph
: can now manually specify a subtitle;plot_brainGraph_gui
:- Option for specifying maximum values for edge widths
plot_corr_mat
: color cells based on weighted community or networkplot_global
:- legend position is now "bottom" by default
- can specify
xvar
to be either "density" or "threshold"; if the latter, the x-axis is reversed - If data has a
Study.ID
column, theggplot2
functionstat_smooth
is used and the statistic is based on a generalized additive model
plot_perm_diffs
: added argumentauc
for using the area-under-the-curve across densitiesplot_rich_norm
:- Added argument
fdr
to choose whether or not to use FDR-adjusted p-values - Should work for more than 2 groups
- Now works with multi-subject data; collapses by Group and plots the group mean
- Added argument
plot_vertex_measures
: can facet by different variables (e.g., lobe, community, network, etc.)set.brainGraph.attributes
:- calculate graph
strength
, which is the mean of vertex strength (weighted networks) - Invert edge weights for distance-based measures
- calculate graph
write.brainnet
:- Now allows for writing weighted adjacency matrices, using the
edge.wt
function argument - Can color vertices by multiple variables
- Now allows for writing weighted adjacency matrices, using the
2016-04-22
Third CRAN release
rich.club.norm
had a bug in calculating the p-values. If you have already gone through the process of creating random graphs and the objectphi.norm
, you can fix with the following code: (add another loop if you have single-subject graphs, e.g. DTI data)
for (i in seq_along(groups)) {
for (j in seq_along(densities)) {
max.deg <- max(V(g[[i]][[j]])$degree)
phi.norm[[i]][[j]]$p <- sapply(seq_len(max.deg), function(x)
sum(phi.norm[[i]][[j]]$phi.rand[, x] >= phi.norm[[i]][[j]]$phi.orig[x]) / N)
}
}
where N
is the number of random graphs generated.
dti_create_mats
: there was a bug when sub.thresh equals 0; it would take matrix entries, even if they were below the mat.thresh values. This has been fixed. Argument checking has also been added.
- Now requires the package
RcppEigen
for fast linear model calculations; resulted in major speed improvements - Now requires the package
permute
for theNBS
function group.graph.diffs
:- Uses the function
fastLmPure
fromRcppEigen
for speed/efficiency - Can specify multiple alternative hypotheses
- Linear model specification is more limited now, though
- Uses the function
- Added data table for the
destrieux.scgm
atlas
SPM
: new function that replaces and improves upon bothgroup.graph.diffs
andpermute.vertex
NBS
: implements the network-based statisticanalysis_random_graphs
: perform all the steps for getting small-world parameters and normalized rich-club coefficients and p-valuesplot_global
: create a line plot across all densities of global graph measures in the same figurevertex_spatial_dist
: calculates the mean edge distance for all edges of a given vertex
dti_create_mats
: changed a few argumentsedge_spatial_dist
: re-named fromspatial.dist
group.graph.diffs
: returns a graph w/ spatial coord's for plottingplot_brainGraph_list
:- You can now specify a condition for removing vertices (e.g.
hemi == "R"
will keep only right hemisphere vertices; includes complex logical expressions (i.e., with multiple '&' and '|' conditions) - Vertex sizing and coloring is a bit more flexible
- You can now specify a condition for removing vertices (e.g.
- New vertex attribute
Lp
(average path length for each vertex) plot_brainGraph_gui
:- Added a checkbox for displaying a color legend or not
- Can color vertices by weighted community membership
- Added an Other option for adjusting edge widths by a custom attribute
- More options for adjusting vertex sizes when the graph is weighted
- Made the GUI window more compact to fit lower screen resolutions
plot_rich_norm
:- New argument
facet.by
to group the plots by either "density" (default) or "threshold" (for multi-subject, e.g. DTI data)
- New argument
set.brainGraph.attributes
: New calculations for weighted graphs:- Modularity and community membership
- Participation coefficient and within-module degree z-score
- Vertex-level transitivity
- Vertex-level shortest path lengths
2015-12-24
Second CRAN release
aop
andloo
calculate measures of individual contribution (see Reference within the function help)- Now requires the package
ade4
- Now requires the package
plot_boot
: new function based on the removed plotting code fromboot_global
plot_rich_norm
: function to plot normalized rich club coefficient curves
-
boot_global
:- added an OS check to get multicore functionality on Windows
- removed the code that created some plots
- updated to work with the newer version of
corr.matrix
-
brainGraph_init
:- does a better job of dealing with subcortical gray matter data
- now also returns the "tidied" dataset
-
corr.matrix
:- was basically reverted back for speed purposes
- minor syntax change
-
count_interlobar
no longer takesatlas.dt
as an argument -
dti_create_mats
now accepts argumentP
for "number of samples" -
edge_asymmetry
now works on Windows (changed from mclapply to foreach) -
get.resid
:- got a complete overhaul; now works with data.table syntax
- now returns data.table of residuals with a Study.ID column
- fixed minor bug when
use.mean=FALSE
but covars has columns mean.lh and/or mean.rh; fixed minor bug w/ RH residual calculation - fixed bug when
use.mean=TRUE
(syntax error for RH vertices)
-
graph.efficiency
: now works on Windows (changed from mclapply to foreach) -
part.coeff
: has a workaround to work on Windows -
permute.group
:- updated to work with new version of
corr.matrix
- no longer takes
atlas.dt
as an argument
- updated to work with new version of
-
vertex_attr_dt
is now essentially a wrapper forigraph
's functionas_data_frame
-
Exported
plot_perm_diffs
-
Added argument checking for most functions
2015-12-08
Initial CRAN release