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

Issue with loading old liger object via convertOldLiger function #307

Open
ellenbouchard opened this issue Mar 23, 2024 · 3 comments
Open

Comments

@ellenbouchard
Copy link

Dear Welch lab/liger team,

I'm hoping for some help with figuring out how to load in an old liger object that is giving me issues.

The object is from a previously published dataset from early 2023. I'm happy to include a link to the dataset here, if necessary.

When I first attempt to load in the object using readRDS I get the following error:

Error in .checkObjVersion(): ! Old version of liger object is detected. Please run: object <- convertOldLiger(object)

When I then try to run the indicated convertOldLiger function, I get the following error:

! Skipped slot U which is not available. ✖ Inconsistent row ID in slot normData. Error in validObject(.Object) : invalid class “ligerDataset” object: Features in scaleData not found from dataset: [features]

and the object fails to load.

The problem is, because I can't get the object loaded in any form, I can't try and troubleshoot any individual steps of the object conversion function.

Any tips, advice, or feedback would be greatly appreciated! Thank you very much for your time.

@mvfki
Copy link
Collaborator

mvfki commented Mar 23, 2024

Hi,

Thanks for trying out our new version. Two things I can think of:

  1. By readRDS(), to my experience, the object is indeed loaded into the environment but just not shown in the "environment" panel of your RStudio. If you try operators like:
obj <- readRDS("oldfile.rds")
obj@norm.data

It should show you a list of normalized matrices. and similar for the [email protected]

  1. However, force doing those above should probably keep spamming error messages on your screen. You can downgrade the package back to version 1.0.1 and normally load it, and have checks on the colnames and rownames of the matrices. In rliger2.0.0, we added strict checkpoints for cell and feature consistency to prevent potentially erroneous operations. What you will want to look at is, regard the row/colnames of the [email protected] as the baseline, see if those in norm.data are identical. scale.data should be feature subset and transposed (cell x gene) in the old version, and you can see if the features are available in rownames([email protected][["datasetName"]]).

Above is kind of the overall idea of what should be taken care of, please feel free to reach out if you still see a problem.

Here's a figure on the new documentation website that roughly shows how the structure of a liger object is refactored:

ligerObjDemo

Let's keep this Issue open for people coming for rliger2 structure issues.

Appreciate it!
Yichen

@ellenbouchard
Copy link
Author

ellenbouchard commented Mar 23, 2024

Thank you very much for the quick response and helpful resources! I will try that and add an update here with the outcome.

UDPATE: I was able to easily generate the new liger object by first reading in the old liger object as before and then manually working through the steps in the convertOldLiger function. (However, upon further inspection of the original object, I discovered that it does not include some critical metadata for my intended analysis, so I will have to stop at this point).

@mvfki
Copy link
Collaborator

mvfki commented Mar 24, 2024

Nice to hear that! By metadata did you mean some variables in [email protected]? You can use cellMeta<- method to manually insert any variable since you've already constructed an object of the new version. If a variable is named, the names will also be checked. Note that a prefix like "{datasetName}_" might have been added to the object colnames so that might creat some barriers.

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

2 participants