Git Product home page Git Product logo

Comments (7)

cjy8709 avatar cjy8709 commented on August 21, 2024 1

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?

from syri.

jordanbemmels avatar jordanbemmels commented on August 21, 2024 1

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.

from syri.

mnshgl0110 avatar mnshgl0110 commented on August 21, 2024

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

from syri.

cjy8709 avatar cjy8709 commented on August 21, 2024

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

from syri.

mnshgl0110 avatar mnshgl0110 commented on August 21, 2024

You can send it to [email protected]

from syri.

jordanbemmels avatar jordanbemmels commented on August 21, 2024

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!

from syri.

mnshgl0110 avatar mnshgl0110 commented on August 21, 2024

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.

from syri.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.