bodenlab/GRASP

Calling get_subtree_sequences with wrong parameters give uninformative error message

julianzaugg opened this issue · 1 comments

Calling get_subtree_sequences() with no parameters will produce an informative error message -

> get_subtree_sequences()
Error in get_subtree_sequences() : 
  argument "asrStructure" is missing, with no default

Calling get_subtree_sequences with a structure object but no node specification provides mostly informative error message

> get_subtree_sequences(asrStructure)
Error in `[.data.frame`(fastaDF, fastaDF$Label == node, ) : 
  argument "node" is missing, with no default

Calling get_subtree_sequences with any non-structure parameter produces uninformative error message

> get_subtree_sequences(1234)
Error in asrStructure$fastaDF : $ operator is invalid for atomic vectors
> get_subtree_sequences("")
Error in asrStructure$fastaDF : $ operator is invalid for atomic vectors
> thing <- "I am a tree"
> get_subtree_sequences(thing)
Error in asrStructure$fastaDF : $ operator is invalid for atomic vectors
aesse commented

I'm not sure you'll ever be able to handle all of these errors gracefully but I have added extra handling to all functions to address these concerns. These changes are reflected in ASR_1.0.tar.gz and commit "Updates to address issue #1" (5951832)