Tutorial:OrthoMCL installation on Ubuntu Linux
0
9
Entering edit mode
6.9 years ago
vimalkvn ▴ 320

About OrthoMCL

OrthoMCL is a software used for assigning proteomes to ortholog groups.

About this tutorial

These are the steps I followed to install OrthoMCL on an Ubuntu 14.04 Linux server using MySQL as the database system.

Requirements

  1. Ubuntu 14.04 (tested). Might work on other versions.
  2. All these steps are done with an user account with admin privileges (sudo).
  3. Install MySQL database server (This is an OrthoMCL requirement):

      sudo apt install mysql-server
      sudo service mysql start
    

    The install step will prompt for a password for the MySQL administrator.

  4. Install wget and checkinstall. We will use checkinstall to build a debian package (.deb) of OrthoMCL that can be installed, updated or removed easily:

     sudo apt install wget checkinstall
    

Procedure - Install OrthoMCL

Download and uncompress the OrthoMCL archive

wget http://orthomcl.org/common/downloads/software/v2.0/orthomclSoftware-v2.0.9.tar.gz
tar zxvf orthomclSoftware-v2.0.9.tar.gz

Create a Makefile

To create a debian package using checkinstall, an install step is required (ex: make install). The make command requires a Makefile. As OrthoMCL is a PERL package, we can generate a Makefile by first creating a Makefile.PL.

Change directory:

cd orthomclSoftware-v2.0.9

Using a text editor (ex: nano), create a new file with the following content and save it as Makefile.PL:

use ExtUtils::MakeMaker;

WriteMakefile(
NAME       => 'OrthoMCLEngine::Main::Base',
VERSION    => '2.0.9',
PM         => {'lib/perl/OrthoMCLEngine/Main/Base.pm' => '$(INST_LIB)/OrthoMCLEngine/Main/Base.pm'},
EXE_FILES => ['bin/orthomclAdjustFasta',
'bin/orthomclBlastParser',
'bin/orthomclDropSchema',
'bin/orthomclDumpPairsFiles',
'bin/orthomclExtractProteinIdsFromGroupsFile',
'bin/orthomclExtractProteinPairsFromGroupsFile',
'bin/orthomclFilterFasta',
'bin/orthomclInstallSchema',
'bin/orthomclInstallSchema.sql',
'bin/orthomclLoadBlast',
'bin/orthomclLoadBlast.sql',
'bin/orthomclMclToGroups',
'bin/orthomclPairs',
'bin/orthomclReduceFasta',
'bin/orthomclReduceGroups',
'bin/orthomclRemoveIdenticalGroups',
'bin/orthomclSingletons',
'bin/orthomclSortGroupMembersByScore',
'bin/orthomclSortGroupsFile']
);

Create a Debian package using checkinstall

  1. Use PERL to generate a Makefile

     perl Makefile.PL
    
  2. Use the generated Makefile to compile source code:

     make
    
  3. Create a text file called description-pak with a description for the package like the following:

     An algorithm for grouping proteins into ortholog groups based on their sequence similarity
    
  4. Create a directory called doc-pak and copy included documentation.

     mkdir doc-pak
     cp -r doc/OrthoMCLEngine/Main/* doc-pak
    
  5. Run checkinstall to create debian package (note: change email address under maintainer)

     sudo checkinstall --install=no --pkgname orthomcl \
     --pkgversion 2.0.9 --pkgrelease 1 --pkglicense gpl \
     --maintainer "you@email.com" --provides orthomcl \
     --exclude /usr/local/lib/perl/5.18.2/perllocal.pod make install
    

    Press ENTER to build the package.

Install generated package

sudo dpkg -i orthomcl_2.0.9-1_amd64.deb

Create a database, configuration file and install schema

  1. Create the database, the database user and grant this user permissions to use/update the database.

     mysql -u root -p
    
     create database `orthomcl` character set = 'utf8';
    
     create user 'orthomcl'@'localhost' identified by 'your-password-here';
    
     grant SELECT, INSERT, UPDATE, DELETE, CREATE VIEW, CREATE, INDEX, DROP on `orthomcl`.* to `orthomcl`@localhost;
    
     quit
    
  2. For the orthoMclLoadBlast command to work, the local-infile option has to be enabled. Without this option, the command fails with an error - used command is not allowed with this MySQL version. To prevent this, create /etc/mysql/conf.d/client.cnf with the following content (creating this file requires sudo/root privileges):

     [client]
     loose-local-infile=1
    

    Restart MySQL server for the change to take effect:

     sudo service mysql restart
    
  3. Most OrthoMCL commands require a configuration file. We can copy the configuration template that is distributed with the software, make changes according to our configuration (i.e., database name, user, password) and then provide that configuration file to the commands.

    Copy template:

     sudo cp /usr/share/doc/orthomcl/orthomcl.config.template /etc/orthomcl.config
    

    Edit this file using a text editor and update configuration:

      dbConnectString=dbi:mysql:orthomcl:mysql_local_infile=1
      dbLogin=orthomcl
      dbPassword=your-password-here
    
  4. Install schema:

     sudo orthomclInstallSchema /etc/orthomcl.config install_schema.log
    

    This command should complete without any errors.

(Optional) Create an orthomcl group

This step is optional and is not in the official documentation. When multiple users require access to the database, they can be added to an user group. Only members in this group will have read access to /etc/orthomcl.config. Here is an example:

sudo groupadd orthomcl
sudo gpasswd -a vimal orthomcl

Now update permissions on the file /etc/orthomcl.config:

sudo chgrp orthomcl /etc/orthomcl.config
sudo chmod 640 /etc/orthomcl.config

References

The OrthoMCL user guide.

ubuntu orthomcl mysql linux • 12k views
ADD COMMENT
0
Entering edit mode

Thank you for posting this tutorial. However, I am running into an issue I am not able to compile the makefile. I get this error:

make: *** No rule to make target 'Makefile.PL', needed by 'Makefile'.  Stop.

I made the makefile.pl file as per the instructions. Not sure how to debug the Makefile.pl, as the message suggests the Makefile.pl doesn't exist.

ADD REPLY
1
Entering edit mode

Here are some things to check:

  1. Did you save the file as Makefile.PL? (case-sensitive)

  2. When you run perl Makefile.PL, is a Makefile present in the directory?

If so, you only need to run make to compile.

ADD REPLY
0
Entering edit mode

Hello! Thank you for this amazing post!

I did everything you said and It was running well until step 9) orthomclLoadBlast. The code I wrote is:

sudo orthomclLoadBlast /etc/orthomcl.config similarSequences.txt

and I got the following error:

DBD::mysql::st execute failed: Data too long for column 'QUERY_ID' at row 1 at /usr/local/bin/orthomclLoadBlast line 39, <F> line 14.

Could you please help me to find out how to solve this issue? my similarSequences.txt file is 31GB.

In this sense, the blast-all table is about 67 GB, I have another doubt, in which mysql.cnf file I have to set the myisam_max_sort_file? I need to change it from 200 G to 400 GB, but I am not sure where to find the correct mysql.cnf file.

Thank you so much, and I really hope you can help me to find a solution.

ADD REPLY
0
Entering edit mode

Sorry for the delayed response. Your query_id's might be longer than 60 characters which is the limit for that column in the table. The MySQL configuration file is at /etc/mysql/my.cnf on Ubuntu systems. The server configuration should go under [mysqld].

ADD REPLY
0
Entering edit mode

when I create the file /etc/mysql/conf.d/client.cnf (step 2 creating database)on my Ubuntu 16.04 and I add

[client] loose-local-infile=1

I can't save the file, because i have no permission. What can be the cause of this?

ADD REPLY
0
Entering edit mode

Editing this file requires root (sudo) privileges.

I have updated the post to reflect this. Thank you!

ADD REPLY
0
Entering edit mode

I got error in this part:

sudo checkinstall --install=no --pkgname orthomcl \ --pkgversion 2.0.9 --pkgrelease 1 --pkglicense gpl \ --maintainer "you@email.com" --provides orthomcl \ --exclude /usr/local/lib/perl/5.18.2/perllocal.pod \

make install

--> Error: mmbl@mmbl-H97M-D3H:~/orthomclSoftware-v2.0.9$ make install Manifying 1 pod document !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ERROR: Can't create '/usr/local/bin' Do not have write permissions on '/usr/local/bin' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! at -e line 1. Makefile:832: recipe for target 'pure_site_install' failed make: * [pure_site_install] Error 13

ADD REPLY
0
Entering edit mode

That entire command should be on a single line:

sudo checkinstall --install=no --pkgname orthomcl --pkgversion 2.0.9 --pkgrelease 1 --pkglicense gpl --maintainer "you@email.com" --provides orthomcl --exclude /usr/local/lib/perl/5.18.2/perllocal.pod make install

The linebreaks (\) were added for clarity.

ADD REPLY
0
Entering edit mode

Hi,

Thanks for the quick reply. Already did it by adding sudo. Anyway, my orthomcl analysis is running well until in step 9 when we get an error message. Below is the script I used starting in blastall.

  1. Blastall

    $ blastall -p blastp -F 'm S' -v 100000 -b 100000 -z 55 -e 1e-5 -d my_prot_blast_db -i goodProteins.fasta -o out.tab -m 8

  2. orthomclBlastParser

    $ orthomclBlastParser out.tab compliantFasta >> similarSequences.txt

  3. orthomclLoadBlast

    $ orthomclLoadBlast orthomcl.config similarSequences.txt

    Error: DBD::mysql::st execute failed: Data too long for column 'SUBJECT_ID' at row 1567

I don't know how different this error message compared from previous post.

ADD REPLY
0
Entering edit mode

Sorry I wouldn't be of much help with the usage of the software as I've only performed installation for users in the lab.

The SQL error is similar to the one reported earlier by biodianita. From looking at the orthomclLoadBlast script, it appears both the SUBJECT_ID and QUERY_ID have a 60 character limit on length. So you would need to trim your id's to be within this length.

ADD REPLY
0
Entering edit mode

Although I haven't checked my similarSequences.txt yet because I am away as of the moment, but the adjustFasta step in orthomcl should rename identifier into xx|... which is surely <60 characters, right? I am wondering if this has something to do with the strictness of the mysql? Is there a way to get ease of this or to adjust this? You mentioned about the my.cnf and mysqld but i wasnt able to follow what should be done there.

ADD REPLY
0
Entering edit mode

Hi, an error prompt in my in orthomclDumpPairsFiles:

DBD::mysql::st execute failed: Error writing file '/tmp/MYza1d1c' (Errcode: 28 - No space left on device) at /home/.../bin/orthomclDumpPairsFiles line 54, <f> line 14.

Do you have any idea how to solve this? Thanks!

ADD REPLY
0
Entering edit mode

Your hard disk is full. You could try to free some disk space by removing files you don't need or moving input/output files from previous steps. Another possibility is to move the database directory to a new location with free space i.e., a separate disk partition. Here is a tutorial on how to do this:

https://www.digitalocean.com/community/tutorials/how-to-move-a-mysql-data-directory-to-a-new-location-on-ubuntu-16-04

If you are not using Ubuntu 16.04, then please try searching for tutorials/documentation for the distribution you are using as there could be minor differences.

ADD REPLY
0
Entering edit mode

Thanks for the link that provides a stepwise process for moving db with enough space. Apparently, I think the problem is that my disk is full in general. However, i cant delete programs or files as of the moment. I resolved with using other pc to complete the last remaining processes which i am sure has enough space. My orthomcl installation is fine until in last step ("sudo orthomclInstallSchema /etc/orthomcl.config install_schema.log"):

Can't locate DBD/mysql.pm in @INC (you may need to install the DBD::mysql module) (@INC contains: /usr/local/bin/../lib/perl /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/local/share/perl/5.22.1/OrthoMCLEngine/Main/Base.pm line 51, <f> line 14

It first asked me with DBI. I think I successfully installed it; now it is asking with DBD::mysql module, i wonder if you have any idea how to install. Thanks for the help, really!

ADD REPLY
0
Entering edit mode

Hi,

Can you complete the steps after Install schema?

ADD REPLY
0
Entering edit mode

Hiii.......

I've got the following error while installing the "sudo orthomclInstallSchema /etc/orthomcl.config install_schema.log" command.Could you please help me to find out how to solve this error? Thank you..

Can't connect to data source 'dbConnectString=dbi:mysql:orthomcl:mysql_local_infile=1' because I can't work out what driver to use (it doesn't seem to contain a 'dbi:driver:' prefix and the DBI_DRIVER env var is not set) at /usr/local/share/perl/5.18.2/OrthoMCLEngine/Main/Base.pm line 56.

ADD REPLY
0
Entering edit mode

There needs to be a dbVendor=mysql setting in addition to the dbConnectString=... in the config file. If you had created the configuration file by copying the orthomcl.config.template, this should already be present.

ADD REPLY
0
Entering edit mode

Hii... Solved the above issue.But, still got error with the same command.. Thankyou.

DBI connect('orthomcl:mysql_local_infile=1','orthomcl',...) failed: Access denied for user 'orthomcl'@'localhost' (using password: YES) at /usr/local/share/perl/5.18.2/OrthoMCLEngine/Main/Base.pm line 56.

ADD REPLY
0
Entering edit mode

Did you use the same password in the config file i.e., the password used while creating the orthomcl user? If it still doesn't work, please post your complete orthomcl.config file. You can remove the password setting.

ADD REPLY
0
Entering edit mode

Thank you for your kind concern.. I've checked my config file and made changes in dblogin ("dbLogin=orthomcl" to "dbLogin=root") instead of password .After that it worked properly. But i'm still confused about the dbLogin ! I didn't mention dblogin as root anywhere..! I am really new to this so I am sorry if im asking to many questions.

ADD REPLY
0
Entering edit mode

Thank you very much for posting this. I got a problem in creating the configuration file. While trying to add the content it says me: * (gedit:8323): WARNING *: Set document metadata failed: Setting attribute metadata::gedit-encoding not supported

Can you help me with this problem?

Thank you !!

ADD REPLY
0
Entering edit mode

You are probably trying to open gedit from the terminal using sudo/root. You could use a command line text editor like nano. Alternatively, you can try creating the configuration file with your regular user account and then copy it over to the final location using sudo

ADD REPLY
0
Entering edit mode

Hey Vimalkumar,

Do you know by chance why when I do the "sudo service mysql start" it does not prompt asking for a password for MySQL administrator anymore? Will that have an effect to the entire intallation process?

ADD REPLY
0
Entering edit mode

Hello! After following this tutorial, I am getting an error on step #8 of orthoMCL trying to use orthomclBlastParser. The error I am getting is:

DBD::mysql::st execute failed: Loading local data is disabled; this must be enabled on both the client and server sides at ../../bin/orthomclLoadBlast line 39, <F> line 12.

I have made sure that my orthomcl.config file contains dbConnectString=dbi:mysql:orthomcl:mysql_local_infile=1, but I am not sure what else I can do to fix this error.

Any advice? Thank you!

ADD REPLY
0
Entering edit mode

This looks like a local MySQL config error. Are you able to make changes to that config?

ADD REPLY
0
Entering edit mode

Hello! Yes, I am able to make changes to that orthomcl.config file. Is there a fix you would suggest?

ADD REPLY
0
Entering edit mode

Hi, Could you check if the file /etc/mysql/conf.d/client.cnf exists with the following contents? (Step 2 in 'Create database …' above)

 [client]
 loose-local-infile=1

You will also need to restart mysql for this change to take effect.

ADD REPLY
0
Entering edit mode

Thanks for your response! Yes, this file exists at /orthomclSoftware-v2.0.9/etc/mysql/conf.d/client.cnf.

ADD REPLY
0
Entering edit mode

Does it have the line Vimal shows in example above? If not add that line and then restart mysql.

ADD REPLY
0
Entering edit mode

It has to be in /etc and not orthomclSoftware-v2.0.9/etc for MySQL to read that setting.

Here is how you can create this:

sudo nano /etc/mysql/conf.d/client.cnf

Paste the contents:

 [client]
 loose-local-infile=1

Save the file using CTRL+X.

ADD REPLY
0
Entering edit mode

Thank you! Yes, I think this was the problem. I appreciate you taking the time to respond!

ADD REPLY

Login before adding your answer.

Traffic: 2737 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6