google / deepvariant

DeepVariant is an analysis pipeline that uses a deep neural network to call genetic variants from next-generation DNA sequencing data.
BSD 3-Clause "New" or "Revised" License
3.23k stars 727 forks source link

IndexError when running make_examples #75

Closed Guym142 closed 6 years ago

Guym142 commented 6 years ago

Hi, I'm trying to run make_examples with this data: ftp://ftp-trace.ncbi.nlm.nih.gov/giab/ftp/data/NA12878/NA12878_PacBio_MtSinai/ using chm1.fa as the reference from here: http://hgdownload.cse.ucsc.edu/goldenPath/hg19/bigZips/chromFa.tar.gz

OUTPUT_DIR="output"
mkdir -p "${OUTPUT_DIR}"

BASE="/home/guy/Data/NA12878_PacBio_MtSinai"

REF="${BASE}/chromFa/chr1.fa"

BAM="${BASE}/sorted_final_merged.bam"

MODEL="${MODEL_NAME}/model.ckpt"

python bazel-bin/deepvariant/make_examples \
  --mode calling   \
  --ref "${REF}"   \
  --reads "${BAM}" \
  --regions "chr1:1,000,000-2,000,000" \
  --examples "${OUTPUT_DIR}/examples.tfrecord.gz"

and the error I get:

Traceback (most recent call last):
  File "/home/guy/deepvariant-0.6.1/bazel-bin/deepvariant/make_examples.runfiles/com_google_deepvariant/deepvariant/make_examples.py", line 1118, in <module>
    tf.app.run()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "/home/guy/deepvariant-0.6.1/bazel-bin/deepvariant/make_examples.runfiles/com_google_deepvariant/deepvariant/make_examples.py", line 1108, in main
    make_examples_runner(options)
  File "/home/guy/deepvariant-0.6.1/bazel-bin/deepvariant/make_examples.runfiles/com_google_deepvariant/deepvariant/make_examples.py", line 1037, in make_examples_runner
    candidates, examples, gvcfs = region_processor.process(region)
  File "/home/guy/deepvariant-0.6.1/bazel-bin/deepvariant/make_examples.runfiles/com_google_deepvariant/deepvariant/make_examples.py", line 764, in process
    self.in_memory_sam_reader.replace_reads(self.region_reads(region))
  File "/home/guy/deepvariant-0.6.1/bazel-bin/deepvariant/make_examples.runfiles/com_google_deepvariant/deepvariant/make_examples.py", line 802, in region_reads
    _, reads = self.realigner.realign_reads(reads, region)
  File "/home/guy/deepvariant-0.6.1/bazel-bin/deepvariant/make_examples.runfiles/com_google_deepvariant/deepvariant/realigner/realigner.py", line 460, in realign_reads
    candidate_windows = self.call_window_selector(region, reads)
  File "/home/guy/deepvariant-0.6.1/bazel-bin/deepvariant/make_examples.runfiles/com_google_deepvariant/deepvariant/realigner/realigner.py", line 360, in call_window_selector
    region.start),
  File "/home/guy/deepvariant-0.6.1/bazel-bin/deepvariant/make_examples.runfiles/com_google_deepvariant/deepvariant/realigner/window_selector.py", line 249, in process_reads
    for ref_pos in self.process_read(ref, read, ref_offset):
  File "/home/guy/deepvariant-0.6.1/bazel-bin/deepvariant/make_examples.runfiles/com_google_deepvariant/deepvariant/realigner/window_selector.py", line 162, in process_read
    self._process_soft_clip(cigar, ref, read, ref_pos, read_pos))
  File "/home/guy/deepvariant-0.6.1/bazel-bin/deepvariant/make_examples.runfiles/com_google_deepvariant/deepvariant/realigner/window_selector.py", line 89, in _process_soft_clip
    if read.aligned_quality[read_pos] >= self.config.min_base_quality:
IndexError: list index (0) out of range

Process finished with exit code 1

What might be the cause of the error? Thank you

pichuan commented 6 years ago

Hi, from your log, it seems like this call failed read.aligned_quality[read_pos], which might indicate that read doesn't have a quality score?