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

mergeSequenceTables says what's wrong when stopping #932

Merged
merged 3 commits into from
Feb 3, 2020

Conversation

wbazant
Copy link
Contributor

@wbazant wbazant commented Jan 31, 2020

I've had the error that "At least two valid sequence tables, and no invalid objects, are expected." when running the function on contents of a folder. I didn't know which of the ~600 tables is wrong, and to find out that it was 553_featureTable.rds, I needed to do a bit of digging: find where the error comes from, open the R session with is.sequence.table , etc.

If the error message says what the problem is, it might save the user a bit of time.

Same rationale for duplicate sample names.

Also adds a check for the case of less than two tables passed in.

@benjjneb
Copy link
Owner

benjjneb commented Feb 1, 2020

Small thing: Can you change "table" to "sequence table" in the error messages.

Second: What happens in the second error message if the tables are unnamed?

Third: There will be cases in which a large number of sample names (or maybe table names) are duplicated. This can lead to overlong and confusing error messages. The preferred behavior here would be to report a max number of duplicates, with an ellipsis at the end.

@wbazant
Copy link
Contributor Author

wbazant commented Feb 3, 2020

Thank you, all good points!

Made another commit with better messages.

I've checked what happens when tables are unnamed: names() seems to return NULL, and paste0(NULL) returns an empty string.

Also stop() (or at least my version of it in the interactive R session) truncates long error messages, it doesn't have the ... but to me it looks kind of clear what happened, I wouldn't try to improve on this.

R/multiSample.R Outdated Show resolved Hide resolved
@benjjneb
Copy link
Owner

benjjneb commented Feb 3, 2020

Look good except perhaps for https://github.com/benjjneb/dada2/pull/932/files#diff-4d02e5797bedf79c524bc1b3b7aeed18R314

I posted detailed comment there.

@benjjneb
Copy link
Owner

benjjneb commented Feb 3, 2020

LGTM, thanks!

@benjjneb benjjneb merged commit 8c642f2 into benjjneb:master Feb 3, 2020
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

Successfully merging this pull request may close these issues.

2 participants