BrooksLabUCSC / flair

Full-Length Alternative Isoform analysis of RNA
Other
201 stars 69 forks source link

flair correct doesn't exit non-zero when an invalid argument is supplied #293

Open diekhans opened 10 months ago

diekhans commented 10 months ago

I accidentally added --keep_intermediate to correct, it printed an error but continued to execute rather than exit non-zero

 python ../flair/flair.py correct --query flair.aligned.bed --genome ../refs/GRCh38.primary_assembly.genome.fa --gtf
../refs/gencode.v43.primary_assembly.annotation.gtf --shortread ../refs/H0.introns.bed --threads 32 --keep_intermediate
Starting correct...
Correct unrecognized arguments: --keep_intermediate
Flair correct took 5 minutes and 49 seconds

Flair took 5 minutes and 49 seconds and finished without issues.
Jeltje commented 10 months ago

That is by design. When you call flair 123 each subprogram gets one or two parameters it doesn't understand. It's just a warning.

diekhans commented 10 months ago

It is a bad design; it doesn't pass the "this is how most programs work" test.

Having a typo in an argument can cause a program to not do what was intended. Which is easily missed, since it is run in batch jobs. Weeks or months of user time can be wasted because a warning wasn't noticed in a log file. I don't even read log files if the jobs don't fail. I don't know anyone who does.

123 is also doesn't pass the "this is how most programs work" test. It is not what I would want to use to run the full pipeline.

A much more useful tool would be to run up to this step (say collapse). If it there is a crash, you fix the problem and just restart. Just pick up where it left off, not rerunning work that was already done.

diekhans commented 10 months ago

An easy short-term workaround would have flair 123 set an environment variable that says to ignore invalid parameters.

One would still get confusing warnings with 123, but at least the modules would be robust.