PoonLab / covizu

Rapid analysis and visualization of coronavirus genome variation
https://filogeneti.ca/CoVizu/
MIT License
46 stars 20 forks source link

Issues installing development environment #406

Closed ArtPoon closed 2 years ago

ArtPoon commented 2 years ago

@SyouTono242 to document

SyouTono242 commented 2 years ago

I had the following problems installing CoVizu by cloning the repository:

I followed the steps listed in INSTALL.md:

git clone https://github.com/PoonLab/covizu
git submodule init
git submodule update
sudo python3 setup.py install

Then I downloaded dbstats.json and added it into the /data folder, so now there are these files

covizu:~$ ls data 
clusters.json       dbstats.json        timetree.nwk
countries.json      mut_annotations.json

However when I try to run the server, I'm still getting this error message:

covizu:~$ bash run-server.sh

> covizu@1.0.0 start
> node server.js

/CoVizu/covizu/server/parseCluster.js:370
    tips[root_idx].max_ndiffs = tip_stats.max_ndiffs;
                                          ^

TypeError: Cannot read property 'max_ndiffs' of undefined
    at map_clusters_to_tips (/CoVizu/covizu/server/parseCluster.js:370:43)
    at Object.<anonymous> (/CoVizu/covizu/server.js:31:14)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
    at internal/main/run_main_module.js:17:11
GopiGugan commented 2 years ago

@SyouTono242 I was not able to reproduce this in the dev branch.

Can you try downloading clusters.json, dbstats.json and timetree.nwk again and replace the files in your /data directory?

SyouTono242 commented 2 years ago

@GopiGugan Thanks for the help!

Downloading them does seem to fix the TypeError problem. I now have

data:~$ ls -l
total 394696
-rw-------@ 1 shaoyiran  staff  200942036 14 Jun 00:51 clusters.json
-rw-------@ 1 shaoyiran  staff       7381  7 Jun 00:02 countries.json
-rw-------@ 1 shaoyiran  staff     985136 14 Jun 00:52 dbstats.json
-rw-------@ 1 shaoyiran  staff      98899  7 Jun 00:02 mut_annotations.json
-rw-------@ 1 shaoyiran  staff      39157 14 Jun 00:52 timetree.nwk

However I'm not 100% sure whether the server is running right and/or how I can open the local website. bash run-server.sh and npm start are both giving me this:

covizu:~$ bash run-server.sh

> covizu@1.0.0 start
> node server.js

but http://localhost:8001/ is just showing me a ERR_CONNECTION_REFUSED error. Is that an intended behaviour? Am I missing anything from the instructions?


Edit: Nevermind! It seems like it's just taking a long long time to respond. I did got a FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory error once, but increasing Node's max heap size to a minimum of 7 GB with export NODE_OPTIONS="--max-old-space-size=7168" fixes the problem. The website is now running on my localhost:8001 just fine! Maybe it would be something you want to mention in a document...?

Thanks for all the help!