How to set or change the default software path in R

I have a program called "bowtie2" and I changed the default path in the terminal:

$export PATH=/opt/NGS/bowtie2-2.2.8:/usr/local/sbin:/usr/local/bin:/usr/sbin
$bowtie2 --version
/opt/NGS/bowtie2-2.2.8/bowtie2-align-s version 2.2.8

But when I call it from R, this is still an old version from another way:

> bowtie2="bowtie2"
> system2(bowtie2,"--version",stdout=TRUE)[1]
[1] "/usr/bin/bowtie2-align version 2.1.0"

My question is how to change the default path for a program in R (so the version is "/opt/NGS/bowtie2-2.2.8/bowtie2-align-s version 2.2.8 is more likely" / usr / bin / bowtie2- align version 2.1.0 ")

0
source share
1 answer

You need to add export PATH=/opt/NGS/bowtie2-2.2.8:/usr/local/sbin:/usr/local/bin:/usr/sbin.bashrc (linux) or .bash_profile (mac) to your home folder at the end of the file.

vi ~/.bash_profile

export , . system R, , export .

, export

+1

Source: https://habr.com/ru/post/1656031/


All Articles