A package, and script, to perform imaging transcriptomics on a neuroimaging scan.

Overview

Imaging Transcriptomics

DOI License: GPL v3 Maintainer Generic badge Documentation Status

Imaging-transcriptomics_overwiew

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

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).
  • -v (--variance): Amount of variance that the PLS components must explain. This MUST be in the range 0-100.

    NOTE: if the variance given as input is in the range 0-1 the script will treat this as 30% the same way as if the number was in the range 10-100 (e.g., the script treats the inputs -v 30 and -v 0.3 in the exact same way and the resulting components will explain 30% of the variance).

  • -n (--ncomp): Number of components to be used in the PLS regression. The number MUST be in the range 1-15.
  • --corr: Run the analysis using Spearman correlation instead of PLS.

    NOTE: if you run with the --corr command no other input is required, apart from the input scan (-i).

  • -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.

WARNING: The -i flag is MANDATORY to run the script, and so is one, and only one, of the -n or -v flags. These last two are mutually exclusive, meaning that ONLY one of the two has to be given as input.

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, n_components=1)
analysis.run()
# If instead of running PLS you want to analysze the data with correlation you can run the analysis with:
analysis.run(method="corr")

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. bioRxiv 2021.06.18.448872; doi: https://doi.org/10.1101/2021.06.18.448872

Imaging-transcriptomics: Second release update (v1.0.2).Alessio Giacomel, & Daniel Martins. (2021). Zenodo. https://doi.org/10.5281/zenodo.5726839

Comments
  • pip installation can not resolve enigmatoolbox dependencies

    pip installation can not resolve enigmatoolbox dependencies

    After pip install -e git+https://github.com/netneurolab/pypyls.git/#egg=pyls and pip install imaging-transcriptomics in a new conda environment with Python=3.8, an error was occurred when import imaging-transcriptomics package that it can't find the module named enigmatoolbox. I figured out that the enigmatoolbox package seems can not be resolve by pip installation automatically, so I have to install the enigmatoolbox package from Github manually, with the code bellow according to the document of enigmatoolbox:

    git clone https://github.com/MICA-MNI/ENIGMA.git
    cd ENIGMA
    python setup.py install
    
    opened by YCHuang0610 4
  • DK atlas regions

    DK atlas regions

    Dear alegiac95,

    thanks for providing the scripts! I have just gone through the paper and description of this GitHub repo and I want to adapt your software to my project. However, I use the typical implementation of the DK from Freesurfer with 34 cortical DK ROIs instead of the 41 ROIs that you have used and, if I'm not mistaken, 41 ROIs are required to implement the script as ist is. Is it possible to change the input to other cortical parcellations as well (i.e., DK-34)?

    Cheers, Melissa

    enhancement 
    opened by Melissa1909 3
  • Script not calling the correct python version

    Script not calling the correct python version

    The script in version v1.0.0 is invoking the #!/usr/bin/env python interpreter, which could generate some issue if you default python is python2 (e.g., in older MacOS versions).

    bug 
    opened by alegiac95 1
  • Version 1.1.0

    Version 1.1.0

    Updated the scripts with:

    • support for both full brain analysis and cortical regions only
    • GSEA analysis (both during the analysis and as a separate script)
    • pdf report of the analysis
    opened by alegiac95 0
  • clean code and fix test

    clean code and fix test

    This commit does an extensive code cleaning following the PEP8 standard. It also fixes a test that was most probably intended for previous unstable versions of the software.

    Still to do:

    • Remove logging
    opened by matteofrigo 0
  • Add mathematical background on PLS

    Add mathematical background on PLS

    A more detailed explanation on PLS model and regression is required in the docs.

    • [ ] Add a general mathematical formulation of PLS
    • [ ] Use of PLS in neuroimaging applications
    • [ ] Description of the SIMPLS algorithm used by pypls

    In addition provide some background on correlation, since it is now added to the methods available in the python package/script

    documentation 
    opened by alegiac95 0
Releases(v.1.1.8)
Log4j JNDI inj. vuln scanner

Log-4-JAM - Log 4 Just Another Mess Log4j JNDI inj. vuln scanner Requirements pip3 install requests_toolbelt Usage # make sure target list has http/ht

Ashish Kunwar 66 Nov 09, 2022
Qimera: Data-free Quantization with Synthetic Boundary Supporting Samples

Qimera: Data-free Quantization with Synthetic Boundary Supporting Samples This repository is the official implementation of paper [Qimera: Data-free Q

Kanghyun Choi 21 Nov 03, 2022
Code for Pose-Controllable Talking Face Generation by Implicitly Modularized Audio-Visual Representation (CVPR 2021)

Pose-Controllable Talking Face Generation by Implicitly Modularized Audio-Visual Representation (CVPR 2021) Hang Zhou, Yasheng Sun, Wayne Wu, Chen Cha

Hang_Zhou 628 Dec 28, 2022
RLHive: a framework designed to facilitate research in reinforcement learning.

RLHive is a framework designed to facilitate research in reinforcement learning. It provides the components necessary to run a full RL experiment, for both single agent and multi agent environments.

88 Jan 05, 2023
[ICRA 2022] An opensource framework for cooperative detection. Official implementation for OPV2V.

OpenCOOD OpenCOOD is an Open COOperative Detection framework for autonomous driving. It is also the official implementation of the ICRA 2022 paper OPV

Runsheng Xu 322 Dec 23, 2022
Python package to add text to images, textures and different backgrounds

nider Python package for text images generation and watermarking Free software: MIT license Documentation: https://nider.readthedocs.io. nider is an a

Vladyslav Ovchynnykov 131 Dec 30, 2022
Data and analysis code for an MS on SK VOC genomes phenotyping/neutralisation assays

Description Summary of phylogenomic methods and analyses used in "Immunogenicity of convalescent and vaccinated sera against clinical isolates of ance

Finlay Maguire 1 Jan 06, 2022
This repository holds the code for the paper "Deep Conditional Gaussian Mixture Model forConstrained Clustering".

Deep Conditional Gaussian Mixture Model for Constrained Clustering. This repository holds the code for the paper Deep Conditional Gaussian Mixture Mod

17 Oct 30, 2022
DeepLabv3+:Encoder-Decoder with Atrous Separable Convolution语义分割模型在tensorflow2当中的实现

DeepLabv3+:Encoder-Decoder with Atrous Separable Convolution语义分割模型在tensorflow2当中的实现 目录 性能情况 Performance 所需环境 Environment 注意事项 Attention 文件下载 Download

Bubbliiiing 31 Nov 25, 2022
Python code for the paper How to scale hyperparameters for quickshift image segmentation

How to scale hyperparameters for quickshift image segmentation Python code for the paper How to scale hyperparameters for quickshift image segmentatio

0 Jan 25, 2022
Ratatoskr: Worcester Tech's conference scheduling system

Ratatoskr: Worcester Tech's conference scheduling system In Norse mythology, Ratatoskr is a squirrel who runs up and down the world tree Yggdrasil to

4 Dec 22, 2022
Robbing the FED: Directly Obtaining Private Data in Federated Learning with Modified Models

Robbing the FED: Directly Obtaining Private Data in Federated Learning with Modified Models This repo contains a barebones implementation for the atta

16 Dec 04, 2022
Rendering color and depth images for ShapeNet models.

Color & Depth Renderer for ShapeNet This library includes the tools for rendering multi-view color and depth images of ShapeNet models. Physically bas

Yinyu Nie 41 Dec 19, 2022
PyTorch implementation of hand mesh reconstruction described in CMR and MobRecon.

Hand Mesh Reconstruction Introduction This repo is the PyTorch implementation of hand mesh reconstruction described in CMR and MobRecon. Update 2021-1

Xingyu Chen 236 Dec 29, 2022
Request execution of Galaxy SARS-CoV-2 variation analysis workflows on input data you provide.

SARS-CoV-2 processing requests Request execution of Galaxy SARS-CoV-2 variation analysis workflows on input data you provide. Prerequisites This autom

useGalaxy.eu 17 Aug 13, 2022
Implementation of ECCV20 paper: the devil is in classification: a simple framework for long-tail object detection and instance segmentation

Implementation of our ECCV 2020 paper The Devil is in Classification: A Simple Framework for Long-tail Instance Segmentation This repo contains code o

twang 98 Sep 17, 2022
Neural network chess engine trained on Gary Kasparov's games.

Neural Chess It's not the best chess engine, but it is a chess engine. Proof of concept neural network chess engine (feed-forward multi-layer perceptr

3 Jun 22, 2022
Official code repository for the publication "Latent Equilibrium: A unified learning theory for arbitrarily fast computation with arbitrarily slow neurons"

Latent Equilibrium: A unified learning theory for arbitrarily fast computation with arbitrarily slow neurons This repository contains the code to repr

Computational Neuroscience, University of Bern 3 Aug 04, 2022
Text mining project; Using distilBERT to predict authors in the classification task authorship attribution.

DistilBERT-Text-mining-authorship-attribution Dataset used: https://www.kaggle.com/azimulh/tweets-data-for-authorship-attribution-modelling/version/2

1 Jan 13, 2022
Adaptive Pyramid Context Network for Semantic Segmentation (APCNet CVPR'2019)

Adaptive Pyramid Context Network for Semantic Segmentation (APCNet CVPR'2019) Introduction Official implementation of Adaptive Pyramid Context Network

21 Nov 09, 2022