Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

output tsv from show-coords not working on syri #9

Closed
jychoilab opened this issue Apr 30, 2019 · 7 comments
Closed

output tsv from show-coords not working on syri #9

jychoilab opened this issue Apr 30, 2019 · 7 comments
Assignees

Comments

@jychoilab
Copy link

Hi

I'm getting an error I'm not sure how to deal with. I got the tsv output with the command

show-coords -THrd OsatJ-OsatB_bas.c500.b500.l50.deltafilter_m_i90_l100.delta > OsatJ-OsatB_bas.c500.b500.l50.deltafilter_m_i90_l100.coords

and used that output for syri but get the below error.

`
syri — WARNING — starting
/home/jyc387/PROGRAMS_AND_SCRIPTS/PROGRAMS/syri/syri/bin/syri:106: FutureWarning: read_table is deprecated, use read_csv instead, passing sep='\t'.
chrlink = startSyri(args)
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/jyc387/miniconda2/envs/py3/lib/python3.6/multiprocessing/pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "/home/jyc387/miniconda2/envs/py3/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "syri/pyxFiles/synsearchFunctions.pyx", line 208, in syri.pyxFiles.synsearchFunctions.syri
TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('<U21') dtype('<U21') dtype('<U21')
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/jyc387/PROGRAMS_AND_SCRIPTS/PROGRAMS/syri/syri/bin/syri", line 106, in
chrlink = startSyri(args)
File "syri/pyxFiles/synsearchFunctions.pyx", line 193, in syri.pyxFiles.synsearchFunctions.startSyri
File "syri/pyxFiles/synsearchFunctions.pyx", line 194, in syri.pyxFiles.synsearchFunctions.startSyri
File "/home/jyc387/miniconda2/envs/py3/lib/python3.6/multiprocessing/pool.py", line 288, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/home/jyc387/miniconda2/envs/py3/lib/python3.6/multiprocessing/pool.py", line 670, in get
raise self._value
TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('<U21') dtype('<U21') dtype('<U21')`

@mnshgl0110 mnshgl0110 self-assigned this Apr 30, 2019
@mnshgl0110
Copy link
Member

Would it be possible for you to share the input file? Otherwise, it is very difficult to know what caused this.

@jychoilab
Copy link
Author

Yup I can share the file.
Is there an email I can send? I'll send the delta and coords file.

@mnshgl0110
Copy link
Member

You can send it to goel@mpipz.mpg.de

@jordanbemmels
Copy link

Hi, what was the solution to this issue? I'm having a similar problem. I got .tsv output from a nucmer alignment using show-coords, and am now trying to use the .coords file with the chroder script:

python /home/0_PROGRAMS/syri/syri/bin/chroder -o test -noref AlderWillowOut_m_i90_l100.coords GCA_003031625.1_ASM303162v1_genomic.fna EMAL_JTW1653__DATE__800mill.fasta

I assume from the manual that the argument for chroder ("Alignment coordinates in a tsv format") was supposed to refer to the .coords file. (Is that correct?). However, when I run the above command I get the following error:

"
Traceback (most recent call last):
File "/home/0_PROGRAMS/miniconda3/envs/SyRI_env/lib/python3.8/site-packages/pandas/core/ops/array_ops.py", line 149, in na_arithmetic_op
result = expressions.evaluate(op, str_rep, left, right)
File "/home/0_PROGRAMS/miniconda3/envs/SyRI_env/lib/python3.8/site-packages/pandas/core/computation/expressions.py", line 208, in evaluate
return _evaluate(op, op_str, a, b)
File "/home/0_PROGRAMS/miniconda3/envs/SyRI_env/lib/python3.8/site-packages/pandas/core/computation/expressions.py", line 70, in _evaluate_standard
return op(a, b)
File "/home/0_PROGRAMS/miniconda3/envs/SyRI_env/lib/python3.8/site-packages/pandas/core/ops/roperator.py", line 9, in radd
return right + left
numpy.core._exceptions.UFuncTypeError: ufunc 'add' did not contain a loop with signature matching types (dtype('<U21'), dtype('<U21')) -> dtype('<U21')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/0_PROGRAMS/syri/syri/bin/chroder", line 732, in
scaf(args)
File "/home/0_PROGRAMS/syri/syri/bin/chroder", line 266, in scaf
coords.bChr = "qry"+coords.bChr
File "/home/0_PROGRAMS/miniconda3/envs/SyRI_env/lib/python3.8/site-packages/pandas/core/ops/common.py", line 64, in new_method
return method(self, other)
File "/home/0_PROGRAMS/miniconda3/envs/SyRI_env/lib/python3.8/site-packages/pandas/core/ops/init.py", line 500, in wrapper
result = arithmetic_op(lvalues, rvalues, op, str_rep)
File "/home/0_PROGRAMS/miniconda3/envs/SyRI_env/lib/python3.8/site-packages/pandas/core/ops/array_ops.py", line 197, in arithmetic_op
res_values = na_arithmetic_op(lvalues, rvalues, op, str_rep)
File "/home/0_PROGRAMS/miniconda3/envs/SyRI_env/lib/python3.8/site-packages/pandas/core/ops/array_ops.py", line 151, in na_arithmetic_op
result = masked_arith_op(left, right, op)
File "/home/0_PROGRAMS/miniconda3/envs/SyRI_env/lib/python3.8/site-packages/pandas/core/ops/array_ops.py", line 112, in masked_arith_op
result[mask] = op(xrav[mask], y)
File "/home/0_PROGRAMS/miniconda3/envs/SyRI_env/lib/python3.8/site-packages/pandas/core/ops/roperator.py", line 9, in radd
return right + left
numpy.core._exceptions.UFuncTypeError: ufunc 'add' did not contain a loop with signature matching types (dtype('<U21'), dtype('<U21')) -> dtype('<U21')
"

Thanks for the help!

@mnshgl0110 mnshgl0110 reopened this Feb 11, 2020
@mnshgl0110
Copy link
Member

I cannot remember what actually solved that issue, but I would guess it was due to incompatible Python version. Please try with python3.5, I think that would fix it.

@jychoilab
Copy link
Author

Wow this was a while ago but it might also have to do with the chromosome name as well?

This was from part of the email we exchanged last year

Currently, the chromosome ids are numeric but the program expects
strings. Consequently, it is giving an error. You can solve this easily
by adding 'chr' to chromosome ids (so, chromosome '1' would become
'chr1', chromosome '2' would become 'chr2' and so on).

Unless this was fixed in later version?

@jordanbemmels
Copy link

jordanbemmels commented Feb 13, 2020

Thanks @mnshgl0110 and @cjy8709 for the suggestions! I've gotten chroder to work now without the error. Changing to python3.5 alone had no effect (same error), but indeed one of my assemblies had numeric scaffold ids. When I changed these to character strings, the error disappeared. Thanks!

I'm going to document what I did below in case anyone else has the same problem and finds it useful.

  1. Changing to python 3.5. I set up a miniconda environment for python 3.5.5 (on a Linux system). In addition, I had to make sure the following packages were correctly installed for python 3.5.5 in this environment in order to install/run syri and chroder: numpy, scipy (not sure if it was necessary), cython, biopython, python-igraph, psutil, pandas.

That alone didn't work, but I mentioned it as I continued using this python environment when implementing step 2 below.

  1. Changing scaffold names to character strings. One of my scaffold-level assemblies had numeric scaffold names. For example, the first lines might look like:

>14 edges=1 [...]
ACTG[...]
...

And it should be changed to:

>scaffold14 edges=1 [...]
ACTG[...]
...

I added "scaffold" to the beginning of the scaffold names (e.g., "14" > "scaffold14") using sed:

sed 's/>\(.*\)/>scaffold\1/' input.fasta > output.fasta

Then, using this new modified fasta, I re-aligned my two assemblies with nucmer and used the .coords file output from nucmer as input into chroder. Now chroder worked for me with no errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants