viernes, 23 de marzo de 2012

The quest to install Biopieces

This is my own experience installing Biopieces on Ubuntu 10.04 Lucid Lynx LTS.

sudo apt-get install subversion
sudo perl -MCPAN -e 'install inline'
sudo perl -MCPAN -e 'install JSON::XS'
sudo apt-get install curl
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
source ~/.rvm/scripts/rvm
rvm install 1.9.3
sudo gem install rubygems-update
cd /var/lib/gems/1.9.1/bin
sudo ./update_rybygems
sudo gem install gnuplot
sudo apt-get install ruby1.9.3-dev
sudo gem install narray
sudo gem install RubyInline
sudo bash biopieces_install....sh

Warnings: blastall, blat, bwa, bowtie, formatdb, gnuplot, idba, mummer, mysql, prodigal, ray, scan_for_matches, usearch, velveth, velvetg, vmatch

Does biopieces deserve its own Linux distribution?

martes, 20 de marzo de 2012

Some notes about profiles, bash and PATH variable Ubuntu 10.04 LTS

It seems there are 4 places one could edit to get PATH updated permanently.

I. /etc/profile

And the directory for scripts:
/etc/profile.d/*.sh

I could add something like: "export PATH=$PATH:/whatever"

in /etc/profile file using, for instance, pico program.


This file should be running all the .sh files in /etc/profile.d/
And it seems that includes /etc/bash.bashrc


II. /etc/bash.bashrc

# System-wide .bashrc file for interactive bash(1) shells.

III. ~/.profile


Lets take a look at the file ~/.profile:


# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

It seems that includes ~/.bashrc
and adds ~/bin if it exists.
But no words about /etc/profile.d

IV. ~/bashrc

# ~/.bashrc: executed by bash(1) for non-login shells.


We can add lines to the end of the file like:

export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/usr/games:$PATH

---------------------------------------------------------------------------------------------------

From bash man page:

"When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists.
After reading that file, it looks for (~/.bash_profile, ~/.bash_login and ~/.profile) in that order, and reads and executes commands from the first one that exists and is readable.
[...]
When an interactive shell that is not a login shell is started, bash reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if these files exist.
[...]








edit .bashrc in your home directory and add the following line:
export PATH=/path/to/dir:$PATH


A path set in .bash_profile will only be set in a bash login shell (bash -l). If you put your path in .profile it will be available to your complete desktop session. That means even metacity will use it.
For example ~/.profile:
if [ -d "$HOME/bin" ] ; then
  PATH="$PATH:$HOME/bin"
fi
Btw, you can check the PATH variable of a process by looking at its environment in/proc/[pid]/environ. (replace [pid] with the number from ps axf)

Further explanations:
http://stefaanlippens.net/bashrc_and_others
http://www.linux-migration.org/ch02s03.html
http://www.admon.org/difference-between-login-shell-and-non-login-shell/
------------------------------------------------------------

So, IMO, I should change /etc files when I have an application installed for all the system. When my application is installed at /home I should instead use the ~/.profile (for login shells) or ~/.bashrc (for non-login shells).

The question then is What the heck are login and non-login shells? As far as I know, a non-login shell is when I open my shell from Ubuntu using the icon in the X-Windows system. But I need more deep on this topic.

Finally, a good patient friend told me to think it this way: what I want to have in my /home in case I am moving to another place? Well, I want to have my clothes, my personal stuff but as I want to save money I want the heating to be central. As everybody in the building needs the heating, I can change the /etc files. As only I want to manage my clothes, photos, etc. this will be on ~/. files. At last, if I want to get everything since I log in, I will change "profile" files. If I just want to use somethings from a bash shell, I change "bashrc" files.

coda: the question that remains for me is Why when I changed the /etc/profile.d/ adding a *.sh file with something like "export PATH=$PATH:/kakakakakakak" didn't seem to work? I will continue researching on this later.

O.,o

lunes, 19 de marzo de 2012

Installing 454 Data Analysis v2.6 on Ubuntu 10.04 LTS


This is a backup text about the problems I had when installing that software, the solution I finally achieved and the opened questions remaining.

- First of all, I tried to execute like this

./setup.sh

with the following result:

export: 9: software/DataAnalysis_2.6_All/setup.sh: bad variable name

- Then, I tried to execute from a copy I burned into a CD. The result was:

i) on the awful white backgrounded installing window:

/sbin/lspci: not found

ii) window with the text

Cannot execute command: type rocks2&gt;&amp;1

- On SeqAnwers it was the solution for me. But as well some strange advices.
First, some people was telling to try:

sudo ln -s /bin/true ~/bin/rocks
sudo ./setup.sh

Since /bin/true returns true, we are cheating the install program. I didn't want to do that and moreover some people was being able to install but getting some errors afterwards.

- Son on SeqAnwers.com I found a solution, altough really long. I actually would like to resolve the errors I am describing above, to get a fast forward install process but... meanwhile:


I am trying the first one.
pico .bashrc

On the pico editor, at the end of the file, type:

"export PATH=$PATH:/opt/454/bin"

Then, create directories:

cd /opt
sudo mkdir 454
sudo mkdir 454/apps
sudo mkdir 454/apps/jre

cd user_directory_at_home/454soft/DataAnalysis_All/packages
cp newbler_CLI-2.6.i686.tgz /opt/454

(Here I had another problem. I first did copy the 64 bits package and I found I could not execute sfffile and similar SFFtools, stil wondering why...)

cp assembly_GUI_2.6.noarch.tgz /opt/454/apps
cp (the same with mapper)
cp (the same with amplicon)

cd opt/454
sudo tar -xzvf newbler...tgz
cd apps
sudo tar -xzvf assembly...tgz
sudo (the same with mapper)
sudo (the same with amplicon)

sudo rm -r .*tgz
cd ..
sudo rm -r .*tgz

ls /opt/454

apps bin config

ls /opt/454/apps

amplicons assembly jre mapper

Now that everything is ready, we have to create the symbolic linnks:
(if you create a link by error, you can erase it with # sudo unlink name_of_link)

cd /opt/454/apps/jre
sudo ln -s /usr/lib/jvm/java-6-openjdk jre1.6.0_13

cd ..
cd assembly/jre
sudo ln -s ../../jre/jre1.6.0_13 jre1.6.0_13
cd ../amplicon/jre
sudo ln (exactly the same)
cd ../mapper/jre
sudo ln (exactly the same)

finally:

cd /opt/454/bin
sudo ln -s ../apps/assembly/bin/gsAssembler gsAssembler
sudo ln -s ../apps/mapper/bin/gsMapper gsMapper
sudo ln -s ../apps/amplicons/bin/gsAmplicon gsAmplicon
sudo ln -s ../apps/amplicons/bin/doAmplicon doAmplicon


TEST! Thank you to WaltL from SeqAnswers.com forum: http://seqanswers.com/forums/showthread.php?t=8944

Finally, I hope to find the anwers to the initial problems, to can get an easier installation.

best wishes!