Installation help needed - goal: Reactome Pengine - intermediate goal: SWI-Prolog, Pengines,SWISH

88 views
Skip to first unread message

Eric T

unread,
Jul 13, 2018, 7:58:13 AM7/13/18
to swi-p...@googlegroups.com
I am working to get Reactome Pengine (paper) (SWISH demo) (Reactome) (GitHub) (Reactome Pengine API) running locally on my Windows 10 laptop. I can get SWI-Prolog installed and working. Trying to install and get both Pengines (SWI-Prolog) (GitHub) and SWISH (GitHub) is not working. I can make it part of the way through the install steps but then the instructions have me totally confused, e.g. make bower-zip

Note: I am aware of the Docker images, but while Docker does run on my machine and while Pengines on Docker does run, I can not connect to it via a browser. Also my goal after getting Reactome Pengine running is see if I can bring in the database locally, so in the end using Docker is just a step in the wrong direction that would have to be undone latter.

Note: To get Linux code running on Windows 10 I will not be using Docker or a VM such as VM-Ware, but WSL (Windows Subsystem for Linux).

I am able to install SWI-Prolog (stable version) on WSL (Ubuntu) via building from source code and it does work, so first step successfully completed.

The current questions I have are

1. Based on the SWISH documentation the version of SWI-Prolog to be used is the development version (swipl-devel) and not the stable version (swipl). Which one should be used?

2. It seems that Pengines and SWISH build instructions imply, e.g. sudo, that it should be done on a Linux system, e.g. Ubuntu, and that trying to build on Windows hasn't been tried and is not recommended. Is this a true statement? 

3. It seems that Pengines and SWISH are not installed as packages and must be installed by building from source and thus SWI-Prolog must be installed by building from source so the necessary files are present when building Pengines and SWISH. Is this a true statement?

4. After SWI-Prolog is installed and running which should be added next: Pengines or SWISH?
e.g. Install Pengines then SWISH, or install SWISH then Pengines.

5. Are there more detailed instructions online for how to do this for Pengines and/or SWISH other than those on GitHub? 

I know I will have more questions after this, but no sense is asking a parade of questions when these few will cut out others and get me started.

Thanks

Jan Wielemaker

unread,
Jul 14, 2018, 7:07:27 AM7/14/18
to Eric T, SWI-Prolog
On 13/07/18 13:58, Eric T wrote:
> I am working to get Reactome Pengine (paper
> <https://academic.oup.com/bioinformatics/advance-article/doi/10.1093/bioinformatics/bty181/4956665>)
> (SWISH demo
> <https://swish.swi-prolog.org/?code=https://raw.githubusercontent.com/samwalrus/reactome_notebook/master/reactome_pengine.swinb>)
> (Reactome <https://reactome.org/>) running locally on my Windows 10
> laptop. I can get SWI-Prolog <http://www.swi-prolog.org/> installed and
> working. Trying to install and get both Pengines (SWI-Prolog
> <http://www.swi-prolog.org/pldoc/doc_for?object=section%28%27packages/pengines.html%27%29>)
> (GitHub <https://github.com/SWI-Prolog/packages-pengines>) and SWISH
> (GitHub <https://github.com/SWI-Prolog/swish>) is not working. I can
> make it part of the way through the install steps but then the
> instructions have me totally confused
> <https://github.com/SWI-Prolog/swish#download-as-zip>, e.g. make bower-zip

I think you should aim at SWISH. Core Pengines are part of the
SWI-Prolog releases. You should get the basics running by

- Install SWI-Prolog 7.7.x (currently .18) for Windows
- Clone the swish repo (or download the zip and unpack it)
- Download the bower dependencies from
http://www.swi-prolog.org/download/swish/swish-bower-components.zip
and unpack it such that it creates web/bower_components in the
unpacked SWISH repo.

Double-click 'run.pl' should make it run. The big problem will be
the R connection. I'm not saying it cannot be done, but that is
likely to get a lot of work without Linux. Possibly the WSL subsystem
will do that.

See also below


>
> Note: I am aware of the Docker images, but while Docker does run on my
> machine and while Pengines on Docker does run, I can not connect to it
> via a browser. Also my goal after getting Reactome Pengine running is
> see if I can bring in the database <https://reactome.org/download-data>
> locally, so in the end using Docker is just a step in the wrong
> direction that would have to be undone latter.
> **//___^
> Note: To get Linux code running on Windows 10 I will not be using Docker
> <https://www.docker.com/> or a VM
> <https://en.wikipedia.org/wiki/Virtual_machine#Full_virtualization> such
> as VM-Ware <https://www.vmware.com/>, but WSL
> <https://docs.microsoft.com/en-us/windows/wsl/about> (Windows Subsystem
> for Linux).
>
> I am able to install <http://www.swi-prolog.org/build/unix.html>
> SWI-Prolog (stable version <https://github.com/SWI-Prolog/swipl>) on WSL
> (Ubuntu
> <https://www.microsoft.com/en-us/p/ubuntu/9nblggh4msv6?activetab=pivot%3aoverviewtab>)
> via building from source code and it does work, so first step
> successfully completed.**//___^
>
> The current questions I have are
>
> 1.Based on the SWISH documentation
> <https://github.com/SWI-Prolog/swish#get-the-latest-swi-prolog> the
> version of SWI-Prolog to be used is the development version (swipl-devel
> <https://github.com/SWI-Prolog/swipl-devel>) and not the stable version
> (swipl <https://github.com/SWI-Prolog/swipl>). Which one should be
> used?**//___^
> **//___^

Get 7.7.18

> 2. It seems that Pengines and SWISH build instructions
> <https://github.com/SWI-Prolog/swish#other-dependencies> imply, e.g.
> sudo <https://linux.die.net/man/8/sudo>, that it should be done on a
> Linux <https://www.linux.org/> system, e.g. Ubuntu
> <https://www.ubuntu.com/>, and that trying to build on Windows
> <https://en.wikipedia.org/wiki/Microsoft_Windows> hasn't been tried and
> is not recommended. Is this a true statement?

You don't need sudo if you do not need admin rights.

> 3.It seems that Pengines and SWISH are not installed as packages and
> must be installed by building from source and thus SWI-Prolog must be
> installed by building from source so the necessary files are present
> when building Pengines and SWISH. Is this a true statement?

You need to use the recommended installation route using the `build`
script. You need most packages. You may skip xpce and jpl to reduce
dependencies. They will be skipped anyway if the dependencies are not
present.

> 4. After SWI-Prolog is installed and running which should be added next:
> Pengines or SWISH?
> e.g. Install Pengines then SWISH, or install SWISH then Pengines.

Pengines is part of the above installation. SWISH is seperate.

> 5. Are there more detailed instructions online for how to do this for
> Pengines and/or SWISH other than those on GitHub?

No. Well, you can look at the docker-swish repo. The Dockerfile
does it all for you.

Cheers --- Jan

> I know I will have more questions after this, but no sense is asking a
> parade of questions when these few will cut out others and get me started.
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swi-prolog+...@googlegroups.com
> <mailto:swi-prolog+...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/swi-prolog.
> For more options, visit https://groups.google.com/d/optout.

Eric T

unread,
Jul 14, 2018, 7:11:10 PM7/14/18
to swi-p...@googlegroups.com

Jan, thanks.

For anyone else who may need the steps/instructions I used. 
Note: This is done using WSL (Windows Subsystem for Linux) but after installing WSL the instructions should work on any current Ubuntu system.
Also note that while Microsoft considers WSL a production ready application, personally I still consider it in beta as it is not fully complaint with Linux and has critical issues that need to be resolved. That doesn't mean I won't use it but that before using it I weigh the pros and cons for each use.

1. Follow the WSL Windows 10 Installation Guide to install WSL on Windows 10 with a 64-bit processor. 

2. Start WSL.
    During the install it will also give you the option to start WSL. When you need to restart WSL, WSL can be started like any other application from the Windows start menu.

3. Update Ubuntu
   ~$ sudo apt-get update

4. These steps might not be necessary because they were work arounds during the earlier parts of the WSL beta phase when I noted them over a year ago and  the issues may be fixed now. I still do them to be on the safe side. 
   ~$ sudo chmod +x /usr/sbin/policy-rc.d
   ~$ sudo dpkg-divert --local --rename --add /sbin/initctl
   ~$ sudo ln -s /bin/true/sbin/initctl
   ~$ sudo rm /etc/hosts
   ~$ exit
    Restart WSL

5. Upgrade Ubuntu
   ~$ sudo apt-get upgrade -y

   ~$ sudo apt-get install \
build-essential autoconf curl chrpath pkg-config \              ncurses-dev libreadline-dev libedit-dev \              libunwind-dev \               libgmp-dev \
             libssl-dev \              unixodbc-dev \              zlib1g-dev libarchive-dev \              libossp-uuid-dev \              libxext-dev libice-dev libjpeg-dev libxinerama-dev libxft-dev \              libxpm-dev libxt-dev \             libdb-dev \
             libpcre3-dev \
             libyaml-dev \              openjdk-8-jdk junit The Prerequisites for Debian based systems also include a section for texlive that is not needed. If you do the texlive section, note that it could take a few hours on WSL as Microsoft is still working of some issues with WSL and disk access speed.
7. Download the SWI-Prolog development source code from the GitHub repository. Based on SWI-Prolog -- Installation on Linux, *BSD ~$ git clone https://github.com/SWI-Prolog/swipl-devel.git 8. Prepare for the build.
~$ cd swipl-devel
   ~/swipl-devel$ ./prepare 9. Make a copy of the build script from the template and run it.
   ~/swipl-devel$ cp -p build.templ build    ~/swipl-devel$ ./build   ~/swipl-devel$ cd ~ 10. Verify SWI-Prolog works and then halt it. ~$ swipl   Welcome to SWI-Prolog (threaded, 64 bits, version 7.7.18-1-g79c96b2) ... ?- halt. 11. Install SWISH less the bower dependencies. ~$ git clone https://github.com/SWI-Prolog/swish.git 12. Install unzip for the next step. ~$ sudo apt install unzip
13. Install bower dependencies needed for SWISH.
~$ cd swish ~/swish$ wget http://www.swi-prolog.org/download/swish/swish-bower-components.zip    ~/swish$ unzip swish-bower-components.zip 14 Start Swish server.    ~/swish$ swipl run.pl % Started server at http://localhost:3050/ 15. Using a Windows 10 browser such as Chrome or Microsoft Edge. Open http://localhost:3050/ At this point you should have SWISH running in your browser.

Sam Neaves

unread,
Jul 16, 2018, 7:07:24 AM7/16/18
to Eric T, SWI-Prolog
Hi Eric,

Thanks for the interest in Reactome Pengine. 

I hope you are getting on okay now. The application is mainly designed to be accessed on the web but if you wish to run a local copy not using the dockerfile you should be able to once you have SWI-Prolog installed by just loading the program from the git hub files and adding the homo_sapiens.owl file from reactome or here (https://drive.google.com/open?id=0BzEymYqJrJmhSWowRmxfMTVhNWc) .

https://github.com/samwalrus/reactome-pengine 

The live version and the version in the paper uses  swipl:7.5.12  which can be seen from the dockerfile.

So this should result in exactly the same behaviour as the published version.

If you have any questions then I am happy to answer,

Thanks

Sam



On Sun, Jul 15, 2018 at 12:11 AM, Eric T <researc...@gmail.com> wrote:

Jan, thanks.

For anyone else who may need the steps/instructions I used. 
Note: This is done using WSL (Windows Subsystem for Linux) but after installing WSL the instructions should work on any current Ubuntu system.

1. Follow the WSL Windows 10 Installation Guide to install WSL on Windows 10 with a 64-bit processor. 
2. Start WSL.
    During the install it will also give you the option to start WSL. When you need to restart WSL, WSL can be started like any other application from the Windows start menu.
3. Update/upgrade Ubuntu with these instructions. Some of these steps might not be necessary because they were work arounds during the beta phase when I noted them over a year ago and may be fixed now. I just do them still to be on the safe side.
   ~$ sudo apt-get update
   ~$ sudo chmod +x /usr/sbin/policy-rc.d
   ~$ sudo dpkg-divert --local --rename --add /sbin/initctl
   ~$ sudo ln -s /bin/true/sbin/initctl
   ~$ sudo rm /etc/hosts
   ~$ exit

    Restart WSL
   ~$ sudo apt-get upgrade -y
   ~$ sudo apt-get install \

        build-essential autoconf curl chrpath pkg-config \
        ncurses-dev libreadline-dev libedit-dev \
        libunwind-dev \
        libgmp-dev \
        libssl-dev \
        unixodbc-dev \
        zlib1g-dev libarchive-dev \
        libossp-uuid-dev \
        libxext-dev libice-dev libjpeg-dev libxinerama-dev libxft-dev \
        libxpm-dev libxt-dev \
        libdb-dev \
        libpcre3-dev \
        libyaml-dev \
        openjdk-8-jdk junit Skip the texlive part as it is not needed. If you do it, note that it could take a few hours on WSL as Microsoft is still working of some issues with WSL and disk access speed. 5. Download the SWI-Prolog development source code from the GitHub repository. Based on SWI-Prolog -- Installation on Linux, *BSD ~$ git clone https://github.com/SWI-Prolog/swipl-devel.git 6. Prepare for the build.
~$ cd swipl-devel
   ~/swipl-devel$ ./prepare 7. Make a copy of the build script from the template and run it.
   ~/swipl-devel$ cp -p build.templ build    ~/swipl-devel$ ./build   ~/swipl-devel$ cd ~ 8. Verify SWI-Prolog works and then halt it. ~$ swipl   Welcome to SWI-Prolog (threaded, 64 bits, version 7.7.18-1-g79c96b2) ... ?- halt. 9. Install SWISH less the bower dependencies. ~$ git clone https://github.com/SWI-Prolog/swish.git 10. Install unzip for the next step. ~$ sudo apt install unzip
11. Install bower dependencies ~$ cd swish ~/swish$ wget http://www.swi-prolog.org/download/swish/swish-bower-components.zip    ~/swish$ unzip swish-bower-components.zip 12. Start Swish server.    ~/swish$ swipl run.pl % Started server at http://localhost:3050/ 13. Using a Windows 10 browser such as Chrome or Microsoft Edge. Open http://localhost:3050/ At this point you should have SWISH running in your browser.

--
You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+unsubscribe@googlegroups.com.

Eric

unread,
Jul 16, 2018, 3:43:15 PM7/16/18
to Sam Neaves, swi-p...@googlegroups.com
Hi Sam,

Thanks. 

Yes I will have some questions because I haven't yet figured out how to get Reactome Pengines running on what I have working so far, but I want to run out more of my options before asking as it helps me learn more when I am not given the answer right away. I can get Reactome Pengines started but I am not getting the SWISH interface. (Don't answer that yet).

Also thanks for including the owl file as it was needed; I did manage to find it earlier from Reactome because of a post to another forum.

Regards,
Eric

Sam Neaves

unread,
Jul 16, 2018, 4:25:46 PM7/16/18
to Eric, SWI-Prolog
Hi Eric,

FYI: Reactome Pengine does not have it's own SWISH interface, the demo uses https://swish.swi-prolog.org
It just loads a notebook from github https://swish.swi-prolog.org/?code=https://raw.githubusercontent.com/samwalrus/reactome_notebook/master/reactome_pengine.swinb

The notebook then connects to reactome pengine like so:

:-use_module(library(pengines)).
rdf(X,Y,Z):-
    reactome_server(S),
    pengine_rpc(S,rdf(X,Y,Z),[]).

This code would work on you any local prolog installation as well you do not need to have a local copy of reactome pengine. 

Thanks,

Sam
Reply all
Reply to author
Forward
0 new messages