matsengrp / sumrep

Summary statistics for repertoires
16 stars 6 forks source link

improve Traceback calls #20

Open Pezhvuk opened 5 years ago

Pezhvuk commented 5 years ago

Hi Branden,

Perhaps, the hardest issue with debugging, that I have noticed, is the lack of comprehensive Traceback calls, as in the following report:

[1] "/d/as2/u/mp002/sumrep_project/Gupta/igblast"
[1] "/d/as2/u/mp002/sumrep_project/Gupta/fasta/S-GMC_+14d.fasta"
[1] "igblast_S-GMC_+14d_output.tsv"

 /d/harpy1/s/python/v3-5.1.0/bin/AssignGenes.py igblast -s /d/as2/u/mp002/sumrep_project/Gupta/fasta/S-GMC_+14d.fasta -b /d/harpy1/s/igblast/ncbi-igblast-1.12.0 --organism human --loci ig --format airr --exec /d/harpy1/s/igblast/ncbi-igblast-1.12.0/bin/igblastn -o /d/as2/u/mp002/sumrep_project/Gupta/igblast/igblast_S-GMC_+14d_output.tsv --nproc 12 
<simpleError in data.table::fread(., stringsAsFactors = TRUE): File '/d/as2/u/mp002/sumrep_project/Gupta/igblast/igblast_S-GMC_+14d_output.tsv' does not exist or is non-readable. getwd()=='/d/harpy1/s/igblast/ncbi-igblast-1.12.0'>
Warning message in file.remove(.):
“cannot remove file '/d/as2/u/mp002/sumrep_project/Gupta/igblast/igblast_S-GMC_+14d_output.tsv', reason 'No such file or directory'”
Error in getIgBlastAnnotations(input_fileName, output_filename = outputName, : object 'annotations' not found
Traceback:

1. getIgBlastAnnotations(input_fileName, output_filename = outputName, 
 .     num_threads = NO_threads, receptor_type = "BCR", igblast_dir = "/d/harpy1/s/igblast/ncbi-igblast-1.12.0", 
 .     changeo_dir = "/d/harpy1/s/python/v3-5.1.0/bin")

I think the problem has something to do with the sys command for some reason, but there isn't enough info to resolve it. I am experiencing a similar problem with PartisFunctions, too (will post separately). This particular issue actually turned to be two-fold, the sys command, as well as the absence of germline genes in the expected directory, i.e. ~/shared directory, which would be a problem for the AssignGenes.py script. The AssignGenes.py, I believe, reports this problem, but this is not reflected in the Sumrep error report.

I eventually resolved this issue by changing the assignment to the igblast_command function (the one within the igBlastFunction.R script) by directly passing the command-line command for igblast.

Best, Peji.

BrandenOlson commented 5 years ago

Hey Peji -

Thanks for the info regarding this error. I'll be sure to add an informative error message for this situation.

I absolutely agree that tracebacks could be clearer. I'm currently looking into the cleanest way to incorporate this into general and will keep you updated. I should have more time to work on this once this quarter ends next week.

Pezhvuk commented 5 years ago

Hi Branden,

No problem. :)

I am going to try something and see if all the system related error reports could be improved by changing how the system functions are passed, e.g. changing igblast_command %>% system to system(igblast_command, intern=True), or something similar. I will try this for Partis today, and will be in touch shortly.