secondaryFiles for bam: how to handle .bai or/and ^.bai ?
2
0
Entering edit mode
7.3 years ago
liuxf09 ▴ 30

Bam file could have two different file extensions depending on the tools. Given bam file test.bam,

  • test.bam.bai secondaryFiles = [.bai]
  • test.bai secondaryFiles = [^.bai]

For a flow to work with both kinds of bam inputs, how to set the secondaryFiles?
Since secondaryFiles items must be present, it is not possible to set the secondaryFiles to handle bam input from any bam index convention.

cwl • 2.4k views
ADD COMMENT
0
Entering edit mode

are you trying to get the files that end with either bam.bai or .bai? if that's the case just grep out those with .bai....

how are your writing your workflow? unix shell?

ADD REPLY
3
Entering edit mode

Since this post is tagged cwl I put my money (not all of it) on cwl.

ADD REPLY
0
Entering edit mode

As a workflow, I would like to get the flow to work with both .bam.bai and .bai index files. To make a more symbolic link from .bai to .bam.bai is a workaround.

ADD REPLY
1
Entering edit mode
7.3 years ago
slw287r ▴ 140
samtools index test.bam

creates test.bai, then

ln -s test.bai test.bam.bai
ADD COMMENT
1
Entering edit mode
7.3 years ago
liuxf09 ▴ 30

One solution is extend the spec of cwl to add an attribute "optional" to secondaryFiles items, like

secondaryFiles:
  - .bai
    optional: true
  - .^bai
    optional: true

This will make secondaryFiles mechanism more flexible.

ADD COMMENT

Login before adding your answer.

Traffic: 1908 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