-
Notifications
You must be signed in to change notification settings - Fork 15
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
add input checks in pre-msa-tree #74
Conversation
Signed-off-by: Awa Synthia <ndahili14@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these additions!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor Qs. thanks for PR!
abort("Error: Alignment file path must be provided.") | ||
} | ||
|
||
if (!file.exists(aln_file)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove extra spaces or use paste0 if we're introducing spaces? [or do the tests work out OK?]
@@ -218,6 +245,19 @@ addLeaves2Alignment <- function(aln_file = "", | |||
addName <- function(data, | |||
accnum_col = "AccNum", spec_col = "Species", lin_col = "Lineage", | |||
lin_sep = ">", out_col = "Name") { | |||
# Check if the data is a data fram | |||
if (!is.data.frame(data)) { | |||
abort("Error: The input 'data' must be a data frame") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing full stop
abort("Error: Alignment file path must be provided.") | ||
} | ||
|
||
if (!file.exists(aln_file)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space Qs here, too.
Description
What kind of change(s) are included?
[FEAT] Add error handling for functions #30
Bug fix (fixes an issue).
Enhancement (adds functionality).
Breaking change (these changes would cause existing functionality to not work as expected).
Checklist
Please ensure that all boxes are checked before indicating that this pull request is ready for review.