Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
richelbilderbeek opened this issue Jul 19, 2023 · 2 comments

Comments

@richelbilderbeek
Copy link

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:

  • Short description of the problem
  • Suggested solution
  • Detailed description with reprex

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
Copy link
Member

riederd commented Jul 19, 2023

Thanks for reporting. I'm implementing a fix

@richelbilderbeek
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants