SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Install Dindel on Mac yinshe Bioinformatics 8 11-08-2013 10:18 AM
help to install 'FAR - The Flexible Adapter Remover' on Mac OS joseph Bioinformatics 19 01-17-2012 02:46 PM
Staden install on Mac OSX 10.6 andreitudor Bioinformatics 0 04-07-2011 07:29 AM
How to install GAPapiline on MAC zcsbldm Bioinformatics 4 11-03-2009 07:46 PM
How to install tffind in Mac zimu General 0 01-09-2009 04:44 AM

Reply
 
Thread Tools
Old 03-08-2010, 02:37 PM   #1
jlc_1020
Member
 
Location: Massachusetts

Join Date: Mar 2010
Posts: 11
Default Samtools Mac Install

I'm new to Unix and starting in a Bioinformatics Lab

I recently got some .bam files from a collaborator and am trying
to get samtools running on my Macbook Pro.

I downloaded the samtools-0.1.7_i386-darwin.tar.bz2 file from their
site and extracted it to the desktop. So far I've been unsuccessful in
my efforts to get the program running in Terminal from this point.

Can anyone help point me in the right direction?

Thanks
jlc_1020 is offline   Reply With Quote
Old 03-09-2010, 12:48 AM   #2
dawe
Senior Member
 
Location: 4530'25.22"N / 915'53.00"E

Join Date: Apr 2009
Posts: 258
Default

I prefer to compile on my own, nevertheless you should be able to run this

Code:
~/Deskop/samtoolsXXXX/samtools
where samtoolsXXXX is the directory containing the samtools executable...
Can you post the error you get?

d
dawe is offline   Reply With Quote
Old 03-09-2010, 06:59 AM   #3
jlc_1020
Member
 
Location: Massachusetts

Join Date: Mar 2010
Posts: 11
Default

When I enter that code, I get a summary of the program information:

Program: samtools (Tools for alignments in the SAM format)
Version: 0.1.7-6 (r530)

Usage: samtools <command> [options]

Command: view SAM<->BAM conversion
sort sort alignment file
pileup generate pileup output
faidx index/extract FASTA
tview text alignment viewer
index index alignment
fixmate fix mate information
glfview print GLFv3 file
flagstat simple stats
calmd recalculate MD/NM tags and '=' bases
merge merge sorted alignments
rmdup remove PCR duplicates

But when I try to add samtools commands, like "samtools view XXXX.bam" i get:

open: No such file or directory
[main_samview] fail to open file for reading.
jlc_1020 is offline   Reply With Quote
Old 03-09-2010, 02:07 PM   #4
drio
Senior Member
 
Location: 4117'49"N / 24'42"E

Join Date: Oct 2008
Posts: 323
Default

Quote:
Originally Posted by jlc_1020 View Post
When I enter that code, I get a summary of the program information:

Program: samtools (Tools for alignments in the SAM format)
Version: 0.1.7-6 (r530)

Usage: samtools <command> [options]

Command: view SAM<->BAM conversion
sort sort alignment file
pileup generate pileup output
faidx index/extract FASTA
tview text alignment viewer
index index alignment
fixmate fix mate information
glfview print GLFv3 file
flagstat simple stats
calmd recalculate MD/NM tags and '=' bases
merge merge sorted alignments
rmdup remove PCR duplicates

But when I try to add samtools commands, like "samtools view XXXX.bam" i get:

open: No such file or directory
[main_samview] fail to open file for reading.
Run this cmds and post the results here:

$ pwd
$ which samtools
$ ls -lac my_bam
$ samtools view my_bam
__________________
-drd
drio is offline   Reply With Quote
Old 03-09-2010, 06:46 PM   #5
jlc_1020
Member
 
Location: Massachusetts

Join Date: Mar 2010
Posts: 11
Default

Quote:
Originally Posted by drio View Post
Run this cmds and post the results here:

$ pwd
$ which samtools
$ ls -lac my_bam
$ samtools view my_bam
I entered those commands in the directory that contains the samtools executable file and this is what I get:

jlc-macbook-pro:samtools jlc$ pwd
/Users/jlc/desktop/samtools
jlc-macbook-pro:samtools jlc$ which\ samtools
-bash: which samtools: command not found
jlc-macbook-pro:samtools jlc$ ls -lac my.bam
[email protected] 1 jlc staff 1537771973 Mar 9 09:47 my.bam
jlc-macbook-pro:samtools jlc$ samtools view my.bam
-bash: samtools: command not found

If I back up one directory and enter in the view command I get:

jlc-macbook-pro:desktop jlc$ samtools/samtools view my.bam
open: No such file or directory
[main_samview] fail to open file for reading.
jlc_1020 is offline   Reply With Quote
Old 03-09-2010, 07:12 PM   #6
drio
Senior Member
 
Location: 4117'49"N / 24'42"E

Join Date: Oct 2008
Posts: 323
Default

Umm.. try:

$ /Users/jlc/desktop/samtools/samtools view /Users/jlc/desktop/samtools/my.bam

And get a Unix book
__________________
-drd
drio is offline   Reply With Quote
Old 03-09-2010, 07:20 PM   #7
jlc_1020
Member
 
Location: Massachusetts

Join Date: Mar 2010
Posts: 11
Default

Quote:
Originally Posted by drio View Post
Umm.. try:

$ /Users/jlc/desktop/samtools/samtools view /Users/jlc/desktop/samtools/my.bam

And get a Unix book
Same error message:

open: No such file or directory
[main_samview] fail to open file for reading.

Thanks though
jlc_1020 is offline   Reply With Quote
Old 03-22-2010, 08:18 AM   #8
lparsons
Member
 
Location: NJ

Join Date: Nov 2008
Posts: 28
Default

From the samtools directory, try:

Code:
./samtools view my.bam
lparsons is offline   Reply With Quote
Old 03-22-2010, 09:02 AM   #9
jlc_1020
Member
 
Location: Massachusetts

Join Date: Mar 2010
Posts: 11
Default

I figured it out. It was a problem with the directory where my files were located. I moved them to a new directory and it worked fine.
jlc_1020 is offline   Reply With Quote
Old 08-24-2010, 03:06 PM   #10
raiseal
Junior Member
 
Location: Boston

Join Date: Sep 2009
Posts: 1
Default using samtools with mac

could you post the directory that you installed samtools into in order to get it to work? I have this problem too.
raiseal is offline   Reply With Quote
Old 08-24-2010, 05:54 PM   #11
adamdeluca
Member
 
Location: Iowa City, IA

Join Date: Jul 2010
Posts: 95
Default

quick tip for mac users, if you drag a file into a terminal window the full path will appear.

It does not matter where you install samtools, you just need to provide the correct path to the executable, and the input files.
adamdeluca is offline   Reply With Quote
Old 08-25-2010, 08:53 AM   #12
jlc_1020
Member
 
Location: Massachusetts

Join Date: Mar 2010
Posts: 11
Default

I installed samtools in a folder on the desktop and then put my files in the home folder so I wouldn't have to specify a path to them (since terminal is automatically in the home folder when it opens). To run, I used:

desktop/samtools/samtools view myfile.bam
jlc_1020 is offline   Reply With Quote
Old 01-13-2014, 06:08 PM   #13
maivantan
Member
 
Location: Vietnam

Join Date: Oct 2013
Posts: 51
Default

Any one can suggest me about below problem

USER-no-MacBook-Pro-4:bowtie2-2.1.0 user$ samtools mpileup -uf example/reference/lambda_virus.fa eg2.sorted.bam | bcftools view -bvcg - > eg2.raw.bcf
[fai_load] build FASTA index.
-bash: bcftools: command not found
[mpileup] 1 samples in 1 input files
<mpileup> Set max per-file depth to 8000

Thank you very much
maivantan is offline   Reply With Quote
Old 01-13-2014, 06:16 PM   #14
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 6,548
Default

If you built samtools on this computer then "bcftools" program is generally present in its own directory (also called "bcftools" btw). You can either add these directories to your $PATH or provide the full path to the bcftools executable in your command line.
GenoMax is offline   Reply With Quote
Old 01-13-2014, 06:34 PM   #15
maivantan
Member
 
Location: Vietnam

Join Date: Oct 2013
Posts: 51
Default

i provided full path of bcftools as bellowing

USER-no-MacBook-Pro-4:bowtie2-2.1.0 user$ samtools mpileup -uf example/reference/lambda_virus.fa eg2.sorted.bam | User/user/tan_analysis/samtools-0.1.19/bcftools view -bvcg - > eg2.raw.bcf
-bash: User/user/tan_analysis/samtools-0.1.19/bcftools: No such file or directory
[mpileup] 1 samples in 1 input files
<mpileup> Set max per-file depth to 8000

but the same problem i got.
Please give suggestion
Thank you
maivantan is offline   Reply With Quote
Old 01-13-2014, 06:41 PM   #16
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 6,548
Default

Likely missing parts highlighted in red. Try the command below:
Code:
USER-no-MacBook-Pro-4:bowtie2-2.1.0 user$ samtools mpileup -uf example/reference/lambda_virus.fa eg2.sorted.bam | /User/user/tan_analysis/samtools-0.1.19/bcftools/bcftools view -bvcg - > eg2.raw.bcf
GenoMax is offline   Reply With Quote
Old 01-13-2014, 06:53 PM   #17
maivantan
Member
 
Location: Vietnam

Join Date: Oct 2013
Posts: 51
Default

It was stil not working

SER-no-MacBook-Pro-4:bowtie2-2.1.0 user$ samtools mpileup -uf example/reference/lambda_virus.fa eg2.sorted.bam | /User/user/tan_analysis/samtools-0.1.19/bcftools/bcftools view -bvcg - > eg2.raw.bcf
-bash: /User/user/tan_analysis/samtools-0.1.19/bcftools/bcftools: No such file or directory
[mpileup] 1 samples in 1 input files
<mpileup> Set max per-file depth to 8000
maivantan is offline   Reply With Quote
Old 01-13-2014, 06:58 PM   #18
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 6,548
Default

Can you verify that the "bcftools" executable is present (based on the error you are getting it appears to have not been "made" when you compiled samtools).

Post the listing of this directory:

Code:
$ ls -l /User/user/tan_analysis/samtools-0.1.19/bcftools/
GenoMax is offline   Reply With Quote
Old 01-13-2014, 07:00 PM   #19
maivantan
Member
 
Location: Vietnam

Join Date: Oct 2013
Posts: 51
Default

Here the results

total 2096
[email protected] 1 user staff 1232 3 19 2013 Makefile
-rw-r----- 1 user staff 1966 3 19 2013 README
[email protected] 1 user staff 10569 3 19 2013 bcf.c
[email protected] 1 user staff 7223 3 19 2013 bcf.h
[email protected] 1 user staff 7226 3 19 2013 bcf.h~
-rw-r--r-- 1 user staff 40332 10 28 20:57 bcf.o
[email protected] 1 user staff 4217 3 19 2013 bcf.tex
[email protected] 1 user staff 3028 3 19 2013 bcf2qcall.c
-rw-r--r-- 1 user staff 7468 10 28 20:57 bcf2qcall.o
-rwxr-xr-x 1 user staff 166644 10 28 20:57 bcftools
[email protected] 1 user staff 13251 3 19 2013 bcfutils.c
-rw-r--r-- 1 user staff 42172 10 28 20:57 bcfutils.o
[email protected] 1 user staff 26288 3 19 2013 call1.c
-rw-r--r-- 1 user staff 60648 10 28 20:57 call1.o
[email protected] 1 user staff 8985 3 19 2013 em.c
-rw-r--r-- 1 user staff 21156 10 28 20:57 em.o
[email protected] 1 user staff 3122 3 19 2013 fet.c
-rw-r--r-- 1 user staff 8120 10 28 20:57 fet.o
[email protected] 1 user staff 8256 3 19 2013 index.c
-rw-r--r-- 1 user staff 25444 10 28 20:57 index.o
[email protected] 1 user staff 4960 3 19 2013 kfunc.c
-rw-r--r-- 1 user staff 18228 10 28 20:57 kfunc.o
[email protected] 1 user staff 7269 3 19 2013 kmin.c
[email protected] 1 user staff 1619 3 19 2013 kmin.h
-rw-r--r-- 1 user staff 11968 10 28 20:57 kmin.o
-rw-r--r-- 1 user staff 293456 10 28 20:57 libbcf.a
[email protected] 1 user staff 5184 3 19 2013 main.c
-rw-r--r-- 1 user staff 17652 10 28 20:57 main.o
[email protected] 1 user staff 3816 3 19 2013 mut.c
-rw-r--r-- 1 user staff 11060 10 28 20:57 mut.o
[email protected] 1 user staff 33429 3 19 2013 prob1.c
[email protected] 1 user staff 1457 3 19 2013 prob1.h
-rw-r--r-- 1 user staff 77440 10 28 20:57 prob1.o
[email protected] 1 user staff 7040 3 19 2013 vcf.c
-rw-r--r-- 1 user staff 27272 10 28 20:57 vcf.o
[email protected] 1 user staff 15707 3 19 2013 vcfutils.pl
maivantan is offline   Reply With Quote
Old 01-14-2014, 04:13 AM   #20
GenoMax
Senior Member
 
Location: East Coast USA

Join Date: Feb 2008
Posts: 6,548
Default

As you can see the "bcftools" binary file is present in the /User/user/tan_analysis/samtools-0.1.19/bcftools/ directory. It also has execute permissions that are needed to "run" a program.

Last edited by GenoMax; 01-14-2014 at 04:24 AM. Reason: In light of post #21 removed non-relevant material
GenoMax is offline   Reply With Quote
Reply

Tags
install, mac osx, samtools, teminal

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 01:24 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO