Giter Club home page Giter Club logo

imcyto's Introduction

nf-core/imcyto

GitHub Actions CI Status GitHub Actions Linting Status Nextflow DOI

Introduction

nfcore/imcyto is a bioinformatics analysis pipeline used for image segmentation and extraction of single cell expression data. This pipeline was generated for Imaging Mass Cytometry data, however, it is flexible enough to be applicable to other types of imaging data e.g. immunofluorescence/immunohistochemistry data.

The pipeline is built using Nextflow, a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It comes with docker containers making installation trivial and results highly reproducible.

Pipeline summary

  1. Split image acquisition output files (mcd, ome.tiff or txt) by ROI and convert to individual tiff files for channels with names matching those defined in user-provided metadata.csv file. Full and ilastik stacks will be generated separately for all channels being analysed in single cell expression analysis, and for channels being used to generate the cell mask, respectively (imctools).

  2. Apply pre-processing filters to full stack tiff files (CellProfiler).

  3. Use selected tiff files in ilastik stack to generate a composite RGB image representative of the plasma membranes and nuclei of all cells (CellProfiler).

  4. Use composite cell map to apply pixel classification for membranes, nuclei or background, and save probabilities map as tiff (Ilastik). If CellProfiler modules alone are deemed sufficient to achieve a reliable segmentation mask this step can be bypassed using the --skip_ilastik parameter in which case the composite tiff generated in step 3 will be used in subsequent steps instead.

  5. Use probability/composite tiff and pre-processed full stack tiff for segmentation to generate a single cell mask as tiff, and subsequently overlay cell mask onto full stack tiff to generate single cell expression data in csv file (CellProfiler).

Quick Start

i. Install nextflow

ii. Install one of docker or singularity

iii. Download the pipeline and test it on a minimal dataset with a single command

nextflow run nf-core/imcyto -profile test,<docker/singularity/institute>

Please check nf-core/configs to see if a custom config file to run nf-core pipelines already exists for your Institute. If so, you can simply use -profile <institute> in your command. This will enable either docker or singularity and set the appropriate execution settings for your local compute environment.

iv. Start running your own analysis!

nextflow run nf-core/imcyto \
    --input "./inputs/*.mcd" \
    --metadata './inputs/metadata.csv' \
    --full_stack_cppipe './plugins/full_stack_preprocessing.cppipe' \
    --ilastik_stack_cppipe './plugins/ilastik_stack_preprocessing.cppipe' \
    --segmentation_cppipe './plugins/segmentation.cppipe' \
    --ilastik_training_ilp './plugins/ilastik_training_params.ilp' \
    --plugins './plugins/cp_plugins/' \
    -profile <docker/singularity/institute>

See usage docs for all of the available options when running the pipeline.

Documentation

The nf-core/imcyto pipeline comes with documentation about the pipeline, found in the docs/ directory:

  1. Installation
  2. Pipeline configuration
  3. Running the pipeline
  4. Output and how to interpret the results
  5. Troubleshooting

Credits

The pipeline was originally written by The Bioinformatics & Biostatistics Group for use at The Francis Crick Institute, London.

The pipeline was developed by Harshil Patel and Nourdine Bah in collaboration with Karishma Valand, Febe van Maldegem, Emma Colliver and Mihaela Angelova.

Many thanks to others who contributed as a result of the Crick Data Challenge (Jan 2019) - Gavin Kelly, Becky Saunders, Katey Enfield, Alix Lemarois, Nuria Folguera Blasco, Andre Altmann.

It would not have been possible to develop this pipeline without the guidelines, scripts and plugins provided by the Bodenmiller Lab. Thank you too!

Contributions and Support

If you would like to contribute to this pipeline, please see the contributing guidelines.

For further information or help, don't hesitate to get in touch on Slack (you can join with this invite).

Citation

If you use nf-core/imcyto for your analysis, please cite it using the following preprint:

Characterisation of tumour microenvironment remodelling following oncogene inhibition in preclinical studies with imaging mass cytometry.

Febe van Maldegem, Karishma Valand, Megan Cole, Harshil Patel, Mihaela Angelova, Sareena Rana, Emma Colliver, Katey Enfield, Nourdine Bah, Gavin Kelly, Victoria Siu Kwan Tsang, Edurne Mugarza, Christopher Moore, Philip Hobson, Dina Levi, Miriam Molina, Charles Swanton & Julian Downward.

Nat Commun. 2021 Oct 8;12(1):5906. doi: 10.1038/s41467-021-26214-x

The Zenodo doi for the pipeline itself is: 10.5281/zenodo.3865430

You can cite the nf-core publication as follows:

The nf-core framework for community-curated bioinformatics pipelines.

Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.

Nat Biotechnol. 2020 Feb 13. doi: 10.1038/s41587-020-0439-x.
ReadCube: Full Access Link

An extensive list of references for the tools used by the pipeline can be found in the CITATIONS.md file.

imcyto's People

Contributors

drpatelh avatar karishmaval avatar maxulysse avatar precancer 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

Watchers

 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  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  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  avatar

imcyto's Issues

problem with the test case

I try to use the tool with the test case but I got the following error (which refers to the 20191121_BRAC3438.6f.mcd)

>>> nextflow run nf-core/imcyto -profile test,docker
N E X T F L O W  ~  version 20.10.0
Launching `nf-core/imcyto` [marvelous_bhabha] - revision: b5877ce63f [master]
----------------------------------------------------
                                        ,--./,-.
        ___     __   __   __   ___     /,-._.--~'
  |\ | |__  __ /  ` /  \ |__) |__         }  {
  | \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                        `._,._,'
  nf-core/imcyto v1.0.0
----------------------------------------------------
Run Name                 : marvelous_bhabha
Input Files              : https://raw.githubusercontent.com/nf-core/test-datasets/imcyto/inputs/20191121_BRAC3438.6f.mcd
Metadata File            : https://raw.githubusercontent.com/nf-core/test-datasets/imcyto/inputs/metadata.csv
Full Stack cppipe File   : https://raw.githubusercontent.com/nf-core/test-datasets/imcyto/plugins/full_stack_preprocessing.cppipe
Ilastik Stack cppipe File: https://raw.githubusercontent.com/nf-core/test-datasets/imcyto/plugins/ilastik_stack_preprocessing.cppipe
Skip Ilastik Step        : No
Ilastik Training ilp File: https://raw.githubusercontent.com/nf-core/test-datasets/imcyto/plugins/ilastik_training_params.ilp
Segmentation cppipe File : https://raw.githubusercontent.com/nf-core/test-datasets/imcyto/plugins/segmentation.cppipe
Max Resources            : 6 GB memory, 2 cpus, 12h time per job
Container                : docker - [:]
Output Dir               : ./results
Launch Dir               : /home/nucleai
Working Dir              : /home/nucleai/work
Script Dir               : /home/nucleai/.nextflow/assets/nf-core/imcyto
User                     : nucleai
Config Profile           : test,docker
Config Description       : Minimal test dataset to check pipeline function
----------------------------------------------------
executor >  local (2)
[2e/3d5015] process > IMCTOOLS (20191121_BRAC3438.6f) [  0%] 0 of 1
executor >  local (2)
[2e/3d5015] process > IMCTOOLS (20191121_BRAC3438.6f) [100%] 1 of 1, failed: 1 ✘
[-        ] process > PREPROCESS_FULL_STACK           -
executor >  local (2)
[2e/3d5015] process > IMCTOOLS (20191121_BRAC3438.6f) [100%] 1 of 1, failed: 1 ✘
[-        ] process > PREPROCESS_FULL_STACK           -
executor >  local (2)
[2e/3d5015] process > IMCTOOLS (20191121_BRAC3438.6f) [100%] 1 of 1, failed: 1 ✘
[-        ] process > PREPROCESS_FULL_STACK           -
[-        ] process > PREPROCESS_ILASTIK_STACK        -
executor >  local (2)
[2e/3d5015] process > IMCTOOLS (20191121_BRAC3438.6f) [100%] 1 of 1, failed: 1 ✘
[-        ] process > PREPROCESS_FULL_STACK           -
[-        ] process > PREPROCESS_ILASTIK_STACK        -
[-        ] process > ILASTIK                         -
[-        ] process > SEGMENTATION                    -
[d4/a4bba6] process > output_documentation            [100%] 1 of 1 ✔
[-        ] process > get_software_versions           -
Execution cancelled -- Finishing pending tasks before exit
-[nf-core/imcyto] Pipeline completed with errors-
Error executing process > 'IMCTOOLS (20191121_BRAC3438.6f)'

Caused by:
  Process `IMCTOOLS (20191121_BRAC3438.6f)` terminated with an error exit status (1)

Command executed:

  run_imctools.py 20191121_BRAC3438.6f.mcd metadata.csv
  pip show imctools | grep "Version" > imctools_version.txt

Command exit status:
  1

Command output:
  (empty)

Command error:
  Traceback (most recent call last):
    File "/home/nucleai/.nextflow/assets/nf-core/imcyto/bin/run_imctools.py", line 73, in <module>
      parser = mcdparser.McdParser(args.INPUT_FILE)
    File "/usr/local/lib/python3.8/site-packages/imctools/io/mcdparser.py", line 31, in __init__
      McdParserBase.__init__(self, filename, filehandle, metafilename)
    File "/usr/local/lib/python3.8/site-packages/imctools/io/mcdparserbase.py", line 48, in __init__
      self.retrieve_mcd_xml()
    File "/usr/local/lib/python3.8/site-packages/imctools/io/mcdparser.py", line 73, in retrieve_mcd_xml
      raise ValueError('Invalid MCD: MCD xml start tag not found in file %s' % self.filename)
  ValueError: Invalid MCD: MCD xml start tag not found in file 20191121_BRAC3438.6f.mcd

Work dir:
  /home/nucleai/work/2e/3d50156173d45bbca8d5be8dae1dd3

Tip: when you have fixed the problem you can continue the execution adding the option `-resume` to the run command line

Can you please suggest a way of fixing it?
Thanks

not compatible with m1 chip mac?

executor > local (4)
executor > local (5)
executor > local (5)
[bc/96dcc6] process > IMCTOOLS (20191121_BRAC3438.6f) [100%] 1 of 1 ✔
executor > local (6)
[bc/96dcc6] process > IMCTOOLS (20191121_BRAC3438.6f) [100%] 1 of 1 ✔
executor > local (6)
[bc/96dcc6] process > IMCTOOLS (20191121_BRAC3438.6f) [100%] 1 of 1 ✔
[ae/64b3cc] process > PREPROCESS_FULL_STACK (20191121_BRAC3438.6f.roi_1) [ 50%] 1 of 2, failed: 1, retr..
[db/52ddad] process > PREPROCESS_ILASTIK_STACK (20191121_BRAC3438.6f.roi_1) [ 50%] 1 of 2, failed: 1, retr..
[- ] process > ILASTIK -
[- ] process > SEGMENTATION -
[73/20c1b0] process > output_documentation [100%] 1 of 1 ✔
[- ] process > get_software_versions -
[0e/3d3a52] NOTE: Process PREPROCESS_ILASTIK_STACK (20191121_BRAC3438.6f.roi_1) terminated with an error exit status (139) -- Execution is retried (1)
[ad/ec9904] NOTE: Process PREPROCESS_FULL_STACK (20191121_BRAC3438.6f.roi_1) terminated with an error exit status (139) -- Execution is retried (1)
Error executing process > 'PREPROCESS_ILASTIK_STACK (20191121_BRAC3438.6f.roi_1)'

Caused by:
Process PREPROCESS_ILASTIK_STACK (20191121_BRAC3438.6f.roi_1) terminated with an error exit status (139)

executor > local (6)
[bc/96dcc6] process > IMCTOOLS (20191121_BRAC3438.6f) [100%] 1 of 1 ✔
[ae/64b3cc] process > PREPROCESS_FULL_STACK (20191121_BRAC3438.6f.roi_1) [ 50%] 1 of 2, failed: 1, retr..
[db/52ddad] process > PREPROCESS_ILASTIK_STACK (20191121_BRAC3438.6f.roi_1) [100%] 2 of 2, failed: 2, retr..
[- ] process > ILASTIK -
[- ] process > SEGMENTATION -
[73/20c1b0] process > output_documentation [100%] 1 of 1 ✔
[- ] process > get_software_versions -
[0e/3d3a52] NOTE: Process PREPROCESS_ILASTIK_STACK (20191121_BRAC3438.6f.roi_1) terminated with an error exit status (139) -- Execution is retried (1)
[ad/ec9904] NOTE: Process PREPROCESS_FULL_STACK (20191121_BRAC3438.6f.roi_1) terminated with an error exit status (139) -- Execution is retried (1)
Error executing process > 'PREPROCESS_ILASTIK_STACK (20191121_BRAC3438.6f.roi_1)'

Caused by:
Process PREPROCESS_ILASTIK_STACK (20191121_BRAC3438.6f.roi_1) terminated with an error exit status (139)

Command executed:

export _JAVA_OPTIONS="-Xms3g -Xmx6g"
cellprofiler
--run-headless
--pipeline ilastik_stack_preprocessing.cppipe
--image-directory ./
--plugins-directory ./plugins
--output-directory ./ilastik_stack
--log-level DEBUG
--temporary-directory ./tmp

Command exit status:
139

Command output:
(empty)

Command error:
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
JVM will be started with AWT in headless mode
Creating JVM object
Picked up _JAVA_OPTIONS: -Xms3g -Xmx6g
Signalling caller
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
.command.sh: line 10: 71 Segmentation fault cellprofiler --run-headless --pipeline ilastik_stack_preprocessing.cppipe --image-directory ./ --plugins-directory ./plugins --output-directory ./ilastik_stack --log-level DEBUG --temporary-directory ./tmp

Work dir:
/Users/yangfan/Documents/nextflow/work/db/52ddadc010898629c0887645c8367c

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

-[nf-core/imcyto] Pipeline completed with errors-
WARN: Killing pending tasks (1)

Dear developer,

I got error when I run nextflow run nf-core/imcyto -profile test,docker can you help me with it? Thanks in advance

request function - restart from custom point in pipeline

I was wondering if it's possible to restart the nf-core/imcyto pipeline from a specific point, this would be very useful in case we have to tweak something about cell segmentation, object identification etc...
for example from the image below
Screen Shot 2020-10-29 at 12 21 18 PM
everything worked well, but let's say I need to edit the segmentation step.
I'd like to go back, edit the segmentation.cppipe file as needed and then re-run that step....the -resume argument is awesome, I'm wondering whether it's possible to add something like -resume_segmentation or similar

imcyto pipeline won't return same output as CellProfiler

hi guys, I’m running into a problem with imcyto where if I run the segmentation.cppipe by itself in CellProfiler using tiffs from one of the ROIs, it works well ( = it finds various cells, markers etc…), however, when I run nf-core/imcyto with the exact same mcd file, I do not get any of the results I get running the tiffs separately. and those tiffs were taken from the work directory. for example, I get a nice mask for tumor cells if I run tiffs through CellProfiler, but if get no mask through nf-core/imcyto….any suggestions? and yes, I did use the same .cppipe file. tnx!

run_imctools.py metal names are expected to be unique, and have issues if the Channel names are protein listed

So this issue is posted on the slack and this is a cross reference slack

The inputs required are a panel.csv with a column for metals that the script run_imctools.py parses and creates a metal dictionary. So the python commands do require the metals to be in the MCD file that are unique. However, in some instances, the IMC technitian can manually provided channel names corresponding to the proteins. The text file here below shows that the Channel names (aSMA) were labeled during ablation, and the label names (Y89Di) are usually always the isotope metals. So the issue happens when channel names are somewhat similar ("CD45", and "CD4") for instance, this will cause an error in the python command .startswith(entry) when attempting to parse the metal dictionary.

I've fixed this issue to resolve my issue, in a hacky way, by using replacing the startswith to endswith to improve the matching.

In other cases, in the test-dataset, ablation files, the channel names correspond to the metal isotopes, and the label names also correspond with the metal isotopes. so in this case, the default run_imctools.py works fine. However, if the channel names are proteins, the current version will not uniquely create the metal dictionary.

the panel.csv (attached) is the format for this type of experiment, and yes this does process.

ISSUE: is there a way that the imcyto pipeline can incorporate this (or a better) run_imctools.py script? as of now i have to run this process using interative containers, and can not run the pipeline as of now.

Start_push End_push Pushes_duration X Y Z CD45(Y89Di) aSMA(In113Di) CD31(In115Di) HLA_ABC(La139Di) CD38(Pr141Di) CD69(Nd142Di) vimentin(Nd143Di) CCR6(Nd144Di) CK19(Nd145Di) tryptase(Nd146Di) CD163(Sm147Di) CXCR3(Nd148Di) PD1(Sm149Di) PDL1(Nd150Di) IL6(Eu151Di) CD11c(Sm152Di) LAG3(Eu153Di) HepPar1(Sm154Di) FOXP3(Gd155Di) CD4(Gd156Di) E_cadherin(Gd158Di) CD68(Tb159Di) GATA3(Gd160Di) CD20(Dy161Di) CD8a(Dy162Di) TIM3(Dy163Di)
test.panel.csv
FAP(Dy164Di) CD138(Ho165Di) iNOS(Er166Di) CD11b(Er167Di) podoplanin(Er168Di) collagen_T1(Tm169Di) CD3(Er170Di) NKG2D(Yb171Di) CD15(Yb172Di) CD45RO(Yb173Di) HLA_DR(Yb174Di) IL10(Lu175Di) CTLA4(Yb176Di) 191Ir(Ir191Di) 193Ir(Ir193Di) granzymeB(Pt195Di) Ki67(Pt198Di) HistoneH3(Bi209Di)
2011 2394 384 0 0 0 0.000 1.000 0.000 2.584 0.000 1.363 78.762 6.578 0.000 0.595 0.000 0.000 3.658 0.000 6.282 0.000 0.000 0.000 1.000 0.000 0.000 1.000 0.000 0.000 3.614 1.000 0.000 0.000 0.000 0.000 0.000 4.277 0.000 0.000 1.334 0.000 28.858 0.000 0.000 0.000 2.189 0.000 1.000 1.000
2396 2779 384 1 0 1 0.000 1.723 0.000 2.000 0.000 0.000 64.860 1.277 0.000 0.000 0.000 1.000 0.000 0.000 7.754 0.000 0.000 1.660 0.000 0.000 2.063 2.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000


import os
import sys
import argparse
import re

import imctools.io.mcdparser as mcdparser
import imctools.io.txtparser as txtparser
import imctools.io.ometiffparser as omeparser
import imctools.io.mcdxmlparser as meta

############################################
############################################
## PARSE ARGUMENTS
############################################
############################################

Description = 'Split nf-core/imcyto input data by full/ilastik stack.'
Epilog = """Example usage: python run_imctools.py <MCD/TXT/TIFF> <METADATA_FILE>"""

argParser = argparse.ArgumentParser(description=Description, epilog=Epilog)
argParser.add_argument('INPUT_FILE', help="Input files with extension '.mcd', '.txt', or '.tiff'.")
argParser.add_argument('METADATA_FILE', help="Metadata file containing 3 columns i.e. metal,full_stack,ilastik_stack. See pipeline usage docs for file format information.")
args = argParser.parse_args()

############################################
############################################
## PARSE & VALIDATE INPUTS
############################################
############################################

## READ AND VALIDATE METADATA FILE
ERROR_STR = 'ERROR: Please check metadata file'
HEADER = ['metal', 'full_stack', 'ilastik_stack']

fin = open(args.METADATA_FILE,'r')
header = fin.readline().strip().split(',')
if header != HEADER:
    print("{} header: {} != {}".format(ERROR_STR,','.join(header),','.join(HEADER)))
    sys.exit(1)

metalDict = {}
for line in fin.readlines():
    lspl = line.strip().split(',')
    metal,fstack,istack = lspl

    ## CHECK THREE COLUMNS IN LINE
    if len(lspl) != len(HEADER):
        print("{}: Invalid number of columns - should be 3!\nLine: '{}'".format(ERROR_STR,line.strip()))
        sys.exit(1)

    ## CHECK VALID INCLUDE/EXCLUDE CODES
    if fstack not in ['0','1'] or istack not in ['0','1']:
        print("{}: Invalid column code - should be 0 or 1!\nLine: '{}'".format(ERROR_STR,line.strip()))
        sys.exit(1)

    ## CREATE DICTIONARY
    metal = metal.upper()
    if metal not in metalDict:
        metalDict[metal] = [bool(int(x)) for x in [fstack,istack]]
fin.close()

## OUTPUT FILE LINKING ROI IDS TO ROI LABELS (IMAGE DESCRIPTION)
roi_map = open(os.path.basename(args.INPUT_FILE)+'_ROI_map.csv', "w")

## USE DIFFERENT PARSERS CORRESPONDING TO THE INPUT FILE FORMAT
file_type = re.sub(".*\.([^.]+)$", '\\1', args.INPUT_FILE.lower())

## CONVERT INPUT_FILE TO TIFF AND WRITE RELEVANT TIFF IMAGES
if file_type == "mcd":
    parser = mcdparser.McdParser(args.INPUT_FILE)
    acids = parser.acquisition_ids
else:
    if file_type == "txt":
        parser = txtparser.TxtParser(args.INPUT_FILE)
    elif file_type == "tiff" or file_type == "tif":
        parser = omeparser.OmetiffParser(args.INPUT_FILE)
    else:
        print("{}: Invalid input file type - should be txt, tiff, or mcd!".format(file_type))
        sys.exit(1)

    # THERE IS ONLY ONE ACQUISITION - ROI FOLDER NAMED ACCORDING TO INPUT FILENAME
    acids = [ re.sub('.txt|.tiff', '', os.path.basename(parser.filename).lower().replace(" ", "_")) ]

for roi_number in acids:
    if file_type == "mcd":
        imc_ac = parser.get_imc_acquisition(roi_number)
        acmeta = parser.meta.get_object(meta.ACQUISITION, roi_number)
        roi_label = parser.get_acquisition_description(roi_number)
        roi_map.write("roi_%s,%s,%s,%s" % (roi_number, roi_label, acmeta.properties['StartTimeStamp'], acmeta.properties['EndTimeStamp']) + "\n")
    else:
        imc_ac = parser.get_imc_acquisition()

        # NO INFORMATION ON IMAGE ACQUISITION TIME FOR TXT AND TIFF FILE FORMATS
        roi_map.write("roi_%s,,," % (roi_number) + "\n")

    for i,j in enumerate(HEADER[1:]):
        ## WRITE TO APPROPRIATE DIRECTORY
        dirname = "roi_%s/%s" % (roi_number, j)
        if not os.path.exists(dirname):
            os.makedirs(dirname)

        # SELECT THE METALS FOR THE CORRESPNDING STACK (i) TO CREATE OME TIFF STACK
        label_indices = [ idx for idx in range(0, len(imc_ac.channel_labels)) if len([ entry for entry in metalDict if imc_ac.channel_labels[idx].upper().startswith(entry) and metalDict[entry][i]]) > 0 ]
        metal_stack = [ imc_ac.channel_metals[idx] for idx in label_indices ]

        if len(metal_stack) > 0:
            img = imc_ac.get_image_writer(filename=os.path.join("roi_%s" % (roi_number), "%s.ome.tiff" % j), metals=metal_stack)
            img.save_image(mode='ome', compression=0, dtype=None, bigtiff=True)
        else:
            print("None of the metals exists in metasheet file for {}".format(j))
            sys.exit(1)

        for l, m in zip(imc_ac.channel_labels, imc_ac.channel_metals):
            filename = "%s.tiff" % (l)

            # MATCH METAL LABEL TO METADATA METAL COLUMN
            # metal_label = l.split('_')[0].upper()
            metal_label = l.upper()
            # metal = [ entry for entry in metalDict if metal_label.upper().startswith(entry) and metalDict[entry][i] ]
            metal = [ entry for entry in metalDict if metal_label.upper().endswith(entry) and metalDict[entry][i] ]
            if len(metal) == 1:
                if metalDict[metal[0]][i]:
                    img = imc_ac.get_image_writer(filename=os.path.join(dirname,filename), metals=[m])
                    img.save_image(mode='ome', compression=0, dtype=None, bigtiff=False)
            elif len(metal) > 1:
                print("{} metal has multiple matches found".format(metal_label))
            elif len([ entry for entry in metalDict if metal_label.upper().startswith(entry)]) == 0:
                print("{} metal does not exist in metasheet file".format(metal_label))
roi_map.close()

Error when trying to test docker

Hi

I'm trying to set up the pipeline but I need some help.

I have a Windows laptop and access to a Linux server so my first question is whether to install it on the server or on the laptop using Windows Subsystem for Linux. Which one should be easier or recommended?

My second question is related to the error message below when I tried on the Linux server. What am I missing? I thought everything needed to test imcyto is contained in Docker but it seems like I'm missing lots. I need some guidance to install it. Probably I'm missing something basic but I couldn't find it by myself.

Regards
Juan

juan@fms-camb-522224:~/imcyto$ /home/juan/nextflow run nf-core/imcyto -profile test docker
N E X T F L O W ~ version 20.04.1
Launching nf-core/imcyto [voluminous_hypatia] - revision: c374aa8 [master]

                                    ,--./,-.
    ___     __   __   __   ___     /,-._.--~'

|\ | |__ __ / / \ |__) |__ } { | \| | \__, \__/ | \ |___ \-.,--, .,._,'
nf-core/imcyto v1.0.0

Run Name : voluminous_hypatia
Input Files : https://raw.githubusercontent.com/nf-core/test-datasets/imcyto/inputs/20191121_BRAC3438.6f.mcd
Metadata File : https://raw.githubusercontent.com/nf-core/test-datasets/imcyto/inputs/metadata.csv
Full Stack cppipe File : https://raw.githubusercontent.com/nf-core/test-datasets/imcyto/plugins/full_stack_preprocessing.cppipe
Ilastik Stack cppipe File: https://raw.githubusercontent.com/nf-core/test-datasets/imcyto/plugins/ilastik_stack_preprocessing.cppipe
Skip Ilastik Step : No
Ilastik Training ilp File: https://raw.githubusercontent.com/nf-core/test-datasets/imcyto/plugins/ilastik_training_params.ilp
Segmentation cppipe File : https://raw.githubusercontent.com/nf-core/test-datasets/imcyto/plugins/segmentation.cppipe
Max Resources : 6 GB memory, 2 cpus, 12h time per job
Output Dir : ./results
Launch Dir : /home/juan/imcyto
Working Dir : /home/juan/imcyto/work
Script Dir : /home/juan/.nextflow/assets/nf-core/imcyto
User : juan
Config Profile : test
Config Description : Minimal test dataset to check pipeline function

executor > local (2)
[ab/2d8f2b] process > IMCTOOLS (20191121_BRAC3438.6f) [ 0%] 0 of 1
executor > local (2)
[ab/2d8f2b] process > IMCTOOLS (20191121_BRAC3438.6f) [100%] 1 of 1, failed: 1 ✘
[- ] process > PREPROCESS_FULL_STACK -
executor > local (2)
[ab/2d8f2b] process > IMCTOOLS (20191121_BRAC3438.6f) [100%] 1 of 1, failed: 1 ✘
[- ] process > PREPROCESS_FULL_STACK -
executor > local (2)
[ab/2d8f2b] process > IMCTOOLS (20191121_BRAC3438.6f) [100%] 1 of 1, failed: 1 ✘
[- ] process > PREPROCESS_FULL_STACK -
[- ] process > PREPROCESS_ILASTIK_STACK -
executor > local (2)
[ab/2d8f2b] process > IMCTOOLS (20191121_BRAC3438.6f) [100%] 1 of 1, failed: 1 ✘
[- ] process > PREPROCESS_FULL_STACK -
[- ] process > PREPROCESS_ILASTIK_STACK -
[- ] process > ILASTIK -
[- ] process > SEGMENTATION -
[b7/2e781d] process > output_documentation [100%] 1 of 1 ✔
[- ] process > get_software_versions -
Execution cancelled -- Finishing pending tasks before exit
-[nf-core/imcyto] Pipeline completed with errors-
Error executing process > 'IMCTOOLS (20191121_BRAC3438.6f)'

Caused by:
Process IMCTOOLS (20191121_BRAC3438.6f) terminated with an error exit status (1)

Command executed:

run_imctools.py 20191121_BRAC3438.6f.mcd metadata.csv
pip show imctools | grep "Version" > imctools_version.txt

Command exit status:
1

Command output:
(empty)

Command error:
Traceback (most recent call last):
File "/home/juan/.nextflow/assets/nf-core/imcyto/bin/run_imctools.py", line 8, in
import imctools.io.mcdparser as mcdparser
ImportError: No module named imctools.io.mcdparser

Work dir:
/home/juan/imcyto/work/ab/2d8f2bc7a668f7a7782f2a0ad0b576

Tip: you can try to figure out what's wrong by changing to the process work dir and showing the script file named `.command.sh

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.