Question: samtools-1.2 re-header command on ubuntu 14.04.3
0
gravatar for bioguy24
3.6 years ago by
bioguy24180
Chicago
bioguy24180 wrote:

Why does samtools need to be in /usr/bin when it is in a directory (samtools-1.2) downloaded from github, unzipped, and make was run?

 

samtools view -H /media/cmccabe/C2F8EFBFF8EFAFB9/LCH pool I 090215/IonXpress_008_150902.bam | sed '/^@PG/d' | samtools reheader - /media/cmccabe/C2F8EFBFF8EFAFB9/LCH pool I 090215/IonXpress_008_150902.bam > /home/cmccabe/Desktop/ngs_analysis/pool1/IonXpress_008_150902_newheader.bam

 

I added the below to path:

echo 'export PATH=$PATH:/home/cmccabe/Desktop/ngs_analysis/samtools-1.2' >> ~/.bashrc

Thank you :).

samtools • 1.4k views
ADD COMMENTlink modified 3.6 years ago • written 3.6 years ago by bioguy24180

you set, the PATH, now bash can find samtools. So, what is the question ?

ADD REPLYlink written 3.6 years ago by Pierre Lindenbaum119k

With that PATH bash can not find samtools but I am not sure why.  I have also tried changing the path as listed below. Thank you :).

ADD REPLYlink written 3.6 years ago by bioguy24180
2
gravatar for RamRS
3.6 years ago by
RamRS21k
Houston, TX
RamRS21k wrote:

Who says it needs to be in /usr/bin?

If you have a version in there, and you need the one in a different directory to be used as the default when you use samtools in the command line, ensure the correct binary is seen in the PATH variable first. Use PATH=/custom/directory:$PATH rather than PATH=$PATH:/custom/directory

ADD COMMENTlink written 3.6 years ago by RamRS21k

Is the below correct:

PATH=/home/cmccabe/Desktop/ngs_analysis/samtools-1.2:$PATH
>> ~/.bashrc

 

Thank you :).

ADD REPLYlink written 3.6 years ago by bioguy24180

I used the below to add to PATH:

echo 'export PATH=PATH=/home/cmccabe/Desktop/ngs_analysis/samtools-1.2:$PATH >> ~/.bashrc

and then used the command

cmccabe@HP-Z640-Workstation:~$ cd "/home/cmccabe/Desktop/ngs_analysis"
cmccabe@HP-Z640-Workstation:~/Desktop/ngs_analysis$ samtools view -H /media/cmccabe/C2F8EFBFF8EFAFB9/pool_I_090215/IonXpress_008_150902.bam | sed '/^@PG/d' | samtools reheader - /media/cmccabe/C2F8EFBFF8EFAFB9/pool_I_090215/IonXpress_008_150902.bam > /home/cmccabe/Desktop/ngs_analysis/IonXpress_008_150902_newheader.bam
The program 'samtools' is currently not installed. You can install it by typing:
The program 'samtools' is currently not installed. You can install it by typing:
sudo apt-get install samtools
sudo apt-get install samtools

what am  I doing wrong?  Thank you :).

ADD REPLYlink written 3.6 years ago by bioguy24180

What is the output of:

find /home/cmccabe/Desktop/ngs_analysis/samtools-1.2/ -f 'samtools' | xargs ls -l
ADD REPLYlink written 3.6 years ago by RamRS21k

I recently re-installed `ubuntu` and added to path:

cmccabe@HPZ640:~$ echo $PATH
/home/cmccabe/Desktop/ngs_analysis/samtools-1.2/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
cmccabe@HPZ640:~$ cd "/home/cmccabe/Desktop/NGS"
cmccabe@HPZ640:~/Desktop/NGS$ samtools view -H /media/cmccabe/C2F8EFBFF8EFAFB9/pool_I_090215/IonXpress_008_150902.bam | sed '/^@PG/d' | samtools reheader - /media/cmccabe/C2F8EFBFF8EFAFB9/pool_I_090215/IonXpress_008_150902.bam > /home/cmccabe/Desktop/NGS/pool_I_090215/IonXpress_008_150902_newheader.bam
The program 'samtools' is currently not installed. You can install it by typing:
The program 'samtools' is currently not installed. You can install it by typing:
sudo apt-get install samtools
sudo apt-get install samtools

What am I doing wrong?  Thank you :).

cmccabe@HPZ640:~/Desktop/NGS$ find /home/cmccabe/Desktop/ngs_analysis/samtools-1.2/ -f 'samtools' | xargs ls -l
find: unknown predicate `-f'
total 40
drwx------  2 cmccabe cmccabe 4096 Sep 11 09:44 bed
drwx------  3 cmccabe cmccabe 4096 Sep  1 12:12 bedops-2.14.4
drwx------ 11 cmccabe cmccabe 4096 Sep  1 11:31 bedtools2-24.0
drwx------  7 cmccabe cmccabe 4096 Sep  2 16:38 bowtie2-26.0
drwx------  3 cmccabe cmccabe 4096 Dec 28  2014 bwa-0.7.12
drwx------  3 cmccabe cmccabe 4096 Sep  2 16:33 GenomeAnalysisTK-3.4-46
drwx------  2 cmccabe cmccabe 4096 Aug 11 16:27 picard-tools-1.138
drwxrwxr-x  2 cmccabe cmccabe 4096 Sep 15 12:39 pool_I_090215
drwx------  7 cmccabe cmccabe 4096 Sep  2 11:56 samtools-1.2
drwx------  5 cmccabe cmccabe 4096 Sep  4 12:28 vcftools-0.14
ADD REPLYlink modified 3.6 years ago by RamRS21k • written 3.6 years ago by bioguy24180

I'm sorry - I messed up the command. Can you try:

find /home/cmccabe/Desktop/ngs_analysis/samtools-1.2/ -name 'samtools' | xargs ls -l
ADD REPLYlink written 3.6 years ago by RamRS21k
1

I was able to get it working, thanks for your help :).

ADD REPLYlink written 3.6 years ago by bioguy24180

You're very welcome :)

ADD REPLYlink written 3.6 years ago by RamRS21k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1052 users visited in the last hour