haowenz / chromap

Fast alignment and preprocessing of chromatin profiles
https://haowenz.github.io/chromap/
MIT License
188 stars 20 forks source link

Alignment failure on scATAC data mapped to hg38 human genome #63

Closed chris-cheshire closed 2 years ago

chris-cheshire commented 2 years ago
Error executing process > 'LUSLAB_CUSTOMSC:CUSTOMSC:CHROMAP_ALIGN (scatac_1)'

Caused by:
  Process `LUSLAB_CUSTOMSC:CUSTOMSC:CHROMAP_ALIGN (scatac_1)` terminated with an error exit status (2)

Command executed:

  chromap \
      -t 12 \
      -r genome.fa \
      -x genome.index \
      -1 scatac_1_1_val_1.fq.gz \
      -2 scatac_1_2_val_2.fq.gz \
      -b scatac_1.cellbc.fastq.gz \
      --barcode-whitelist hydrop_atac_1_0_whitelist_wadpt.tsv \
      -o genome.bed \
      -l 2000 --bc-error-threshold 2 --remove-pcr-duplicates --remove-pcr-duplicates-at-cell-level --low-mem --Tn5-shift --BED

  cat <<-END_VERSIONS > versions.yml
  "LUSLAB_CUSTOMSC:CUSTOMSC:CHROMAP_ALIGN":
      chromap: $(chromap --version 2>&1)
  END_VERSIONS

Command exit status:
  2

Command output:
  (empty)

Command error:
  github.com/sylabs/singularity/internal/app/starter.Master.func2()
  RN: Kiinternal/app/starter/master_linux.go:152 +0x3e fp=0xc0001e3f38 sp=0xc0001e3f00 pc=0x73fd8e
  github.com/sylabs/singularity/internal/pkg/util/mainthread.Execute.func1()
        internal/pkg/util/mainthread/mainthread.go:21 +0x2f fp=0xc0001e3f60 sp=0xc0001e3f38 pc=0x73e59f
  main.main()
        cmd/starter/main_linux.go:102 +0x5f fp=0xc0001e3f98 sp=0xc0001e3f60 pc=0x915dff
  runtime.main()
        /camp/apps/eb/software/Go/1.11.4/src/runtime/proc.go:201 +0x207 fp=0xc0001e3fe0 sp=0xc0001e3f98 pc=0x42f8d7
  runtime.goexit()
        /camp/apps/eb/software/Go/1.11.4/src/runtime/asm_amd64.s:1333 +0x1 fp=0xc0001e3fe8 sp=0xc0001e3fe0 pc=0x45b3f1

  goroutine 5 [syscall]:
  os/signal.signal_recv(0xaf0720)
        /camp/apps/eb/software/Go/1.11.4/src/runtime/sigqueue.go:139 +0x9c
  os/signal.loop()
        /camp/apps/eb/software/Go/1.11.4/src/os/signal/signal_unix.go:23 +0x22
  created by os/signal.init.0
        /camp/apps/eb/software/Go/1.11.4/src/os/signal/signal_unix.go:29 +0x41

  goroutine 7 [chan receive]:
  github.com/sylabs/singularity/internal/pkg/util/mainthread.Execute(0xc0002f6950)
        internal/pkg/util/mainthread/mainthread.go:24 +0xb4
  github.com/sylabs/singularity/internal/app/starter.Master(0x7, 0x4, 0x11f2, 0xc00000cb60)
        internal/app/starter/master_linux.go:151 +0x405
  main.startup()
        cmd/starter/main_linux.go:75 +0x4b8
  created by main.main
        cmd/starter/main_linux.go:98 +0x35

  rax    0x0
  rbx    0x0
  rcx    0xffffffffffffffff
  rdx    0x0
  rdi    0x116e
  rsi    0x6
  rbp    0xc0001e3ef0
  rsp    0xc0001e3eb0
  r8     0x0
  r9     0x0
  r10    0x0
  r11    0x206
  r12    0xc
  r13    0xff
  r14    0xae555c
  r15    0x0
  rip    0x472a9b
  rflags 0x206
  cs     0x33
  fs     0x0
  gs     0x0
haowenz commented 2 years ago

From your error message, I do not think this is a Chromap error. It seems that there is something wrong with a package you were using called singularity. And Chromap does not have such dependency. This makes me wonder how you installed Chromap. And can you provide more details about the OS or compiler you were using?

chris-cheshire commented 2 years ago

We are using the tool as part of a Nextflow pipeline. I wrapped the tool in a Docker container

ARG BASE_CONTAINER=nfcore/base:2.1
FROM $BASE_CONTAINER

RUN apt-get update \
 && apt-get install -y --no-install-recommends \
 libz-dev \
 build-essential \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/*

WORKDIR /home
RUN git clone https://github.com/haowenz/chromap.git
WORKDIR /home/chromap
RUN make
ENV PATH /home/chromap:$PATH
WORKDIR /home

When we run the pipeline on the cluster, we use Singularity to run docker containers - which are automatically converted to singularity images. This bug looks like its something to do with how chromap interacts with the singularity container.

chris-cheshire commented 2 years ago

I will investigate on my side as well

chris-cheshire commented 2 years ago

Sorry this is a duplicate of https://github.com/haowenz/chromap/issues/65

I did not see the full error -

Start to map reads.
Parameters: error threshold: 8, min-num-seeds: 2, max-seed-frequency: 500,1000, max-num-best-mappings: 1, max-insert-size: 2000, MAPQ-threshold: 30, min-read-length: 30, bc-error-threshold: 1, bc-probability-threshold: 0.90
Number of threads: 12
Analyze single-cell data.
Will try to remove adapters on 3'.
Will remove PCR duplicates after mapping.
Will remove PCR duplicates at cell level.
Won't allocate multi-mappings after mapping.
Only output unique mappings after mapping.
Only output mappings of which barcodes are in whitelist.
Perform Tn5 shift.
Output mappings in BED/BEDPE format.
Reference file: genome.fa
Index file: genome.index
1th read 1 file: scatac_4_1_val_1.fq.gz
1th read 2 file: scatac_4_2_val_2.fq.gz
1th cell barcode file: scatac_4.cellbc.fastq.gz
Cell barcode whitelist file: hydrop_atac_1_0_whitelist_wadpt.tsv
Output file: genome.bed
Loaded all sequences successfully in 4.36s, number of sequences: 195, number of bases: 3099922541.
Kmer size: 17, window size: 7.
Lookup table size: 393150044, occurrence table size: 444597151.
Loaded index successfully in 5.04s.
chromap: src/chromap.cc:4804: void chromap::Chromap<MappingRecord>::LoadBarcodeWhitelist() [with MappingRecord = chromap::PairedEndMappingWithBarcode]: Assertion `khash_return_code != -1 && khash_return_code != 0' failed.
/camp/lab/luscomben/home/users/cheshic/projects/2022_01_scatac_pilot_1/test_pipeline/work/7e/ddcc799a9b5c34911baf168d49dd1b/.command.sh: line 11: 14097 Aborted                 chromap -t 12 -r genome.fa -x genome.index -1 scatac_4_1_val_1.fq.gz -2 scatac_4_2_val_2.fq.gz -b scatac_4.cellbc.fastq.gz --barcode-whitelist hydrop_atac_1_0_whitelist_wadpt.tsv -o genome.bed --preset atac
SIGABRT: abort
PC=0x472a9b m=0 sigcode=0
haowenz commented 2 years ago

Good to know. I will close this issue.