Question: secondaryFiles for bam: how to handle .bai or/and ^.bai ?
0
gravatar for liuxf09
3.0 years ago by
liuxf0930
liuxf0930 wrote:

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 • 969 views
ADD COMMENTlink modified 3.0 years ago • written 3.0 years ago by liuxf0930

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 REPLYlink written 3.0 years ago by TriS4.2k
3

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

ADD REPLYlink written 3.0 years ago by WouterDeCoster44k

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 REPLYlink written 3.0 years ago by liuxf0930
1
gravatar for slw287r
3.0 years ago by
slw287r110
China
slw287r110 wrote:
samtools index test.bam

creates test.bai, then

ln -s test.bai test.bam.bai
ADD COMMENTlink written 3.0 years ago by slw287r110
1
gravatar for liuxf09
3.0 years ago by
liuxf0930
liuxf0930 wrote:

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 COMMENTlink written 3.0 years ago by liuxf0930
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 2.3.0
Traffic: 1187 users visited in the last hour