NIDMification of kwyk output
This project uses kwyk (https://github.com/neuronets/kwyk). Paper, code, and model corresponding to preprint, which is now published.
We include a BASH script, 'kwykput.sh' that takes a resulting output from kwyk, and used the FSL fslstats utility to determine the volume for each of the regions. This script uses the kwyk_region_list.txt file for the region lables (derived from FreeSurfer. It generates a text file (example provided test_out.txt) of the form:
kwyk_index label number_voxels vol_inmm3 1 Cerebral-White-Matter 496396 496396.000000 2 Ventricular-System 11025 11025.000000 3 Cerebellum-White-Matter 32515 32515.000000 4 Cerebellum-Cortex 144992 144992.000000 5 Thalamus-Proper 18118 18118.000000 6 Caudate 10851 10851.000000 etc...
The steps for this include generating a kwykmap.json file that described the content of out reults file (kwykmap.json). As a developer, you can then work with ReproNim to create a set of custom terms for your software, which are harmonized with other software. This generates a list of custom data elements for the software with additional information. For example, in the case of kwyk, this maps every structure to a common anatomical name, measurement type, and measurement units.
kwyk:kwyk_000002 a kwyk:DataElement ;
kwyk:label "Cerebral-White-Matter vol_inmm3 (mm^3)" ;
kwyk:measure "vol_inmm3" ;
kwyk:structure "Cerebral-White-Matter" ;
kwyk:structure_id 1 ;
kwyk:unit "mm^3" ;
nidm:datumType ilx:0738276 ;
nidm:hasUnit "mm^3" ;
nidm:isAbout uberon:0002437 ;
nidm:measureOf ilx:0112559 .
You can run the kwyk2nidm script using either of the methods below.
- Install
kwyk2nidm
into your Python 3 environment
pip install https://github.com/ReproNim/kwyk2nidm/archive/master.zip
kwyk2nidm -f kwyk_stats_file
- Clone the repo and create a Docker container
git clone https://github.com/ReproNim/kwyk2nidm.git
cd kwyk2nidm
docker build -t kwyk2nidm:latest .
docker run -v $(pwd):/data kwyk2nidm -f /data/kwyk_stats_file
Running the kwyk2nidm command will generate an output file
kwyk_stats_file.ttl
unless a different name is specified using the
-o
flag.
To generate all the NIDM KWYK data elements add -g
to the commands above.
This will generate a KWYK-NIDM.ttl
that should be added to triplestore
to provide the link between the NIDM stats file to the common data attributes.
- Upload to ReproPond or ReproLake
- Query across files!
- Merge it with other NIDM, and query it!