2
$\begingroup$

I would like to add the SRA toolkit to my path under macOS 12.1.

After downloading the SRA directory, decompressing, and adding to the path, the directory does not seem to be available e.g. I'm attempting to add it to my path with

export path=(/Users/ray/Documents/School/bioinformatics/sratoolkit.2.11.2-mac64/bin)

and it does not work. For example if I type

 `ray@dynamic-xx-xxx-xxx-xx ~ % which prefetch

prefetch not found` macOS gives me prefetch not found. The result of my path is

`ray@dynamic-10-125-206-18 ~ % echo $PATH
/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin` 

Is there a way to add it to my path so it works?

$\endgroup$

1 Answer 1

0
$\begingroup$

Firstly, you are trying to set a path into the Documents directory? Thats like for documents.


Anyway there could be a permission issue. The quickest way is simply set a path within .bashrc or .profile whatever into ~/bin and then use

ln -si /Users/ray/Documents/School/bioinformatics/sratoolkit.2.11.2-mac64/bin/prefetch ~/bin

... for each compiled program.

$ prefetch 

should then work. This creates a symbolic link in ~/bin so when you type the program in your commandline prompt it will fire, without wiring it via a custom bin. If there is a permission issue a permission error will be quickly flagged.


The best way is to use Anaconda because its within the Anaconda collection and simplifies everything on three counts, viz:

  • in answer to your question all configurations are automated
  • it is easy to automate all updates
  • it offers a virtual environment where code can't mess with your system
  • whenever you want to download other packages its the same approach

Thus all you have to do is download and install Anaconda or miniconda. From this point everything is done using conda, either:

conda install -c bioconda sra-tools
conda install -c bioconda/label/cf201901 sra-tools

If one fails the other one will work. Then simply,

conda activate 

SRA is now fully configured and ready to go. To get out of the conda virtual environment,

conda deactivate 

If you use Anaconda alot it is better to make a specific environment for SRA and not use the core environment, but thats another question.

Anaconda installs in two different locations depending on whether you install the GUI version, which makes maintenance and environments a bit easier. In the later case I think its /opt (but forget), otherwise the commandline version is ~/anadonda3.


I see your using a virtual environment via homebrew. Anaconda is separate, its the same idea, but its better.

$\endgroup$
2
  • $\begingroup$ Fixed it by installing anaconda. It does look like sra-toolkit is not compiled for Apple Silicon yet so Apple x86_64 miniconda is the only architecture that sra-toolkit will work with on MacOS. $\endgroup$
    – mangoTango
    Commented Jan 22, 2022 at 11:41
  • $\begingroup$ Ah right, the M1 chip compatibiility issue. Good to hear that Anaconda has got around the issue. $\endgroup$
    – M__
    Commented Jan 22, 2022 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.