Question: Automatic BAM Index creation but tool is unsuccessful in identifying index
0
gravatar for marcoalbuquerque.sfu
3.9 years ago by
Canada
marcoalbuquerque.sfu50 wrote:

Hello Everyone,

I am currently working on a few tools in galaxy which require both a bam and bam index. When I upload a bam to galaxy it, it correctly downloads the bam file and creates the bai metadata. In other words, I am noticing files being created in the following directories, under the galaxy naming convention, which are exactly the same size as the index and bam:


Path/To/Galaxy/database/files/000/

Path/To/Galaxy/database/files/_metadata_files/000/


Now, I was under the impression that Galaxy handled bam and bai linking when a particular tool requires the bai (i.e. regardless, it makes the bai, so the tool will always have access to the bai whether or not it needs it). If this is not the case and I must somehow link the metadata to the bai can someone please let me know how to do that? I'm assuming a symbolic link would work, but I was under the impression that Galaxy took care of this.


Here is the Error I get from My Tool:

Missing bam index file: Path/To/Galaxy/database/files/000/dataset_3.dat

 

The current xml file is available here:

https://www.dropbox.com/s/tla61ff53o00eyx/delly.xml?dl=0

 

Thanks in advanced!

bai galaxy samtools bam • 2.5k views
ADD COMMENTlink modified 3.9 years ago by Bjoern Gruening5.1k • written 3.9 years ago by marcoalbuquerque.sfu50
3
gravatar for Bjoern Gruening
3.9 years ago by
Bjoern Gruening5.1k
Germany
Bjoern Gruening5.1k wrote:

Hi,

try this handy trick at the top of your XML file:

  ln -s $input1 'input.bam'  &&
  ln -s $input1.metadata.bam_index input.bai &&

This will link your BAM + index files to your current working directory. Now you can pass your BAM file with 'input.bam' to your script.

Ciao,

Bjoern

ADD COMMENTlink modified 3.9 years ago • written 3.9 years ago by Bjoern Gruening5.1k

Hi Bjoern,

So in general, to access metadata of a particular input, do we use the following syntax?

$input1.metadata.metadata_type 

Is there maybe a working list of possible metadata_types? Or is this really only of concern with BAM / BAI?

Thanks so much.

ADD REPLYlink written 3.9 years ago by marcoalbuquerque.sfu50
1

Hi,

metadata is dependent of the data type. So every datatype can define it's own metadata. In fact I have a few tools with it's own datatypes and it's own metadata. So if you are interested in metadata and datatypes have a look at the Galaxy datatype definitions.

Glad that we could help you,

Bjoern

ADD REPLYlink written 3.9 years ago by Bjoern Gruening5.1k

Awesome,

Thanks again!

ADD REPLYlink written 3.9 years ago by marcoalbuquerque.sfu50
1
gravatar for Jennifer Hillman Jackson
3.9 years ago by
United States
Jennifer Hillman Jackson25k wrote:

Hello,

This sounds as if it may be an issue with the custom tool or potentially a path problem. The index created is linked by default. Test by seeing if you can download both the BAM and BAI from the history. If they are there - the problem is not with the datasets themselves.

Just a guess, but a place to start. I didn't examine the tool xml file.

Thanks, Jen, Galaxy team

ADD COMMENTlink written 3.9 years ago by Jennifer Hillman Jackson25k

Hi Jen,

You can download both the BAM and BAI.

Not sure if this is helpful, but the bai file was called metadata_3.dat and the bam file was called dataset_6.dat . 

So, I guess how does galaxy link the bai to the bam? Given that my xml is basically shooting a command to the command line, is galaxy changing the name of the metadata temporarily so the tool can automatically find the .bai file?

Thanks Again

ADD REPLYlink modified 3.9 years ago • written 3.9 years ago by marcoalbuquerque.sfu50
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 166 users visited in the last hour