<p>The short answer is to <a href="https://docs.conda.io/en/latest/miniconda.html" rel="nofollow noreferrer">use conda</a>. In the <a href="https://bioconda.github.io/" rel="nofollow noreferrer">bioconda channel</a> we have most of the tools used in bioinformatics, such as samtools. You do not need administrator permissions to install conda or packages with it, so your lack of <code>sudo</code> ability is not an issue.</p>

<blockquote>
  <p>I have installed samtools and many other programs necessary for the workflow, however, once I am on the remote server in bash, and try and run a function over the files of interest, it gives me the error</p>
</blockquote>

<p>Installing packages on your local machine won't affect the remote server unless they share a file system, so this is expected.</p>

<p>As an aside, BAM files aren't really "raw", they're considered processed data (fastq/fast5 files are considered truly "raw" data in the sequencing world).</p>

CC BY-SA 4.0
2019-02-12T20:40:14.337Z
2019-02-12T20:40:14.337Z
Devon Ryan
<p>At a very wild guess</p>

<pre><code>-bash-samtools
</code></pre>

<p>This looks shaky. For a start you need a space between the command and the application in all Linux/Unix/Mac OS X applications (its complicated to explain right now [see below] just accept it).</p>

<hr>

<p>Wait you are using <code>sudo</code> and thats how you are installing on a local machine. <code>sudo</code> on a remote machine will never work, because you are not the systems admin. <code>sudo</code> on a local machine is not cool (see below)</p>

<hr>

<p>Anyway I need to do some next-gen and have 6 MiSeq kits waiting for action so I installed it from here:
<a href="http://www.htslib.org/download/" rel="nofollow noreferrer">http://www.htslib.org/download/</a></p>

<p>Okay so here's my tcsh history</p>

<pre><code> 4  21:44   cd sam* # like I was in the Desktop
 7  21:44   more README # I needed to know how they wanted the installation
 8  21:45   ./configure # okay there are setting the paths for me - saves me a job
11  21:46   make # like fairytale stuff for a load of C scripts
16  21:49   ls | grep samtools # I wanna know if its compiled and I see samtools* ... yep
17  21:49   ln -s ./samtools* ~/bin # I'm gonna pop a link in my bin so after I type
18  21:49   rehash # 'cause I still insist on tcsh rather than bash (don't do it in bash)
</code></pre>

<p>However, the following is a bit creepy because I get loads of perl scripts in my /usr/local/bin ...</p>

<pre><code>make install
</code></pre>

<p>Anyway,</p>

<pre><code>samtools
</code></pre>

<p>It took 4 mins on an OS X machine, using tsch, after I just quaffed 2 pints at my  pub (10pm London time). So probability is set against me .... </p>

<p><strong>OUTPUT</strong></p>

<pre><code>Program: samtools (Tools for alignments in the SAM format)
Version: 0.1.18 (r982:295)

Usage:   samtools &lt;command&gt; [options]

Command: view        SAM&lt;-&gt;BAM conversion
         sort        sort alignment file
         mpileup     multi-way pileup
         depth       compute the depth
         faidx       index/extract FASTA
         tview       text alignment viewer
         index       index alignment
         idxstats    BAM index stats (r595 or later)
</code></pre>

<p>etc ...
BTW seriously, fun over, avoid "<code>sudo</code>" if you can, for lots of reasons (which I'm not gonna explain). Its a last resort and usually means your paths are incorrectly set.</p>

<p>sudo will be refused on a remote machine, without question. You COULD ask systems admin to do this for you. HOWEVER, I'd try and install yourself without <code>sudo</code> and your bioinformatics will benefit.</p>

<hr>

<pre><code>Program: samtools (Tools for alignments in the SAM format)
Version: 1.9 (using htslib 1.9)

Usage:   samtools &lt;command&gt; [options]

Commands:
  -- Indexing
     dict           create a sequence dictionary file
     faidx          index/extract FASTA
     fqidx          index/extract FASTQ
     index          index alignment
</code></pre>

<p><strong>Output</strong> following <code>make install</code></p>

CC BY-SA 4.0
2019-02-13T08:08:02.723Z
0.1.18 is a truly ancient version of samtools and is unlikely to be what you compiled.
Devon Ryan
CC BY-SA 4.0
2019-02-13T15:34:28.797Z
Yes you are right, currently 1.9 (above)
M__
CC BY-SA 4.0
2019-02-12T22:05:09.693Z
2019-02-13T15:33:53.453Z
2019-02-13T15:33:53.453Z
M__
<p>I am new to bash and the processes behind cluster computing in general and need some help with understanding some basics.</p>

<p>After looking all over the internet and this forum (+ askUbuntu) I found nothing that addresses this issue.</p>

<p>I have a series of raw RNA sequencing files: .bam and wish to utilize samtools (or others) to begin the data preprocessing steps defined in many workflows.</p>

<p>I have installed samtools and many other programs necessary for the workflow, however, once I am on the remote server in bash, and try and run a function over the files of interest, it gives me the error: <code>-bash-samtools: command not found</code></p>

<p>When I try to install the package, say samtools, by running <code>sudo apt install samtools</code>, I get an error stating I do not have permission to do such.</p>

<p>What do I do? Must I bring up this issue to the server provider or is there a way around it?</p>

<p>Thank you for your time,</p>

<rna-seq><scrnaseq><samtools><bash>
Using preprocessing/alignment functions on the server
# Using preprocessing/alignment functions on the server

(Asked by: username_0 on 2019-02-12)

I am new to bash and the processes behind cluster computing in general and need some help with understanding some basics.

After looking all over the internet and this forum (+ askUbuntu) I found nothing that addresses this issue.

I have a series of raw RNA sequencing files: .bam and wish to utilize samtools (or others) to begin the data preprocessing steps defined in many workflows.

I have installed samtools and many other programs necessary for the workflow, however, once I am on the remote server in bash, and try and run a function over the files of interest, it gives me the error: `-bash-samtools: command not found`

When I try to install the package, say samtools, by running `sudo apt install samtools`, I get an error stating I do not have permission to do such.

What do I do? Must I bring up this issue to the server provider or is there a way around it?

Thank you for your time,

**Tags:** rna-seq, scrnaseq, samtools, bash

---

## 2 answers

### Answer by username_1 on 2019-02-12. Score: 3 | Accepted answer

The short answer is to [use conda](https://docs.conda.io/en/latest/miniconda.html). In the [bioconda channel](https://bioconda.github.io/) we have most of the tools used in bioinformatics, such as samtools. You do not need administrator permissions to install conda or packages with it, so your lack of `sudo` ability is not an issue.

> I have installed samtools and many other programs necessary for the workflow, however, once I am on the remote server in bash, and try and run a function over the files of interest, it gives me the error

Installing packages on your local machine won't affect the remote server unless they share a file system, so this is expected.

As an aside, BAM files aren't really "raw", they're considered processed data (fastq/fast5 files are considered truly "raw" data in the sequencing world).


---

### Answer by username_2 on 2019-02-12. Score: 2

At a very wild guess
-bash-samtools

This looks shaky. For a start you need a space between the command and the application in all Linux/Unix/Mac OS X applications (its complicated to explain right now [see below] just accept it).

Wait you are using sudo and thats how you are installing on a local machine. sudo on a remote machine will never work, because you are not the systems admin. sudo on a local machine is not cool (see below)

Anyway I need to do some next-gen and have 6 MiSeq kits waiting for action so I installed it from here:
http://www.htslib.org/download/
Okay so here's my tcsh history
 4  21:44   cd sam* # like I was in the Desktop
 7  21:44   more README # I needed to know how they wanted the installation
 8  21:45   ./configure # okay there are setting the paths for me - saves me a job
11  21:46   make # like fairytale stuff for a load of C scripts
16  21:49   ls | grep samtools # I wanna know if its compiled and I see samtools* ... yep
17  21:49   ln -s ./samtools* ~/bin # I'm gonna pop a link in my bin so after I type
18  21:49   rehash # 'cause I still insist on tcsh rather than bash (don't do it in bash)

However, the following is a bit creepy because I get loads of perl scripts in my /usr/local/bin ...
make install

Anyway,
samtools

It took 4 mins on an OS X machine, using tsch, after I just quaffed 2 pints at my  pub (10pm London time). So probability is set against me .... 
OUTPUT
Program: samtools (Tools for alignments in the SAM format)
Version: 0.1.18 (r982:295)

Usage:   samtools  [options]

Command: view        SAM<->BAM conversion
         sort        sort alignment file
         mpileup     multi-way pileup
         depth       compute the depth
         faidx       index/extract FASTA
         tview       text alignment viewer
         index       index alignment
         idxstats    BAM index stats (r595 or later)

etc ...
BTW seriously, fun over, avoid "sudo" if you can, for lots of reasons (which I'm not gonna explain). Its a last resort and usually means your paths are incorrectly set.
sudo will be refused on a remote machine, without question. You COULD ask systems admin to do this for you. HOWEVER, I'd try and install yourself without sudo and your bioinformatics will benefit.

Program: samtools (Tools for alignments in the SAM format)
Version: 1.9 (using htslib 1.9)

Usage:   samtools  [options]

Commands:
  -- Indexing
     dict           create a sequence dictionary file
     faidx          index/extract FASTA
     fqidx          index/extract FASTQ
     index          index alignment

Output following make install

> **Comments:**
> **username_1**: 0.1.18 is a truly ancient version of samtools and is unlikely to be what you compiled.  
> **username_2**: Yes you are right, currently 1.9 (above)  

---

