Frage

I am installing cufflinks on my Mac OS X, and here is the instruction:

http://cufflinks.cbcb.umd.edu/tutorial.html

Under Installing the SAM tools I follow the instructions below

  1. Download the SAM tools
  2. Unpack the SAM tools tarball and cd to the SAM tools source directory.
  3. Build the SAM tools by typing make at the command line.
  4. Choose a directory into which you wish to copy the SAM tools binary, the included library libbam.a, and the library headers. A common choice is /usr/local/.
  5. Copy libbam.a to the lib/ directory in the folder you've chosen above (e.g. /usr/local/lib/)
  6. Create a directory called "bam" in the include/ directory (e.g. /usr/local/include/bam)
  7. Copy the headers (files ending in .h) to the include/bam directory you've created above (e.g. /usr/local/include/bam)
  8. Copy the samtools binary to some directory in your PATH.

I've done the fist 7 steps, but I am not sure how to proceed with the last step (#8): should I use the command:

sudo cp -a samtools-0.1.18 /usr/local/

or into some other directories? What does the PATH in step 8 indicate? Thanks!

War es hilfreich?

Lösung

To answer your question I will go over some basic linux knowledge that has helped me understand binaries and their locations.

In linux, you can run a binary by typing in a complete path to the binary and the binary will run. For example, if I have a binary named foo in /usr/local/bin, I would run the command /usr/local/bin/foo and the foo binary would be run.

The purpose of the PATH is a shortcut so that you don't need to type in the complete path to the binary, just the name of the binary. PATH is a variable that contains all of the directories that have binaries that you want to have the shortcut apply to. So, referring to the previous example, if /usr/local/bin is in my PATH variable, then I could just run foo.

So, to answer your question, you can tell which directories that are in your PATH by running the command echo $PATH and if one of the directories is where your samtools binaries are, your good!! If not, you can move your samtools binaries to one of those directories so that you don't have to put the full path everytime you want to run the binaries.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top