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

version field duplicated in int_metadata after concatenating two SCE objects #65

Open
lambdamoses opened this issue Apr 14, 2022 · 4 comments

Comments

@lambdamoses
Copy link

I don't think this affects the users, but I found out this issue when writing a cbind method for a class that inherits from SCE and it caused a unit test to fail. Here's the reprex:

# From an example from the SCE package
ncells <- 100
u <- matrix(rpois(20000, 5), ncol=ncells)
v <- log2(u + 1)

pca <- matrix(runif(ncells*5), ncells)
tsne <- matrix(rnorm(ncells*2), ncells)

sce <- SingleCellExperiment(assays=list(counts=u, logcounts=v),
    reducedDims=SimpleList(PCA=pca, tSNE=tsne))

Then see the int_metadata in the R console.

> int_metadata(sce)
$version
[1] ‘1.15.2’

Now I concatenate the same SCE object

sce2 <- cbind(sce, sce)

And got this:

> int_metadata(sce2)
$version
[1] ‘1.15.2’

$version
[1] ‘1.15.2’
@drisso
Copy link
Owner

drisso commented Apr 15, 2022

Hi @lambdamoses ,

thanks for reporting this. @LTLA is this the intended behavior?

I would imagine that each object should have only one version, but on the other hand, can you combine two objects with different versions? And in this case, would you want to keep track of this? Or which version should "win"?

@LTLA
Copy link
Collaborator

LTLA commented Apr 15, 2022

Probably just a consequence of mimicking the default behavior for SE's cbind.

In this case, the correct behavior would be to replace both versions with the current version, given that cbind should return an SCE with its internal structure updated to the current version of the package.

@lambdamoses
Copy link
Author

If both are replaced by the current version, then there really should be one version field in the int_metadata in the concatenated object, not two duplicated ones.

@LTLA
Copy link
Collaborator

LTLA commented Apr 15, 2022

Yes, that would be the intent.

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

3 participants