dereneaton / ipyrad

Interactive assembly and analysis of RAD-seq data sets
http://ipyrad.readthedocs.io
GNU General Public License v3.0
72 stars 41 forks source link

Step 5 ValueError: too many values to unpack (expected 2) #486

Closed malvaceae3 closed 2 years ago

malvaceae3 commented 2 years ago

Hello, I am running ipyrad and I got the error in step5. I really appreciate if you give me some advices.

-------------------------------------------------------------
  ipyrad [v.0.9.84]
  Interactive assembly and analysis of RAD-seq data
 -------------------------------------------------------------
  Parallel connection | nc-0012: 54 cores

  Step 5: Consensus base/allele calling
  Mean error  [0.00065 sd=0.00023]
  Mean hetero [0.00732 sd=0.00125]
  [####################] 100% 0:00:07 | calculating depths
  [####################] 100% 0:00:08 | chunking clusters
  [####################] 100% 0:00:28 | consens calling
Exception in step 5: [101:apply] ValueError: too many values to unpack (expected 2)

  Encountered an Error.
  Message: ValueError: too many values to unpack (expected 2)
  Parallel connection closed.
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
File <string>:1, in <module>

File ~/miniconda3/envs/ipyrad/lib/python3.9/site-packages/ipyrad/assemble/consens_se.py:421, in process_chunks(data, sample, chunkfile, isref)
    419 def process_chunks(data, sample, chunkfile, isref):
    420     proc = Processor(data, sample, chunkfile, isref)
--> 421     proc.run()
    422     return proc.counters, proc.filters

File ~/miniconda3/envs/ipyrad/lib/python3.9/site-packages/ipyrad/assemble/consens_se.py:439, in Processor.run(self)
    438 def run(self):
--> 439     self.process_chunk()
    440     self.write_chunk()

File ~/miniconda3/envs/ipyrad/lib/python3.9/site-packages/ipyrad/assemble/consens_se.py:505, in Processor.process_chunk(self)
    501 done, chunk = clustdealer(pairdealer, 1)
    502 if chunk:
    503
    504     # fills .name and .seqs attributes
--> 505     self.parse_cluster(chunk)
    507     # return 1 if enough reads at this locus position
    508     if self.filter_mindepth():
    509
    510         # return 1 if enough overlapping bases for calls
    511         # and fills .consens and .arrayed attributes

File ~/miniconda3/envs/ipyrad/lib/python3.9/site-packages/ipyrad/assemble/consens_se.py:554, in Processor.parse_cluster(self, chunk)
    551 if self.isref:
    552     # parse position from name string
    553     rname = self.names[0].rsplit(";", 2)[0]
--> 554     chrom, posish = rname.rsplit(":")
    555     pos0, pos1 = posish.split("-")
    556     # drop `tag=ACGTACGT` if 3rad and declone_PCR_duplicates is set

ValueError: too many values to unpack (expected 2)
isaacovercast commented 2 years ago

Without knowing anything else I would guess that you are using a reference sequence and that the reference sequence chrom/contig names have a ':' in at least one (but probably all) of them. Check your reference sequence chrom names and remove any ':' characters.

malvaceae3 commented 2 years ago

My reference sequence contained ':' in contig name. After remove all ':', the error was resolved. Thank you very much!

isaacovercast commented 2 years ago

Great! Glad we figured it out. Thanks for the update.

malvaceae3 commented 2 years ago

Thank you very much for your advice on the error of step 5. I finished step 5, but I got error on step 6. I checked other issues but I cannot solve the error yet. Could you give me some advice when you have some time?

-------------------------------------------------------------
  ipyrad [v.0.9.84]
  Interactive assembly and analysis of RAD-seq data
 -------------------------------------------------------------
  Parallel connection | nc-0012: 47 cores

  Step 6: Clustering/Mapping across samples
  [####################] 100% 0:00:04 | concatenating bams

  Encountered an Error.
  Message: No such engine: 0
  Parallel connection closed.
Traceback (most recent call last):
  File "/home/b/b36412/miniconda3/envs/ipyrad/lib/python3.9/site-packages/ipyrad/core/Parallel.py", line 314, in wrap_run
    self.tool._run(ipyclient=self.ipyclient, **self.rkwargs)
  File "/home/b/b36412/miniconda3/envs/ipyrad/lib/python3.9/site-packages/ipyrad/core/assembly.py", line 696, in _run
    stepdict[step](self, force, ipyclient).run()
  File "/home/b/b36412/miniconda3/envs/ipyrad/lib/python3.9/site-packages/ipyrad/assemble/clustmap_across.py", line 270, in run
    self.remote_build_ref_regions()
  File "/home/b/b36412/miniconda3/envs/ipyrad/lib/python3.9/site-packages/ipyrad/assemble/clustmap_across.py", line 637, in remote_build_ref_regions
    rasync = self.ipyclient[0].apply(build_ref_regions, self.data)
  File "/home/b/b36412/miniconda3/envs/ipyrad/lib/python3.9/site-packages/ipyparallel/client/client.py", line 1337, in __getitem__
    return self.direct_view(key)
  File "/home/b/b36412/miniconda3/envs/ipyrad/lib/python3.9/site-packages/ipyparallel/client/client.py", line 2067, in direct_view
    targets = self._build_targets(targets)[1]
  File "/home/b/b36412/miniconda3/envs/ipyrad/lib/python3.9/site-packages/ipyparallel/client/client.py", line 713, in _build_targets
    raise IndexError("No such engine: %i" % targets)
IndexError: No such engine: 0
isaacovercast commented 2 years ago

can you show me the ipyrad command you are running? Is this running on an hpc system? It looks like the ipcluster instance either isn't running or died somehow. You might try running ipcluster by hand, check the docs here.

malvaceae3 commented 2 years ago

I am sorry for the late reply. Yes, I am running ipyrad on an hpc system and command is: ipyrad -d -p ./params-min4c85_ref.txt -s 7 -c 6

The error probably caused by resource or capacity shortage. After I obtained some capacity, the error was resolved. Thank you very much for your kind help.

isaacovercast commented 2 years ago

Glad it was resolved and thanks for letting us know.