This is an R package for generating spider plots (radar charts) for individual patient tract Z-scores.
spidey can be installed in R by typing the following commands:
library(devtools)
install_github("remikamito/spidey")
There are a number of R packages that are required for spidey. These include: devtools, fmsb, RNOmni, dplyr, tidyr.
In addition, the neuroCombat R package should be installed if you wish to perform ComBat on tract data:
library(devtools)
install_github("jfortin1/neuroCombatData")
install_github("jfortin1/neuroCombat_Rpackage")
This package can generate Z-scores from tract data for individual patients/participants, and plot these Z-scores on spider plots (also known as radar charts).
The two main functions in this package are: RUNTRACTZ
and SPIDERZ
. This section details the main steps that should be taken.
The expected input data is a dataframe containing individual participants as rows, and tract-specific values as columns. In addition, columns corresponding to a participant ID and the participant group (e.g., healthy control or patient) should be included. If tract data have been extracted from a cohort scanned on different scanners or at different sites, columns corresponding to scanner ID and participant age should also be included.
Sample data (tractdata) is available within this package.
Tract Z-scores can be computed using the RUNTRACTZ
function. This function will output a dataframe with Z-scores for a given participant.
As an example, we can run RUNTRACTZ
on our included sample data:
library(spidey)
Zscores <- RUNTRACTZ(tractdata, 8:36, "P01", combat=TRUE)
This will output a dataframe (Zscores), which contains Z-scores for each tract included within the tract range (here, columns 8 through to 36) for a given patient (ID = P01). As we have included the option to perform ComBat, the tract data will first be harmonised across the scanners/sites.
Once a dataframe of Z-scores for tract data has been generated using the RUNTRACTZ
function, the SPIDERZ
function can be used to plot tract Z-scores on a spider chart.
SPIDERZ(Zscores)