[Bio-Linux] BioLinux 8 question - Adding and removing Paths - Velvet - correction

Zain A Alvi zain.alvi at student.shu.edu
Wed Apr 8 19:42:17 EDT 2015


Hi Tim and Tony,

I hope everything is well. I just had an idea for a temporary solution, would going into root via terminal and then re-downloading and re-compiling velvet with the higher Kmer value in the usr/bin folder.  Do you think that this would make VelvetOptimiser to work properly with the higher compiled Velvet?

But my main question would be, how are we able to keep the older version in usr/bin and force VelvetOptimiser to use the newly compiled version of the software in some other location.

Kind regards,

Zain 


________________________________________
From: Zain A Alvi <zain.alvi at student.shu.edu>
Sent: Wednesday, April 8, 2015 3:56 PM
To: Bio-Linux help and discussion
Subject: Re: [Bio-Linux] BioLinux 8 question - Adding and removing Paths - Velvet - correction

Hi Tim,

Thank you for the great advice. I have been self teaching myself most of the ins and out of Linux/Ubuntu from online tutorials since the days of PS3 had Ubuntu support. I was wondering what books would you recommend?

I have set the following up with the following aliases and environmental variables in ~/.zshrc:

export PATH=/media/biolinux301/ab8abe44-b8f2-417c-81a5-276991c65d74/Velvet_Optimizer/VelvetOptimiser-2.2.5/:$PATH
alias velveth="/media/biolinux301/ab8abe44-b8f2-417c-81a5-276991c65d74/Velvet_Optimizer/VelvetOptimiser-2.2.5/Velvet_Kmer303/velveth_folder/velveth"
alias velvetg="/media/biolinux301/ab8abe44-b8f2-417c-81a5-276991c65d74/Velvet_Optimizer/VelvetOptimiser-2.2.5/Velvet_Kmer303/velvetg_folder/velvetg"

I was following the VelvetOptimiser manual for the ~/.bashrc as an example.

export PATH=$PATH:$HOME/VelvetOptimiser-2.2.4

Source: https://raw.githubusercontent.com/Victorian-Bioinformatics-Consortium/VelvetOptimiser/master/INSTALL and https://raw.githubusercontent.com/Victorian-Bioinformatics-Consortium/VelvetOptimiser/master/README

Anyway, VelvetOptimiser and Velveth/g are able to work independently when trying to access them through the terminal.

Unfortunately, VelvetOptimiser still executes the old built in Velveth (Kmer31 build) instead of referring to the newly compiled Kmer303 velveth version when trying assembly the genome.

Thank you again for all great help.

Kind regards,

Zain


________________________________________
From: Tim Booth <tbooth at ceh.ac.uk>
Sent: Wednesday, April 8, 2015 2:04 PM
To: Bio-Linux help and discussion
Subject: Re: [Bio-Linux] BioLinux 8 question - Adding and removing Paths - Velvet - correction

Hi Zain,

All of the behaviour you are seeing makes sense to me.  You are
suffering from some fundamental misunderstandings about how the shell
handles aliases vs. environment variables and what the permissions
errors actually mean.  No use of sudo will help you in this situation!

We cover most of this in an interactive session when I teach
introductory Linux courses with my colleagues, but unfortunately the
printed notes on the topic in our tutorial are not very good.  Therefore
I'd strongly recommend you get a book on Linux that covers learning the
quirks of the command line and take a little time to work through it.
I'll give some brief pointers below but they probably won't answer all
your questions:

> export PATH=
$PATH:/media/biolinux301/ab8abe44-b8f2-417c-81a5-276991c65d74/Velvet_Optimizer/VelvetOptimiser-2.2.5/

This adds to the end of the path, so it won't override anything already
in the system.  Put the ":$PATH" bit on the end of the line.
See:
http://rute.2038bug.com/node7.html.gz#SECTION007180000000000000000

> If I try % VelvetOptimiser.pl then the output states  fg: no current job

The error relates to the '%' sign, which represents your shell prompt
not a thing for you to type.  See:
http://en.wikibooks.org/wiki/Guide_to_Unix/Explanations/Shell_Prompt#Appearance_of_the_prompt

> I have follow up question in regards to aliases. VelvetOptimiser is
> designed specifically for look for Velveth and Velvetg and run them as
> it goes through each of the kmers. I am worried that it will seek the
> built in/old Velveth/g instead of the new compiled velveth/g.  It
> seeks the name velveth and velvetg respectively when it is executed in
> terminal.

Aliases won't help you here because they only affect commands you type
directly in the interactive shell, so stick to manipulating the PATH
which is an environmental setting and therefore inherited.  See:
https://help.ubuntu.com/community/EnvironmentVariables#Inheritance

> I've added the following alias terms in ~/.zshrc
>
> alias velveth="/media/biolinux301/ab8abe44-b8f2-417c-81a5-276991c65d74/Velvet_Optimizer/VelvetOptimiser-2.2.5/Velvet_Kmer303/velveth_folder"
> alias velvetg="/media/biolinux301/ab8abe44-b8f2-417c-81a5-276991c65d74/Velvet_Optimizer/VelvetOptimiser-2.2.5/Velvet_Kmer303/velvetg_folder"
>
> If I type velveth or velvetg , I would receive an error of you do not have permission, which is strange as I am the administrator. I remember not being root could cause this occur. Could that be the reason here?

Try typing the name of any directory you can think of -
eg: /media/biolinux301
You'll get "permission denied" every time.  Unfortunately there are
various situations where you can trigger a "permission denied" error
when it has nothing to do with the permissions of your user account.

(Tony will undoubtedly point out that BASH returns a better error
message in this specific case.)

Aliases need to refer to the actual binary file, not the directory, but
as I said above they won't help you here.

> Now the strange part, is if I do sudo velveth then enter my password. Terminal will execute the built in/old velvet instead of the new one, which is strange.

It's expected behaviour.  Sudo uses a standard PATH whatever your
current setting is - run "sudo less /etc/sudoers" and look for the
"secure_path" line.
Sudo also resets other settings in your environment, unless you tell it
not too.
But you don't need "sudo" here, as I explained above.

Best,

TIM
_______________________________________________
Bio-Linux mailing list
Bio-Linux at nebclists.nerc.ac.uk
http://nebclists.nerc.ac.uk/mailman/listinfo/bio-linux
_______________________________________________
Bio-Linux mailing list
Bio-Linux at nebclists.nerc.ac.uk
http://nebclists.nerc.ac.uk/mailman/listinfo/bio-linux



More information about the Bio-linux-list mailing list