How to install bamtofastq utility in my terminal?
1
0
Entering edit mode
4.5 years ago
Farah ▴ 80

Hello,

I need to use bamtofastq utility described in kallisto | bustools workflow (https://www.kallistobus.tools/install_bamtofastq.html) in order to convert bam files to fastq files for single-cell RNA-seq analysis. I also need to run the bamtofastq utility from my terminal in linux.

So, I have downloaded bamtofastq 1.1.2 (from https://support.10xgenomics.com/docs/bamtofastq), and placed the downloaded bamtofastq.man file in my /home/me/ directory.

From https://support.10xgenomics.com/docs/bamtofastq, they suggested to chmod 700 to make it executable. So, I did as below:

chmod 700 /home/me/bamtofastq.man

export PATH=/home/me/bamtofastq/:$PATH

bamtofastq -h

But, I faced with -bash: bamtofastq: command not found ERROR. As I am new in linux and bash, would you please help me what I did wrong and how I can install bamtofastq utility to use in my terminal?

Thank you so much. Best wishes

kallisto bamtofastq bustools • 3.7k views
ADD COMMENT
1
Entering edit mode
4.5 years ago
ATpoint 81k

This is a binary. Place it into any folder of your choice, then use chmod +x bamtofastq to make it executable and run via ./bamtofastq. Add it to path as export PATH=$PATH:/path/to/folder/where/bamtofastq/is/in. PATH is always the enclosing folder, never the executable itself.

As a side note I do not think that the name of the senior author is an appropriate tag, therefore I removed it ;-)

ADD COMMENT
0
Entering edit mode

Thank you so much for your great guide. I placed bamtofastq.man file to /scratch/me/scRNA1/ directory, and as you mentioned, I did as below, but again I faced with Error :

chmod +x /scratch/me/scRNA1/bamtofastq.man

export PATH=$PATH:/scratch/me/scRNA1/

./bamtofastq.man

bamtofastq v1.1.2 Invalid arguments.

Usage: bamtofastq [options] <bam> <output-path> bamtofastq (-h | --help)

and again bamtofastq command not found. I would appreciate your help.

ADD REPLY
1
Entering edit mode
  1. What is bamtofastq.man? The link you specified points to a binary file named bamtofastq, so where are you getting this bamtofastq.man?
  2. What you're seeing is expected. That file, whatever it is, is working fine. The error is expected because you're not passing any arguments. Try running bamtofastq.man -h. If that works, run mv /scratch/me/scRNA1/bamtofastq.man /scratch/me/scRNA1/bamtofastq and you should be able to use bamtofastq instead of bamtofastq.man as the command.
ADD REPLY
0
Entering edit mode

Many thanks. I downloaded bamtofastq.man from this https://support.10xgenomics.com/docs/bamtofastq site, and I just clicked on Download bamtofastq 1.1.2 icon in the Download & Installation part.

May I kindly ask what do you mean by I am not passing any arguments? what are these arguments and how should I pass them?

Thanks a lot.

ADD REPLY
1
Entering edit mode

When you try to run a program you need to provide some input (and output file(s)) for the program to do its work on. These are called arguments.

If you run bamtofastq -h you can see what input the program minimally is expecting from you to be able to run in the usage statement it prints:

$ ./bamtofastq 
bamtofastq v1.1.2
Invalid arguments.

Usage:
  bamtofastq [options] <bam> <output-path>
  bamtofastq (-h | --help)

So now if you add a -h you get:

$ ./bamtofastq -h
bamtofastq v1.1.2
10x Genomics BAM to FASTQ converter.

Usage:
  bamtofastq [options] <bam> <output-path>
  bamtofastq (-h | --help)

(Parts truncated)

Options:
  --locus=<locus>      Optional. Only include read pairs mapping to locus. Use chrom:start-end format.
  --reads-per-fastq=N  Number of reads per FASTQ chunk [default: 50000000]
  --gemcode            Convert a BAM produced from GemCode data (Longranger 1.0 - 1.3)
  --lr20               Convert a BAM produced by Longranger 2.0
  --cr11               Convert a BAM produced by Cell Ranger 1.0-1.1
  --bx-list=L          Only include BX values listed in text file L. Requires BX-sorted and index BAM file (see Long Ranger support for details).
  -h --help            Show this screen.

So your bamtofastq command will need to have (option(s) from the list above, if needed), name of your bam file and a path/filename(s) to store convered fastq reads at.

ADD REPLY
0
Entering edit mode

That helped a lot. Many thanks for your great explanation and guide.

ADD REPLY

Login before adding your answer.

Traffic: 1920 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6