Question: bedtools sort -faidx in CWL
0
gravatar for dami
10 days ago by
dami0
dami0 wrote:

How does one uses a secondairy file as the input to a command in CWL?

I try to do :

bedtools sort -header -faidx hg38.fasta.fai

So in CWL i got to

#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: CommandLineTool
label: "sort a bed file based on occurrence in fasta"

requirements:
  - class: DockerRequirement
    dockerPull: "biocontainers/bedtools:v2.28.0_cv2"

baseCommand: ["bedtools", "sort", "-header"]

stdout: $(inputs.output_name)

inputs:
  input_bed:
    type: File
    inputBinding:
      position: 2
      prefix: -i

  reference_genome:
    type: File
    secondaryFiles:
       - .fai
    inputBinding:
      position: 1
      prefix: -faidx
      valueFrom: {$(inputs.reference_genome.basename).fai}

  output_name:
    type: string?
    default: sorted_coverage.bed

outputs:
  sorted_bed:
    type: stdout

But that does not work for the ValueFrom method under reference_genome/inputbinding.

Does anyone know how to do this?

sort cwl bedtools • 110 views
ADD COMMENTlink written 10 days ago by dami0

I have not yet used bedtools, so i'm not sure i understand correctly. Can you spell out the names of the files which bedtools needs to access for the line you have given in the beginning? I guess one is g38.fasta.fai. But what are the names of the other files?

ADD REPLYlink written 7 days ago by Tom250

If the command that you are trying to produce is bedtools sort -header -faidx hg38.fasta.fai it looks like you don't need secondaryFiles at all. You should just be able to pass in hg38.fasta.fai as your input file.

ADD REPLYlink written 7 days ago by karl.sebby70
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: 903 users visited in the last hour