Unable to find BAM file index

Posted in General by Avi Ramu Mon Apr 25 2016 14:58:04 GMT+0000 (UTC)·3·Viewed 632 times

When I try to run `samtools mpileup` it expects to find the BAM index in the same folder as the BAM file with the extension ".bai". I'm not sure how I can expose the BAM index to a tool that assumes a certain file location for the index.
Erik Lehnert
Apr 25, 2016

Hi Avi,

If you have a previously created BAM index file, you will need to do two things: (1) Create an input node for the BAM index file and (2) stage both the BAM and BAM index file as links.

Creating an input node for the BAM index file will allow the index file to be used as an input to the task. Please see the following instructions for how to create a new input node: http://docs.cancergenomicscloud.org/docs/tool-input-ports#section-add-an-input-port-to-the-tool-description.

Because the BAM index file name is not included in the commandline, you should only need to specify file type and ID.

Staging the inputs allows you to load inputs for the tool by copying or linking (via a symbolic link) its input files to the working directory of the job. By staging both the BAM file and BAM index file as links, the BAM file and the BAM index file will be in the same directory as one another. You can find a description of how to do this here: http://docs.cancergenomicscloud.org/docs/tool-input-ports#section-stage-input.

Hope this helps! Please let me know if any of this wasn't clear.

Avi Ramu
Apr 25, 2016

Thanks Erik, that worked.

To summarize, I tried to use the public 'SAMtools Mpileup' app on a small region on chr1. To do this, I first copied the app to my project. I then had to add an input port, which I called 'bam_index', which is of type 'File' and whose Stage Input is set to 'Link'. I then had to select a BAM file and BAI file for the analysis and hit start.

Brandi Davis-Dusenbery marked this as solved
Markdown is allowed