Hi,
I am using RMarkdown in Rstudio and I want to execute commands from a program using a bash chunk
````{bash}
```
I have a program called samtools on my computer so when I execute it in the chunk, it works.
```{bash}
samtools
```
When I type :
```{bash}
which samtools
```
The output is that it tells me samtools is located in the usr/local/bin directory.
However, when I execute a program with vcftools , I get an error because Rstudio, does not know where the program is: I have it in another directory on my computer.
How do I get Rstudio or Rmarkdown to execute vcftools from the bash chunk? Is there a way that I can tell RMarkdown which directory to look in to find the program?
For example (something like) :
```{bash}
$vcftools = /Users/m.o.l.s/Programs_For_Bioinformatics/vcftools
```
or would I have to move all of the programs to usr/bin/local?
Outside of Rstudio, I have made aliases to the programs so they work fine on the terminal.
I made the alias by writing in my .bash_profile
alias bcftools=/Users/paths/to/where/the/program/is/installed
but I added the path to vcftools to my export PATH in the bash profile completely.
My guess is that samtools and vcftools are not install using the same mechanism. If I were forced to say, I'd guess that samtools is installed in a machine default location, and vcftools in a non-standard location using something like conda or a module file.
Yes. This is true. I have installed programs using Conda, Homebrew, pip install, and downloaded binaries and source files from online and compiled them from github and websites.
How did you make the alias'? which configuration file are the stored in?
I made the alias by opening my hidden bash profile :
open .bash_profile
and then writing in it:
alias bcftools = /Users/paths/to/where/the/program/is/installed
use the fullpath to samtools ?