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

iLISI function #95

Merged
merged 13 commits into from
Aug 17, 2022
Merged

iLISI function #95

merged 13 commits into from
Aug 17, 2022

Conversation

sjspielman
Copy link
Member

@sjspielman sjspielman commented Aug 16, 2022

Closes #89

Stacked on #92

This PR adds the file scripts/utils/calculate-iLISI.R to calculate iLISI scores. I also added this function to the testing script for testing. Along the way, I ended up also updated the fastMNN function to use an all lowercase prefix (i.e. fastmnn, not fastMNN) when saving the dimension reductions into the object. This ensures consistency among all functions which check arguments by converting to lowercase.

The iLISI function will return a tibble with four columns, where each row represents the score for a given cell. Columns are:

  • the iLISI score for that cell
  • the cell's barcode
  • the cell's originating library
  • the method that was used for integration

A couple questions I have for reviewers:

  • I am using an input argument of integration_method, but I could just as easily do something like pc_name. The provided info would then be something like harmony_PCA, and then I could split out the method name to include in the final output. I don't think this makes much of a difference.
  • In the final tibble, the cell_barcode column is just the barcode, not barcode-library format which is how cells are labeled in the merged and integrated SCE objects. Do we think I should keep the barcode-library format for this export too?

Edit: I just updated this to pull out the code into a function that checks for a properly-provided integration method, since all upcoming functions which calculate metrics will need something like this!

Copy link
Member

@allyhawkins allyhawkins left a comment

Choose a reason for hiding this comment

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

This looks pretty good! Just a few minor comments.

scripts/utils/calculate-iLISI.R Outdated Show resolved Hide resolved
scripts/utils/calculate-iLISI.R Outdated Show resolved Hide resolved
scripts/utils/calculate-iLISI.R Outdated Show resolved Hide resolved
scripts/utils/test_integration-functions.R Outdated Show resolved Hide resolved
@sjspielman
Copy link
Member Author

For the final columns, I ended up keeping all of the following: cell_name (the combined barcode-library), cell_barcode, and library. I can select out cell_barcode if we want. I also realized I was missing path info for sourcing the helper functions, so I fixed that.

@sjspielman sjspielman requested a review from allyhawkins August 17, 2022 19:36
Copy link
Member

@allyhawkins allyhawkins left a comment

Choose a reason for hiding this comment

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

Looks good! Just one minor error I think

scripts/utils/calculate-iLISI.R Outdated Show resolved Hide resolved
@sjspielman sjspielman merged commit ca81349 into jashapiro/update-R Aug 17, 2022
@sjspielman sjspielman deleted the sjspielman/ilisi_function branch August 17, 2022 20:24
@jashapiro jashapiro restored the sjspielman/ilisi_function branch August 17, 2022 20:25
@sjspielman
Copy link
Member Author

sjspielman commented Aug 17, 2022

Yeah I did a silly thing here merging-wise, sorry @jashapiro

@sjspielman
Copy link
Member Author

@allyhawkins Silly things happened with merging here which mean I'll have to re-file this PR to main, so you'll be invited to do another "review" shortly..

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