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

Make sure all sample metadata columns are compatible before merging #252

Merged
merged 2 commits into from
Dec 20, 2023

Conversation

allyhawkins
Copy link
Member

I was noticing a recurring error when trying to run the merged workflow with the latest version of scpcaTools. Specifically I was getting the following error about the age columns:

Error in (function (cond)  : 
  error in evaluating the argument 'x' in selecting a method for function 'unique': Can't combine `..1$age` <double> and `..2$age` <character>.

In digging into this a little more, I was working with two processed objects that had differing types of age columns. One had character and the other had double. This is probably because we updated how we deal with the age column in https://github.com/AlexsLemonade/ScPCA-admin/pull/722. To avoid any future conflicts between the types of columns, I am converting them all to characters before creating the combined sample metadata.

I checked with what's going on in #251 and it looks like this section hasn't been touched, so it shouldn't cause any conflicts.

@sjspielman
Copy link
Member

sjspielman commented Dec 20, 2023

FYI I think (but am not sure precisely) something is funky with metadata that I was planning to circle back to after dealing with merging altexps. The funkinesss I was seeing is not what you found here, though! #250

Copy link
Member

@sjspielman sjspielman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main review is actually to loop @jashapiro in here since I'm not sure I have enough context about how metadata has generally been handled to really know for sure if making everything character is the right move!

R/merge_sce_list.R Outdated Show resolved Hide resolved
@allyhawkins
Copy link
Member Author

I'll go ahead and switch to request @jashapiro for review. But for some added context, all the other columns in the sample metadata are already characters. The only time we will have incompatibility is when we are merging SCE's that were processed before a few weeks ago with recently processed SCE objects. In that scenario one will have an age column that's a character and the other will have a double.

Co-authored-by: Stephanie Spielman <[email protected]>
@jashapiro
Copy link
Member

The changes in https://github.com/AlexsLemonade/ScPCA-admin/pull/722 shouldn't affect this, as that code is just to create the text files that are getting read in by scpca-nf. So something must have changed in scpca-nf or scpcaTools to generate this mismatch. My guess is it is in a place where we read in the metadata with readr and I probably added a default column type to quiet some messages. Since we never perform any math on the metadata, leaving it as characters is probably the safe thing to do.

Copy link
Member

@jashapiro jashapiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@allyhawkins allyhawkins merged commit f17b1ef into main Dec 20, 2023
2 checks passed
@allyhawkins allyhawkins deleted the allyhawkins/compatible-sample-metadata branch December 20, 2023 16:21
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.

3 participants