AdamaJava / adamajava

Other
14 stars 5 forks source link

options & usage for q3tiledaligner #306

Closed delocalizer closed 2 years ago

delocalizer commented 2 years ago

Describe the bug

I want to use the q3tiledaligner.jar in recent releases to generate a tiled aligner .gz from a reference fasta.

Not sure if this is a bug in documentation, options configuration, some combination thereof, or just my misunderstanding but...

In older versions of q3tiledaligner, calling java -jar ... with options built a tiled aligner gz file:

java -jar q3tiledaligner-0.1pre.jar \
    --input /path/to/reference.fa \
    --output /path/to/output.tx.gz \
    --log /path/to/log

And that is the behaviour documented here https://genomeinfo.qimrberghofer.edu.au/wiki/q3tiledaligner.

In current versions, the help says this:

java -jar /software/adamajava/adamajava-release/nightly/build/lib/q3tiledaligner.jar -h
usage: java -cp q3tiledaligner.jar au.edu.qimr.tiledaligner.TiledAligner -input <tiled_aligner_file.gz> -reference <reference fasta file, with adjacent index file> -sequence <sequence to be tiled aligned> -name <name of sequence (optional)>
Option                       Description                           
------                       -----------                           
--help                       Shows this help message.              
--input                      Reference file to be tiled and output-
                               ed in tiledaligner format           
--log                        File where log output will be directed
                               (must have write permissions)       
--loglevel                   Logging level required, e.g. INFO,    
                               DEBUG. (Optional) If no parameter is
                               specified, will default to INFO     
--name                       name of sequence to be run against the
                               tiled aligner (optional)            
--output                     File where the output of              
                               q3tiledaligner should be written to 
--positionsCutoff <Integer>  Number at which start positions will  
                               stop being noted and instead a count
                               of start positions will be          
                               presented. Defaults to 5000.        
--reference                  Reference file to be used             
--sequence                   sequence to be run against the tiled  
                               aligner                             
--version                    Print version info.  

My first issue is that the long form help description for the --input option:

--input Reference file to be tiled and outputed in tiledaligner format

appears to contradict the argument placeholder in the usage text:

-input

which implies to me the input is already a tiled aligner file.

Ignoring that and pressing on, I supply a fasta as the input argument, but then get this:

java -jar /software/adamajava/adamajava-release/78.43982c9/build/lib/q3tiledaligner.jar \
    --input /path/to/reference.fa\
    --output /path/to/output.txt.gz \
    --log /path/to/log

[conradL@hpcnode062 ~]$ Picked up JAVA_TOOL_OPTIONS:  -XX:+UseSerialGC
Please supply a reference option for the fasta file
usage: java -cp q3tiledaligner.jar au.edu.qimr.tiledaligner.TiledAligner -input <tiled_aligner_file.gz> -reference <reference fasta file, with adjacent index file> -sequence <sequence to be tiled aligned> -name <name of sequence (optional)>

so it looks like --reference is now a required option. It's not clear from the help if --reference means a .fa to be transformed into a .txt.gz, or if it's the .txt.gz to used as a reference for some input sequence to be aligned against. I tried supplying the former, but got NPE.

To Reproduce java -jar q3tiledaligner.jar --help , then run with a reference fasta as either --input or --reference argument hoping to generate a tiled aligner.txt.gz

Expected behavior I can generate a tiled aligner gz file by supplying some combination of options to java -jar q3tiledaligner.jar

Additional context In the bigger picture I was eventually able to do what I want by looking at the src and finding that the GenerateTiledAlignerFile main had the desired functionality

java -cp /software/adamajava/adamajava-release/78.43982c9/build/lib/q3tiledaligner.jar au.edu.qimr.tiledaligner.GenerateTiledAlignerFile

so this is not a feature request.

holmeso commented 2 years ago

Need to add an entry in the generated tiles file that indicates which reference was used to generate said file

holmeso commented 2 years ago

Need to add an entry in the generated tiles file that indicates which reference was used to generate said file

Actually, this has already been added