Biostar Beta. Not for public use.
How To Specify Positional Argument Order In A Gkno Tool
0
Entering edit mode
16 months ago
Carlos Borroto ♦ 1.8k
Washington Metropolitan Area

Hi,

I'm integrating a custom tool into gkno. My tool uses positional arguments that need to be in a correct order. I wrote the JSON configuration file following the documentation and looking at configuration from tools coming with gkno. Using the JSON configuration below, gkno generates a makefile with the positional arguments in the wrong order("qual_file fna_file" instead of "fna_file qual_file"). Is there a way to specify the correct order?

My tool usage:

$ 454-tools merge --help
usage: 454-tools merge [options] [--] <fna_file> <qual_file>

options:
    -h --help                       Show this screen.

    -o FILENAME --output=FILENAME   Write FASTQ output to FILENAME.

What I have in the JSON configuration so far.

{
  "tools" : {
    "454-tools-merge" : {
      "description" : "Merge 454's Fasta and Quality files into a Fastq file",
      "path" : "454-tools/scripts",
      "executable" : "454-tools",
      "modifier" : "merge",
      "help" : "--help|-h",
      "arguments" : {
        "--fna-file" : {
          "description" : "454's fasta input file",
          "input" : true,
          "output" : false,
          "required" : true,
          "dependent" : true,
          "type" : "string",
          "extension" : "fna",
          "modify argument name on command line" : "hide"
        },
        "--qual-file" : {
          "description" : "454's quality input file",
          "input" : true,
          "output" : false,
          "required" : true,
          "dependent" : true,
          "type" : "string",
          "extension" : "qual",
          "modify argument name on command line" : "hide"
        },
        "--output" : {
          "description" : "the output fastq file",
          "input" : false,
          "output" : true,
          "required" : true,
          "dependent" : false,
          "type" : "string",
          "extension" : "fastq",
          "short form argument" : "-o",
          "if output to stream" : "do not include"
        }
      },
      "instances" : {
        "default" : {
          "description" : "Default instance requires the users input for all files."
        }
      }
    }
  }
}

Edit: Removed 'additional files' section as it is not needed. I previously had a wrong interpretation of what is for. This edit does not affect the question or the answers, it is just for future references.

• 1.4k views
ADD COMMENTlink
1
Entering edit mode
16 months ago
Carlos Borroto ♦ 1.8k
Washington Metropolitan Area

Answering myself...

After some extensive grepping through the code(you have to love open source) and configuration files of included tools. I found there is an undocumented setting (you have to love just a little less open source) named "argument order", nice!

I only had to modify the JSON configuration above as follow:

{
  "tools" : {
    "454-tools-merge" : {
      ...snip...
      "argument order" : [
        "--output",
        "--fna-file",
        "--qual-file"
      ],
      ...snip...
    }
  }
}
ADD COMMENTlink
0
Entering edit mode
4.2 years ago
alistairnward • 210
United States

I apologise that I am a little behind in completing all of the documentation. It is not by design that this option isn't clearly spelled out in the documentation, but I will get it in there quickly. But, yes this is the solution that you need. Setting the argument order section of the configuration file will ensure that the arguments always appear in the correct order on the command line.

ADD COMMENTlink
0
Entering edit mode

No problem at all. I don't expect a project under heavy development to have a fully up-to-date documentation. Thanks for the confirmation.

ADD REPLYlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.3.1