vib-singlecell-nf / vsn-pipelines

A repository of pipelines for single-cell data in Nextflow DSL2
GNU General Public License v3.0
74 stars 31 forks source link

[BUG] Pipeline crashing when starting from SCopeLoomR loom files #286

Closed cbravo93 closed 3 years ago

cbravo93 commented 3 years ago

Describe the bug When using a loom file as input, if the loom file has been generated from ScopeLoomR the pipeline crashes.

To Reproduce Steps to reproduce the behavior:

  1. Configure with these options:

    # Set working directory
    WORK_DIR='/staging/leuven/stg_00002/lcb/cbravo/Multiomics_pipeline/analysis/Bravo_EAD_ScoMAP'
    # Move to folder and generate config
    mkdir -p $WORK_DIR/scripts/rna/vsn
    nextflow config vib-singlecell-nf/vsn-pipelines \
    -profile loom,single_sample,dm6,scenic,scenic_use_cistarget_motifs,singularity, > $WORK_DIR/scripts/rna/vsn/single_sample_scenic.config
  2. Run using this entry point:

    # Run pipeline
    mkdir -p  $WORK_DIR/output/rna/vsn
    cd $WORK_DIR/output/rna/vsn
    nextflow -C $WORK_DIR/scripts/rna/vsn/single_sample_scenic.config run vib-singlecell-nf/vsn-pipelines -entry single_sample_scenic
  3. See error:

    
    Error executing process > 'single_sample_scenic:SINGLE_SAMPLE:SC__FILE_CONVERTER (1)'

Caused by: Process single_sample_scenic:SINGLE_SAMPLE:SC__FILE_CONVERTER (1) terminated with an error exit status (1)

Command executed:

/user/leuven/313/vsc31305/.nextflow/assets/vib-singlecell-nf/vsn-pipelines/src/utils/bin/sc_file_converter.py --sample-id "ScoMAP_RNA_VE" --make-var-index-unique false --tag-cell-with-sample-id tr ue --input-format loom --output-format h5ad ScoMAP_RNA_VE.loom "ScoMAP_RNA_VE.SC__FILE_CONVERTER.h5ad"

Command exit status: 1

Command output: (empty)

Command error: Traceback (most recent call last): File "/user/leuven/313/vsc31305/.nextflow/assets/vib-singlecell-nf/vsn-pipelines/src/utils/bin/sc_file_converter.py", line 256, in sparse=False File "/opt/venv/lib/python3.7/site-packages/anndata/readwrite/read.py", line 157, in read_loom with connect(filename, 'r', **kwargs) as lc: File "/opt/venv/lib/python3.7/site-packages/loompy/loompy.py", line 1389, in connect return LoomConnection(filename, mode, validate=validate) File "/opt/venv/lib/python3.7/site-packages/loompy/loompy.py", line 82, in init raise ValueError("\n".join(lv.errors) + f"\n{filename} does not appead to be a valid Loom file according to Loom spec version '{lv.version}'") ...



**Solution**
Simply adding validate=False in https://github.com/vib-singlecell-nf/vsn-pipelines/blob/master/src/utils/bin/sc_file_converter.py on line 257 (as parameter scanpy.read_loom) solves this.
cflerin commented 3 years ago

@cbravo93 , you can try the fix in the develop branch