Entering edit mode
4 months ago
drmodupe06
•
0
Hi, I am new to bioinformatics so please be kind.
I am trying to retrieve unmapped reads from a sam file named aln.sam on command line (HPC). I have installed samtools and I ran it with this code:
module load bioconda
conda install -c bioconda samtools
cd /path to working directory
samtools view -f 4 -i aln.sam > unmapped_reads.sam
The error message I get is
/tmp/slurmd/job...../slurm_script: samtools: command not found.
I need help correcting this and how do I convert the unmapped reads to a fastq file.
It means that the directory where
conda
installedsamtools
is not available from the nodes that are running your SLURM job. Can you show us your exact SLURM submission command/script? At a minimum you will need toconda activate
for this to work.You should need to
install
conda only once while creating a new environment. After that you will only need toconda activate env
.Thanks. The slurm script script is :
What environment is this and how is it related to original question?
As noted already, see if your cluster already has a module for samtools (or another program that depends on
samtools
, which is bound to includesamtools
) and just load that module. Doing theconda install
inside slurm script is not good practice. If you want to do that do it outside script and activate the environment before submitting the job (or inside the script).It just means that it does not find the tool samtools. Create conda environment(cona create), activate it (conda activate), install samtools inside the env (conda install).
Thank you so much
Are you sure they haven't installed samtools as a module already?
no it wasnt, if it was wouldnt it recognize the command?
Not by default. You will have to
module load samtools
for that command to become available.Thank you everyone, the command has been recognized.
Which solution worked (from above)? I can move that comment to an answer. You can accept the answer (green check mark) to provide closure to this thread.