Giter VIP home page Giter VIP logo

ciccalab / simpli Goto Github PK

View Code? Open in Web Editor NEW
33.0 5.0 4.0 46.27 MB

SIMPLI is a highly configurable pipeline for the analysis of multiplexed imaging data.

Home Page: https://github.com/ciccalab/SIMPLI/wiki

License: Other

Nextflow 33.97% Python 9.92% R 56.11%
cell-segmentation single-cell-analysis imaging-mass-cytometry immunofluorescence histological-images gating tissue-analysis tissue-classification histology bioimage-analysis

simpli's Introduction

DOI

SIMPLI: Single-cell Identification from MultiPLexed Images

SIMPLI is a platform agnostic pipeline for the analysis of highly multiplexed histological imaging data.

Documentation

More Information about SIMPLI and its use can be found in the wiki.

Quick start

To try SIMPLI:

  1. Install Singularity
  2. Install Nextflow
  3. Run: nextflow run ciccalab/SIMPLI -profile test

This will run SIMPLI on minimal example dataset distributed in this repository. For more details on the example dataset and the associated analysis workflow see the example-workflow page.

The expected installation time on a desktop computer (Ubuntu 21.04) is of about 20 minutes. The expected run time with the example run on a desktop computer (Ubuntu 21.04) is of about 45 minutes.

Citation

If you used SIMPLI for your analysis please cite our preprint:

A SIMPLI (Single-cell Identification from MultiPLexed Images) approach for spatially-resolved tissue phenotyping at single-cell resolution
Michele Bortolomeazzi, Lucia Montorsi, Damjan Temelkovski, Mohamed Reda Keddar, Amelia Acha-Sagredo, Michael J. Pitcher, Gianluca Basso, Luigi Laghi, Manuel Rodriguez-Justo, Jo Spencer & Francesca D. Ciccarelli
Nature Communications volume 13, Article number: 781 (2022)
DOI: https://doi.org/10.1038/s41467-022-28470-x

SIMPLI is a software developed in the Ciccarelli group.
We are part of The School of Cancer Studies of King's College London and of The Francis Crick Institute.

SIMPLI was originally maintained and developed by Michele Bortolomeazzi.

License

SIMPLI is released under the CRICK Non-commercial Licence Agreement v 2.0.. No permission is required from the rights-holder for non-commercial research uses. Commercial use will require a license from the rights-holder. For further information see the license or contact [email protected].

simpli's People

Contributors

damjanmk avatar michelebortol avatar pietroandrei avatar reda94 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

simpli's Issues

Support Singularity successor Apptainer (`Cannot enable more than one container engine -- Choose either one of: singularity, apptainer`)

singularity.enabled = true
singularity.autoMounts = true
singularity.cacheDir = "singularity/containers"

Apptainer is the successor of Singularity.

$ curl https://singularity.hpcng.org/
<!DOCTYPE html>
<html>             
    <head>
        <meta http-equiv="refresh" content="0; url='https://apptainer.org/index.html'" />
    </head>
    <body>
        <h2 style="text-align: center; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;">This page has been moved to our new domain! ( apptainer.org ). Please wait well we redirect you. </h2>
[…]

Nextflow supports a variety of container runtimes, including Apptainer. It’d be nice, if SIMPLI would support it too and not hardcode Singularity.

$ ./launch.sh run https://github.com/ciccalab/SIMPLI -profile test -with-apptainer /dev/shm/nextflow/singularity/containers/simpli_imaging-default-simpli_imctools_stardist-test.img
N E X T F L O W  ~  version 23.02.1-edge
Launching `https://github.com/ciccalab/SIMPLI` [condescending_dalembert] DSL2 - revision: 09e3bd432a [master]
Cannot enable more than one container engine -- Choose either one of: singularity, apptainer

Issue with CreateSeuratObject

Hey Michele,

I'm trying to run SIMPLI again but I'm getting an issue at the clustering step. This is the clustering_log.txt output:

Loading required package: ggplot2
Loading required package: cowplot
Loading required package: Matrix
Registered S3 method overwritten by 'gplots':
  method         from 
  reorder.factor gdata
Warning: namespace ‘dimRed’ is not available and has been replaced
by .GlobalEnv when processing object ‘<unknown>’
Warning: namespace ‘dimRed’ is not available and has been replaced
by .GlobalEnv when processing object ‘<unknown>’
[1] "annotated_cells.csv"                                                                                                                                                                                                                                                                                                             
[2] "sample_metadata_SEN.csv"                                                                                                                                                                                                                                                                                                         
[3] "all_cells"                                                                                                                                                                                                                                                                                                                       
[4] "Intensity_MeanIntensity_CD163@Intensity_MeanIntensity_p16@Intensity_MeanIntensity_yH2AX@Intensity_MeanIntensity_OLIG2@Intensity_MeanIntensity_p21@Intensity_MeanIntensity_MAP2@Intensity_MeanIntensity_GLB1@Intensity_MeanIntensity_GFAP@Intensity_MeanIntensity_Ki67@Intensity_MeanIntensity_Iba1@Intensity_MeanIntensity_GLUT1"
[5] "0.4"                                                                                                                                                                                                                                                                                                                             
[6] "all_cells"                                                                                                                                                                                                                                                                                                                       
[7] "all_cells"                                                                                                                                                                                                                                                                                                                       
Reading the clustering data by sample
Scaling and centering clustering data by sample.
Error in (function (cl, name, valueClass)  : 
  assignment of an object of class “NULL” is not valid for @‘cell.names’ in an object of class “seurat”; is(value, "vector") is not TRUE
Calls: lapply -> FUN -> CreateSeuratObject -> <Anonymous>
In addition: There were 50 or more warnings (use warnings() to see the first 50)
Execution halted

I've run your code from Seurat_Runner.R up to creating the seurats_by_sample object on my RStudio and it works, but I have the new version of Seurat. Do you have any suggestions on how to fix it?

Thanks a lot for your help!

Singularity image

Hi Michele,
can you please make the Singularity image available?
Thanks,
Alessia

Issue in normalization

Hi!
I have a problem running SIMPLI with multiple single channel samples. The problem is that SIMPLI normalizes only the first sample from the sample_metadata file. To better understand the problem I printed some output from the Nextflow process. It seems that the main.nf and workflow.nf reads the samples correct, but only the sample_1 is passed to the process.nf and that is why the sample_2 is not normalized. If I run the pipeline with SIMPLI test data everything works fine. With my data I skip the extraction step because I'm using single channel tiff images.

My terminal output:

N E X T F L O W ~ version 21.10.6
Launching main.nf [backstabbing_celsius] - revision: 1548360ea3
executor > local (2)
[b9/f24b98] process > normalize_images:normalize_tiffs (1) [100%] 1 of 1 ✔
[14/107818] process > normalize_images:collect_normalize... [100%] 1 of 1 ✔
sample (printed from: main.nf) : sample_1
sample (printed from: workflow normalize_images) : sample_1
sample (printed from: main.nf) : sample_2
sample (printed from: workflow normalize_images) : sample_2
sample (printed from: process normalize_tiffs): sample_1

My metadata files are attached:

tiff_input_metadata.csv
sample_metadata.csv

`WARNING: underlay of /usr/share/zoneinfo/Etc/UTC required more than 50 (57) bind mounts`

Running SIMPLI’s test profile fails with the error below in our environment:

$ javac -version
javac 17.0.2-internal
$ singularity version
3.8.3+231-g9dceb4240
$ git log --oneline --no-decorate -1
7236f830a Fix Orphaned processes when using Singularity
$ ./launch.sh -v
nextflow version 23.02.1-edge.5846
$ ./launch.sh run https://github.com/ciccalab/SIMPLI -profile test
N E X T F L O W  ~  version 23.02.1-edge
Launching `https://github.com/ciccalab/SIMPLI` [high_mcnulty] DSL2 - revision: 09e3bd432a [master]
executor >  local (2)
[37/ac837e] process > convert_raw_data:convert_raw_data_to_tiffs (2)                           [  0%] 0 of 2
[-        ] process > convert_raw_data:collect_raw_tiff_metadata                               -
[-        ] process > normalize_images:normalize_tiffs                                         -
[-        ] process > normalize_images:collect_normalized_tiff_metadata                        -
[-        ] process > preprocess_images:image_preprocessing                                    -
[-        ] process > preprocess_images:process_preprocessed_metadata                          -
[-        ] process > measure_areas:measure_positive_areas                                     -
[-        ] process > cp_segment_cells:cp_cell_segmentation                                    -
[-        ] process > cp_segment_cells:collect_single_cell_data                                -
[-        ] process > sd_segment_cells:sd_cell_segmentation                                    -
[-        ] process > sd_segment_cells:collect_single_cell_data                                -
[-        ] process > identify_cell_types_mask:cell_type_identification_mask                   -
[-        ] process > threshold_expression:threshold_cells                                     -
[-        ] process > cluster_cells:cell_clustering                                            -
[-        ] process > cluster_cells:collect_clustering_data                                    -
[-        ] process > analyse_homotypic_interactions:homotypic_interaction_analysis            -
[-        ] process > analyse_homotypic_interactions:collect_homotypic_interactions            -
[-        ] process > calculate_heterotypic_distances:get_heterotypic_distances                -
[-        ] process > calculate_heterotypic_distances:collect_heterotypic_distances            -
[-        ] process > permute_heterotypic_interactions:permute_heterotypic_distances           -
[-        ] process > visualize_areas:area_visualization                                       -
[-        ] process > visualize_cell_types:cell_type_visualization                             -
[-        ] process > visualize_cell_clusters:cell_cluster_visualization                       -
[-        ] process > visualize_cell_thresholds:cell_threshold_visualization                   -
[-        ] process > visualize_homotypic_interactions:homotypic_interaction_visualization     -
[-        ] process > visualize_heterotypic_interactions:heterotypic_interaction_visualization -
[-        ] process > visualize_permuted_interactions:permuted_interaction_visualization       -


Error executing process > 'convert_raw_data:convert_raw_data_to_tiffs (2)'

Caused by:
  Process `convert_raw_data:convert_raw_data_to_tiffs (2)` terminated with an error exit status (1)

Command executed:

  python3.8 /opt/Tiff_extracter.py \
      CRC_2 \
      'ROI004_R-A02_x13400_800-y12700_1250-p0014-200Hz-p07dB-s0137' \
executor >  local (2)
[cc/e822d9] process > convert_raw_data:convert_raw_data_to_tiffs (1)                           [100%] 1 of 1, failed: 1
[-        ] process > convert_raw_data:collect_raw_tiff_metadata                               -
[-        ] process > normalize_images:normalize_tiffs                                         -
[-        ] process > normalize_images:collect_normalized_tiff_metadata                        -
[-        ] process > preprocess_images:image_preprocessing                                    -
[-        ] process > preprocess_images:process_preprocessed_metadata                          -
[-        ] process > measure_areas:measure_positive_areas                                     -
[-        ] process > cp_segment_cells:cp_cell_segmentation                                    -
[-        ] process > cp_segment_cells:collect_single_cell_data                                -
[-        ] process > sd_segment_cells:sd_cell_segmentation                                    -
[-        ] process > sd_segment_cells:collect_single_cell_data                                -
[-        ] process > identify_cell_types_mask:cell_type_identification_mask                   -
[-        ] process > threshold_expression:threshold_cells                                     -
[-        ] process > cluster_cells:cell_clustering                                            -
[-        ] process > cluster_cells:collect_clustering_data                                    -
[-        ] process > analyse_homotypic_interactions:homotypic_interaction_analysis            -
[-        ] process > analyse_homotypic_interactions:collect_homotypic_interactions            -
[-        ] process > calculate_heterotypic_distances:get_heterotypic_distances                -
[-        ] process > calculate_heterotypic_distances:collect_heterotypic_distances            -
[-        ] process > permute_heterotypic_interactions:permute_heterotypic_distances           -
[-        ] process > visualize_areas:area_visualization                                       -
[-        ] process > visualize_cell_types:cell_type_visualization                             -
[-        ] process > visualize_cell_clusters:cell_cluster_visualization                       -
[-        ] process > visualize_cell_thresholds:cell_threshold_visualization                   -
[-        ] process > visualize_homotypic_interactions:homotypic_interaction_visualization     -
[-        ] process > visualize_heterotypic_interactions:heterotypic_interaction_visualization -
[-        ] process > visualize_permuted_interactions:permuted_interaction_visualization       -
Error executing process > 'convert_raw_data:convert_raw_data_to_tiffs (2)'

Caused by:
  Process `convert_raw_data:convert_raw_data_to_tiffs (2)` terminated with an error exit status (1)

Command executed:

  python3.8 /opt/Tiff_extracter.py \
      CRC_2 \
      'ROI004_R-A02_x13400_800-y12700_1250-p0014-200Hz-p07dB-s0137' \
      crc_2.txt \
      single \
      ./ \
      channel_metadata.csv \
      CRC_2-raw_tiff_metadata.csv > extract_log.txt 2>&1

Command exit status:
  1

Command output:
  (empty)

Command error:
  INFO:    Converting SIF file to temporary sandbox...
  WARNING: underlay of /usr/share/zoneinfo/Etc/UTC required more than 50 (57) bind mounts
  INFO:    Cleaning up image...

Work dir:
  /dev/shm/nextflow/work/37/ac837e73cad46da68cc57e2a64ec93

Tip: view the complete command output by changing to the process work dir and entering the command `cat .command.out`





No idea, if the Singularity warning is a red herring, and something else causes this.

Is there a way to run that single Singularity “step” directly?

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.