Code Monkey home page Code Monkey logo

lamanno-epfl / tomographer Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 3.0 1.58 MB

The Tomographer package implements the mathematical spatial image reconstruction of any set of read counts as described in the following article: https://www.nature.com/articles/s41587-021-00879-7

Home Page: http://tomographer.info/

License: BSD 2-Clause "Simplified" License

CSS 1.20% JavaScript 4.00% HTML 0.53% Python 10.29% Makefile 0.04% Batchfile 0.04% Jupyter Notebook 83.89%
omics spatial-data-analysis reconstruction-algorithm compressed-sensing

tomographer's Introduction

Tomographer

Software for spatial tissue profiling by imaging-free molecular tomography.

Content

Resources
Installation
Use

Resources

Tutorials. Documentation and tutorials explaining the step-by-step usage of Tomographer can be found here: http://tomographer.info/
Example Notebooks. Step-by-step notebooks to be found here: https://github.com/lamanno-epfl/tomographer/blob/master/tutorials/
Tomographer Data Viewer. Tomographer data-set browser of mouse and lizard brains: https://strpseq-viewer.epfl.ch/
Original Article. https://www.nature.com/articles/s41587-021-00879-7

Installation

The installation of the tomographer package and all requirements is achieved in the following steps.

If you don't have conda, you might find it helpful to install Miniconda before beginning:

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh

First, configure your environment containing some dependencies:

conda create -n tomographer-env python=3.7 numpy=1.19.0 scipy=1.2.0 pandas=0.24.1 scikit-learn=0.20.2 scikit-image=0.14.2 matplotlib=3.0.2 --channel bioconda --channel conda-forge
conda activate tomographer-env

Second, install required libraries

pip install PyWavelets GPy GPyopt
git clone https://github.com/jmetzen/gp_extras.git
cd gp_extras
[sudo] python setup.py install

For some tutorial notebooks you will also need BrainMap:

git clone https://github.com/linnarsson-lab/brainmap
cd brainmap
[sudo] python setup.py install

Third, clone tomographer locally

git clone https://github.com/lamanno-epfl/tomographer.git

Lastly, install in development mode

pip install -e ./tomographer

To update you can simply pull (you don't need to reinstall):

cd tomographer
git pull

Use

Please refer to http://tomographer.info/ for a detailed tutorial

The package requires 3 input files and 2 output directories.

Inputs

  • Config File : This is an .hdf5 formatted file which contains the following keys and values

    • angles _ names : array of angle names like ['angle9', 'angle117']
    • angles _ values : array of angle values in radians like [3.65, 5.096]
    • first _ points : array specifying the starting point to begin considering values within projection for each angle
    • mask _ g : 2D image array of mask (binary)
    • mask _ thrs : threshold used to create mask from reference image
    • masked _ formulation : Boolean indicating if design matrix should be recalculated using the masked formulation
    • proj _ len : array indicating the lengths of projections for each angle
    • reference _ mask : image array of reference image
    • symmetry : Boolean indicating if design matrix should be recalculated assuming axis of symmetry in tissue
    • widths : array indicating the estimated widths of the secondary slices in each angle
    • A : Specified design matrix. Note that this matrix is recalculated if the symmetry value is True or if the masked formulation value is True
  • Input File : This is an .hdf5 formatted file which contains a dictionary of dictionaries. It can be created with the ReconstructionConfig Class

    • The key genes is further queried by
      • The gene name, which itself contains the keys containing
        • The angle names that match those in the config file
          • Values inside input_file['genes'][gene_name][angle_name] correspond to the projection values
  • Gene File: Is a .txt formatted file which contains the individual gene names separated by lines (\n). These are queried by the tomographer one by one

Outputs

  • Output Reconstruction File : This is an .hdf5 formatted file which contains all the reconstructed genes
  • Output Alpha-Beta File : This is an .hdf5 formatted file which contains all the selected alpha and beta values that were selected for a given reconstruction. This may be useful for filtering out poorly reconstructed genes.

Example Usage

From tomographer, one can run the following command:

python3 tomography/tomorun.py -c path_to_config.hdf5 -i path_to_inputs.hdf5 -g /list_of_genes.txt -o /path_to_output.hdf5 -a /path_to_/alpha_beta_output.hdf5

tomographer's People

Contributors

chrstnschndr avatar gioelelm avatar hhschede avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rimanb medina997

tomographer's Issues

ModuleNotFoundError: No module named 'gp_extras.tomographer.tomography.custom_tv'

Hi,guys:
I've read your paper, very excellent work!
I'm trying to run tutorial1, but it seems like that you've missed custome_tv in tomography, thus, optimization.py in tomograpy can not import tv_masked and make_tv_ixmask. Would you mind release some data for test? Beacause it is hard to understand what the data looks like when I read "var: dictionary containing gene_list and attributes" .It will be nice if you can also offer some test data for "tomography/tomorun.py".
best wishes.

xjs

Questions about the configuration step

Hi,guys:
I've read your paper, very excellent work!
Currently, I'm trying to run the demo data provided. But I have some questions about the configuration.

  1. the tomography.ReconstructionConfig module, need user to provide mask file ( binarized image) and mask threshold for masking. But it also requires a reference image. Is it redundant if I provides both two images, as the masked image could be generated by masking the reference.
  2. also the angle_names and ange_values parameters (ange_values could be generated by extracting the values from the ange_names if I provide the ange_names following the cases you provided ).
  3. Could you please explain more detail about the first_point parameter?

Thank you very much!

Best regards,

Peifeng

About "brainmap"

Hi, I'm runnning tutorial1, and sorry that I faced a problem again, your code are as following:

Tomography

import tomography
from tomography.utils import pad_to_cube, pad_to_square, shift_simmetrize
from brainmap import *

but I cannot install package "brainmap". Can you tell me which package is it? Thank you so much~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.