How to fix "ValueError: not enough values to unpack (expected 3, got 1)" when excuting batch analysis?
2
0
Entering edit mode
3.6 years ago
CNVkit 0.9.7
Detected file format: bed
Splitting large targets
Wrote results/120430_HG19_ExomeV3_UTR_EZ_HX1_primary_annotated.target.bed with 407920 regions
Detected file format: bed
Traceback (most recent call last):
  File "/home/lab/miniconda3/envs/CNVKIT/lib/python3.7/site-packages/skgenome/tabio/util.py", line 9, in wrapper
    return line_parser(line)
  File "/home/lab/miniconda3/envs/CNVKIT/lib/python3.7/site-packages/skgenome/tabio/bedio.py", line 25, in _parse_line
    chrom, start, end = fields[:3]
ValueError: not enough values to unpack (expected 3, got 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/lab/miniconda3/envs/CNVKIT/lib/python3.7/site-packages/skgenome/tabio/__init__.py", line 74, in read
    dframe = reader(infile, **kwargs)
  File "/home/lab/miniconda3/envs/CNVKIT/lib/python3.7/site-packages/skgenome/tabio/bedio.py", line 51, in read_bed
    "end", "gene", "strand"])
  File "/home/lab/miniconda3/envs/CNVKIT/lib/python3.7/site-packages/pandas/core/frame.py", line 1759, in from_records
    values += data
  File "/home/lab/miniconda3/envs/CNVKIT/lib/python3.7/site-packages/skgenome/tabio/util.py", line 11, in wrapper
    raise ValueError("Bad line: %r" % line)
ValueError: Bad line: '\n'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/lab/miniconda3/envs/CNVKIT/bin/cnvkit.py", line 9, in <module>
    args.func(args)
  File "/home/lab/miniconda3/envs/CNVKIT/lib/python3.7/site-packages/cnvlib/commands.py", line 115, in _cmd_batch
    args.count_reads, args.seq_method, args.cluster)
  File "/home/lab/miniconda3/envs/CNVKIT/lib/python3.7/site-packages/cnvlib/batch.py", line 103, in batch_make_reference
    anti_kwargs['access'] = tabio.read_auto(access_bed)
  File "/home/lab/miniconda3/envs/CNVKIT/lib/python3.7/site-packages/skgenome/tabio/__init__.py", line 110, in read_auto
    return read(infile, fmt or 'tab')
  File "/home/lab/miniconda3/envs/CNVKIT/lib/python3.7/site-packages/skgenome/tabio/__init__.py", line 75, in read
    except pd.io.common.EmptyDataError:
AttributeError: module 'pandas.io.common' has no attribute 'EmptyDataError'
batch germline cnv • 5.5k views
ADD COMMENT
1
Entering edit mode

I'm guessing an empty line in a bed (?) file. Try actually explaining what was the input and the error.

ADD REPLY
0
Entering edit mode

After dissecting the process, the errors are related to the "antitarget" command.

ADD REPLY
0
Entering edit mode
3.6 years ago

Answer:

The first two errors are due to an extra empty line at the end of the access-5kb-mappable.hg19.bed. Remove it and no errors anymore.

The third errors are due to scripts, please look for the right one in GitHub. Original: File "/home/lab/miniconda3/envs/CNVKIT/lib/python3.7/site-packages/skgenome/tabio/__init__.py", line 75, in read except pd.io.common.EmptyDataError:

should have been pd.errors.EmptyDataError:

ADD COMMENT
0
Entering edit mode
2.8 years ago
rahul • 0

The error message is fairly self-explanatory. Your program expects python split() to yield 3 elements, but in your case, it is only yielding 1 element. This could be because the data is not in the format you expect, a rogue malformed line, or maybe an empty line - there's no way to know.

To see what line is causing the issue, you could add some debug statements like this:

if len(line.split()) != 3:
    print line
ADD COMMENT

Login before adding your answer.

Traffic: 2468 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6