Magdoll / Cogent

Coding Genome Reconstruction using Iso-Seq data
BSD 3-Clause Clear License
60 stars 17 forks source link

Segfault when running tutorial data #59

Closed monicabritton closed 4 years ago

monicabritton commented 5 years ago

I installed Cogent, dependencies, etc. When I run the unittest and test script, they run to completion ("OK" at the end), but I do get this warning several times:

/home/mbritton/.conda/envs/anaCogent/lib/python2.7/site-packages/Bio/Seq.py:407: BiopythonDeprecationWarning: This method is obsolete; please use str(my_seq) instead of my_seq.tostring(). BiopythonDeprecationWarning)

When I run the tutorial (test_human), the first step (run_mash.py) runs fine and produces non-empty output files, but the second step (process_kmer_to_graph.py) runs a few seconds, then ends with a Segmentation fault. There are no other error messages.

FYI, my $PYTHONPATH is /home/mbritton/.local/lib/python2.7/site-packages:/share/biocore/mbritton/software/Cogent/Complete-Striped-Smith-Waterman-Library/src:/software/anaconda2/5.0.1/lssc0-linux/lib/python2.7/site-packages

I get the segfault with my own isoseq hq.fasta too. Any suggestions?

Thanks!

Magdoll commented 5 years ago

Hi, I cannot produce the error (which is probably not surprising...). I don't really have a good suggestion besides trying a clean install :(

--Liz

monicabritton commented 5 years ago

I wiped everything (conda, git repos, etc.) and re-installed from scratch. During the installation there were some warnings about "Using deprecated NumPy API". However, now the unittest fails, right after another Deprecation Warning (see below). I'm guessing I have mis-matched versions of something, but am not sure what. Any suggestions?

python setup.py test running test Searching for bx-python==0.7.3 Best match: bx-python 0.7.3 Processing bx_python-0.7.3-py2.7-linux-x86_64.egg

Using /afs/genomecenter.ucdavis.edu/home/mbritton/.conda/envs/anaCogent/lib/python2.7/site-packages/bx_python-0.7.3-py2.7-linux-x86_64.egg running egg_info writing requirements to Cogent.egg-info/requires.txt writing Cogent.egg-info/PKG-INFO writing top-level names to Cogent.egg-info/top_level.txt writing dependency_links to Cogent.egg-info/dependency_links.txt reading manifest file 'Cogent.egg-info/SOURCES.txt' writing manifest file 'Cogent.egg-info/SOURCES.txt' running build_ext test_cogent (Cogent.test.test_cogent.TestCogent) ... 2.0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Sketching human_test.fa.0... Writing to human_test.fa.0.s1000k30.msh... human_test.fa.0.s1000k30.msh.human_test.fa.0.s1000k30.msh.dist completed Output written to: /tmp/tmpII4mah/human_test.fa.s1000k30.dist making weight graph from /tmp/tmpII4mah/human_test.fa.s1000k30.dist graph contains 19 nodes, 79 edges performing ncut on graph.... (subgraph) has 10 nodes. ncut down to 1 partitions in 0.174357891083 sec. (subgraph) has 9 nodes. ncut down to 1 partitions in 0.00503993034363 sec. 0 ['PB.58.29', 'PB.58.28', 'PB.58.24', 'PB.58.34', 'PB.58.14', 'PB.58.8', 'PB.58.4', 'PB.58.5', 'PB.58.3', 'PB.58.1'] 2 ['PB.246.8', 'PB.246.2', 'PB.246.41', 'PB.246.6', 'PB.246.4', 'PB.246.5', 'PB.246.15', 'PB.246.17', 'PB.246.18'] 2.12-r827 /afs/genomecenter.ucdavis.edu/home/mbritton/.conda/envs/anaCogent/lib/python2.7/site-packages/Bio/Seq.py:407: BiopythonDeprecationWarning: This method is obsolete; please use str(my_seq) instead of my_seq.tostring(). BiopythonDeprecationWarning) Traceback (most recent call last): File "/home/mbritton/.conda/envs/anaCogent/bin/reconstruct_contig.py", line 4, in import('pkg_resources').run_script('Cogent==3.3', 'reconstruct_contig.py') File "/afs/genomecenter.ucdavis.edu/home/mbritton/.conda/envs/anaCogent/lib/python2.7/site-packages/pkg_resources/init.py", line 661, in run_script self.require(requires)[0].run_script(script_name, ns) File "/afs/genomecenter.ucdavis.edu/home/mbritton/.conda/envs/anaCogent/lib/python2.7/site-packages/pkg_resources/init.py", line 1441, in run_script exec(code, namespace, namespace) File "/afs/genomecenter.ucdavis.edu/home/mbritton/.conda/envs/anaCogent/lib/python2.7/site-packages/Cogent-3.3-py2.7.egg/EGG-INFO/scripts/reconstruct_contig.py", line 337, in main() File "/afs/genomecenter.ucdavis.edu/home/mbritton/.conda/envs/anaCogent/lib/python2.7/site-packages/Cogent-3.3-py2.7.egg/EGG-INFO/scripts/reconstruct_contig.py", line 259, in main run_Cogent_on_input() File "/afs/genomecenter.ucdavis.edu/home/mbritton/.conda/envs/anaCogent/lib/python2.7/site-packages/Cogent-3.3-py2.7.egg/EGG-INFO/scripts/reconstruct_contig.py", line 174, in run_Cogent_on_input homo_nodes = filter(lambda n: G.has_edge(n, n), G.nodes_iter()) AttributeError: 'DiGraph' object has no attribute 'nodes_iter' ERROR

====================================================================== ERROR: test_cogent (Cogent.test.test_cogent.TestCogent)

Traceback (most recent call last): File "/share/biocore/mbritton/software/Cogent/Cogent/test/test_cogent.py", line 43, in test_cogent subprocess.check_call("reconstruct_contig.py .", shell=True) File "/home/mbritton/.conda/envs/anaCogent/lib/python2.7/subprocess.py", line 190, in check_call raise CalledProcessError(retcode, cmd) CalledProcessError: Command 'reconstruct_contig.py .' returned non-zero exit status 1


Ran 1 test in 5.825s

FAILED (errors=1) Test failed: error: Test failed:

Magdoll commented 5 years ago

Hi @monicabritton ,

What version of networkx are you using? The one I have in my conda environment is 2.1.

Can you try to downgrade/upgrade networkx to 2.1 and see if it still fails?

$ conda install networkx=2.1

>>> import networkx
>>> networkx.__version__
'2.1'

--Liz

monicabritton commented 5 years ago

Hi Liz:

The default networkx on our system is 2.0. But, when I first tried to install Cogent, one of the Traceback error messages included:

pkg_resources.ContextualVersionConflict: (networkx 2.0 (/afs/ genomecenter.ucdavis.edu/software/anaconda2/5.0.1/lssc0-linux/lib/python2.7/site-packages), Requirement.parse('networkx==1.10'), set(['Cogent']))

That seemed to indicate networkx 1.10 was a requirement, so I installed it, and made sure that my PYTHONPATH had the location ahead of the default one.

Does that pkg_resources.ContextualVersionConflict error mean something other than a requirement for networkx 1.10?

Thanks,

Monica

Monica Britton Sr. Bioinformatics Analyst Genome Center and Bioinformatics Core Facility University of California, Davis mtbritton@ucdavis.edu

On Wed, Dec 12, 2018 at 10:25 AM Elizabeth Tseng notifications@github.com wrote:

Hi @monicabritton https://github.com/monicabritton ,

What version of networkx are you using? The one I have in my conda environment is 2.1.

Can you try to downgrade/upgrade networkx to 2.1 and see if it still fails?

$ conda install networkx=2.1

import networkx networkx.version '2.1'

--Liz

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Magdoll/Cogent/issues/59#issuecomment-446691832, or mute the thread https://github.com/notifications/unsubscribe-auth/AC2pMeZGudcgO-lNcCukJuK_nD7yib_7ks5u4UougaJpZM4ZJZst .

Magdoll commented 5 years ago

If you are using Conda environment, everything should be controlled/installed via conda. Using PYTHONPATH to point to other versions may cause issues like the one seen here.

Interestingly it looks like I have two networkx in Conda, probably because networkx 1.10 was installed as requirement when I ran Cogent's setup.py.

Using conda list -n <my_env_name I saw this:

networkx                  1.10                      <pip>
networkx                  2.1                      py27_0

I would recommend wiping that PYTHONPATH clean. Maybe remove all networkx instances from conda using conda uninstall and installing networkx again.