icbi-lab / nextNEOpi

nextNEOpi: a comprehensive pipeline for computational neoantigen prediction
Other
65 stars 23 forks source link

Check if files exist, better error message than 'Cannot get property 'simpleName' on null object' #36

Closed richelbilderbeek closed 12 months ago

richelbilderbeek commented 1 year ago

Dear nextNEOpi maintainers,

Here I submit a suggestion as both me and a colleague independently ran into the same problem and both of us would enjoy a better error message.

Below I supply:

I hope you'll agree that this would make nextNEIpi even better :-)

Thanks and cheers, Richel Bilderbeek

Short description of the problem

Line L4696 in nextNEOpi.nf ...

val yaraIdx from Channel.value(reference.YaraIndexDNA[0].simpleName)

... does not check if the array YaraIndexDNA has actual elements, which gives an uninformative error if the reference files needed do not exists:

Cannot get property 'simpleName' on null object

 -- Check script 'nextNEOpi.nf' at line: 4696 or see '.nextflow.log' file for more details

(from this GitHub Actions error log, need to be logged in into GitHub before being able to see it)

Suggested solution

Make Line L4696 in nextNEOpi.nf check if all the files it expects are in place. Maybe that line is not the best place to do so; you are the experts here.

Detailed description with reprex

To reproduce this example, do (and all code is in this GitHub repository):

git clone https://github.com/richelbilderbeek/nextNEOpi_example_1
cd nextNEOpi_example_1
./scripts/run.sh

(which is the same as done in the GitHub Actions script)

As there is no small/testing data yet, I try to create the reference folders myself, using the script create_fake_references.sh, which only copies the a file called hg38.len to the right folder.

The error caused is this approach is, of course, that the actual reference data is not created. And here I would expect a proper error message.

One cause argue that 'one should not do that', but my colleague had the same error from trying out to get nextNEOpi running. I am unsure what he did, but he was not creating a reprex like I did. Also for him, I would expect a proper error message.

riederd commented 1 year ago

Thanks for reporting. I'm implementing a fix

richelbilderbeek commented 1 year ago

Thanks @riederd, I (and other users) appreciate that a lot! Keep up the good job :-)