A package to perform imaging transcriptomics analysis on a neuroimaging brain scan.
Project description
Imaging Transcriptomics
Imaging transcriptomics is a methodology that allows to identify patterns of correlation between gene expression and some property of brain structure or function as measured by neuroimaging (e.g., MRI, fMRI, PET).
The imaging-transcriptomics
package allows performing imaging transcriptomics analysis on a neuroimaging scan
(e.g., PET, MRI, fMRI...).
The software is implemented in Python3 (v.3.7), its source code is available on GitHub, it can be installed via Pypi and is released under the GPL v3 license.
NOTE Versions from v1.0.0 are or will be maintained. The original script linked by the BioRxiv preprint (v0.0) is still available on GitHub but no changes will be made to that code. If you have downloaded or used that script please update to the newer version by installing this new version.
Installation
NOTE We recommend to install the package in a dedicated environment of your choice (e.g., venv or anaconda). Once you have created your environment and you have activated it, you can follow the below guide to install the package and dependencies. This process will avoid clashes between conflicting packages that could happen during/after the installation.
To install the imaging-transcriptomics
Python package, first you will need to install a packages that can't be installed directly from PyPi, but require to be downloaded from GitHub.
The package to install is pypyls. To install this package you can follow the installation on the documentation for the package or simply run the command
pip install -e git+https://github.com/netneurolab/pypyls.git/#egg=pyls
to download the package, and its dependencies directly from GitHub by using pip
.
Once this package is installed you can install the imaging-transcriptomics
package by running
pip install imaging-transcriptomics
Usage
Once installed the software can be used in two ways:
- as standalone script
- as part of some python script
WARNING Before running the script make sure the Pyhton environment where you have installed the package is activated.
Standalone script
To run the standalone script from the terminal use the command:
imagingtranscriptomics options {corr, pls}
The options
available are:
-i (--input)
: Path to the imaging file to analise. The path should be given to the program as an absolute path (e.g.,/Users/myusername/Documents/my_scan.nii
, since a relative path could raise permission errors and crashes. The script only accepts imaging files in the NIfTI format (.nii
,.nii.gz
).-o (--output)
(optional): Path where to save the results. If none is provided the results will be saved in the same directory as the input scan.-r
(optional): Regions of the brain to use for the estimation. Can be either "cort+sub" (or equivalently "all") to use all regions or "cort" to use only cortical regions.--no-gsea
(optional): If this option is provided the GSEA analysis will not be performed.--geneset
(optional): Name of the geneset to use to run GSEA. The full list is available in the documentation or by running theimt_gsea avail
command. Additionally to the above options two specific commands (required) are available:corr
: To run the correlation analysis.pls
: To run the PLS analysis. If you choose to run the pls analysis there are two additional options available:--ncomp
: number of components to use in the PLS analysis.--var
: variance to estimate from the data.
Part of Python script
When used as part of a Python script the library can be imported as:
import imaging_transcriptomics as imt
The core class of the package is the ImagingTranscriptomics
class which gives access to the methods used in the standalone script.
To use the analysis in your scripts you can initialise the class and then simply call the ImagingTranscriptomics().run()
method.
import numpy as np
import imaging_transcriptomics as imt
my_data = np.ones(41) # MUST be of size 41
# (corresponds to the regions in left hemisphere of the DK atlas)
analysis = imt.ImagingTranscriptomics(my_data, method="pls", n_components=1,
regions="cort+sub")
analysis.run(gsea=False)
# If instead of running PLS you want to analysze the data with correlation you can run the analysis with:
analysis = imt.ImagingTranscriptomics(my_data, method="corr",
regions="cort+sub")
Once completed the results will be part of the analysis
object and can be accessed with analysis.gene_results
.
The import of the imaging_transcriptomics
package will import other helpful functions for input and reporting. For a complete explanation of this please refer to the official documentation of the package.
Documentation
The documentation of the script is available at imaging-transcriptomics.rtfd.io/.
Troubleshooting
For any problems with the software you can open an issue in GitHub or contact the maintainer) of the package.
Citing
If you publish work using imaging-transcriptomics
as part of your analysis please cite:
Imaging transcriptomics: Convergent cellular, transcriptomic, and molecular neuroimaging signatures in the healthy adult human brain. Daniel Martins, Alessio Giacomel, Steven CR Williams, Federico Turkheimer, Ottavia Dipasquale, Mattia Veronese, PET templates working group. Cell Reports; doi: [https://doi.org/10.1016/j.celrep.2021.110173] (https://doi.org/10.1016/j.celrep.2021.110173)
Imaging-transcriptomics: Second release update (v1.0.2).Alessio Giacomel, & Daniel Martins. (2021). Zenodo. https://doi.org/10.5281/zenodo.5726839
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for imaging-transcriptomics-1.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93e52ccb9498696fb18ec908b341b5dc502fa9f18f752967ce8b09642916c6bd |
|
MD5 | 20ccbbe9ef1dabf5571b8aa75643103c |
|
BLAKE2b-256 | dfaf15f1b92d38347b85bc2329d1eacf237339cbdfd06b5a33b6c2bf754a399a |
Hashes for imaging_transcriptomics-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca300652c0334842447292af776450b2ce0f4d063ad87e9abfb5ae4772561215 |
|
MD5 | 9708de1ce49e44853aead3f42f56ea2b |
|
BLAKE2b-256 | f47407ffe11d459734b1973f733c72352c4d4790e61968c0d5a927a076108355 |