epi2me-labs / wf-single-cell

Other
69 stars 35 forks source link

Workflow fails during tag_bam, for some datasets. #105

Closed ddiez closed 3 months ago

ddiez commented 4 months ago

Operating System

Other Linux (please specify below)

Other Linux

Ubuntu 23.10

Workflow Version

v2.0.2

Workflow Execution

Command line (Local)

Other workflow execution

No response

EPI2ME Version

No response

CLI command run

nextflow run epi2me-labs/wf-single-cell \
   -r master \
   -w workspace \
   -profile singularity \
   --fastq ../fastq \
   --single_cell_sample_sheet samples.txt \
   --ref_genome_dir ~/10x/refdata-gex/refdata-gex-mm10-2020-A \
   --out_dir output \
   --mito_prefix "mt-" \
   --umap_n_repeats 1

Workflow Execution - CLI Execution Profile

standard (default)

What happened?

The workflow stops during the tag_bam step. Accordingly, in the output directory only the following files are produced:

kneeplot.png  transcriptome.fa.gz  transcriptome.gff.gz  whitelist.tsv

Unfortunately this issue only happens in some datasets. In total I have 4 nanopore single cell datasets. The workflow fails in 2 of them and works without problem in the other 2. There is no apparent correlation in chemistry/kit version and organism used:

Datasets that fail:
mouse, 3_prime, v3. Reference: refdata-gex-mm10-2020-A.
human, 5_prime, v1. Reference: refdata-gex-GRCh38-2020-A.

Datasets that work:
human, 3_prime, v3. Reference: refdata-gex-GRCh38-2020-A.
human, multiome, v1. Reference: refdata-gex-GRCh38-2020-A (only RNA library being processed).

In previous versions of the workflow I was able to get the full pipeline working. I have tested on previous commits to the repository and could pin down the point where this issue starts to happen. Commit 21ca80fed139d573b5de6ad9a8384d11400ca1ab works well, but commit 67b8b105948e1df9dc838b640834a8c3225d7474, when changes to tag_bam were applied, shows the issue. I can provide more data/logs if necessary to identify the actual issue.

Relevant log output

[04:44:04 - workflow_glue.TagBAMs   ] tags/tag_25.tsv contains tags for refere
nce: chrM.
  [04:44:04 - workflow_glue.TagBAMs   ] tags/tag_9.tsv contains tags for referen
ce: JH584303.1.
  Traceback (most recent call last):
    File "/user/ifrec/diegodiez/.nextflow/assets/epi2me-labs/wf-single-cell/bin/
workflow-glue", line 7, in <module>
      cli()
    File "/user/ifrec/diegodiez/.nextflow/assets/epi2me-labs/wf-single-cell/bin/
workflow_glue/__init__.py", line 72, in cli
      args.func(args)
    File "/user/ifrec/diegodiez/.nextflow/assets/epi2me-labs/wf-single-cell/bin/workflow_glue/tag_bam.py", line 188, in main
      add_tags(args.tags, args.in_bam, args.out_bam, args.threads)
    File "/user/ifrec/diegodiez/.nextflow/assets/epi2me-labs/wf-single-cell/bin/workflow_glue/tag_bam.py", line 151, in add_tags
      store = TagStore(tags, bam=in_bam)
    File "/user/ifrec/diegodiez/.nextflow/assets/epi2me-labs/wf-single-cell/bin/workflow_glue/tag_bam.py", line 95, in __init__
      chrom = getattr(next(iter(d.values())), "chrom")
  StopIteration

Work dir:
  /user/ifrec/diegodiez/projects/t-devel/nanopore/wf-single-cell/workspace/3f/b765a0249df92a1e3531921b280f6c

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

 -- Check '.nextflow.log' file for details
WARN: Killing running tasks (7)

Application activity log entry

No response

Were you able to successfully run the latest version of the workflow with the demo data?

yes

Other demo data information

No response

cjw85 commented 3 months ago

Hi @ddiez,

Thank you for reporting this, it is the same issue as https://github.com/epi2me-labs/wf-single-cell/issues/100. The issue results when there is a contig/chromosome with no aligned reads.

We have a fix coming for this.

cjw85 commented 3 months ago

v2.0.3 will be available shortly and will fix the immediate error occurring here.

ddiez commented 3 months ago

@cjw85 sorry for the duplicated issue and thanks for the quick fix. I have now tested v2.0.3 on all 4 datasets and everything works as expected now. Thanks!

cjw85 commented 3 months ago

No problem, I'm glad things are working for you now.