Coder Social home page Coder Social logo

bbknnr's Introduction

bbknnR

Use batch balanced KNN (BBKNN) in R

Introduction

BBKNN is a fast and intuitive batch effect removal tool for single-cell data. It is originally used in the scanpy workflow, and now can be used with Seurat seamlessly.

System requirements

bbknnR has been tested on R versions >= 4.1. Please consult the DESCRIPTION file for more details on required R packages. bbknnR has been tested on Linux platforms

To use the full features of bbknnR, you also need to install the bbknn python package:

pip install bbknn

Installation

bbknnR has been released to CRAN:

install.packages("bbknnR")

or can be installed from github:

devtools::install_github("ycli1995/bbknnR")

Quick start

library(bbknnR)
library(Seurat)
data("panc8_small")
panc8_small <- RunBBKNN(panc8_small, batch_key = "tech")

Release

1.1.0

  • Compatibility with Seurat v5
  • Improvements for documentation and verbose.

1.0.2

  • Explicit import of get_dummies.() from tidytable
  • Fix a bug when pass only one batch_key to RidgeRegression()

1.0.1

  • Import public function similarity_graph() from uwot==0.1.14 in compute_connectivities_umap() to follow the CRAN policy

1.0.0

  • Initially released to CRAN

Citation

Please cite this implementation R in if you use it:

Yuchen Li (2022). bbknnR: Use batch balanced KNN (BBKNN) in R.
package version 0.1.0 https://github.com/ycli1995/bbknnR

Please also cite the original publication of this algorithm.

Polanski, Krzysztof, et al. "BBKNN: fast batch alignment of single cell transcriptomes." Bioinformatics 36.3 (2020): 964-965.

bbknnr's People

Contributors

markfairbanks avatar ycli1995 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bbknnr's Issues

Prepare for upcoming Seurat v5 release

I am opening this issue as a notification because bbknnR is listed here as a package that relies (depends/imports/suggests) on Seurat. As you may know, we recently released Seurat v5 as a beta in March of this year, with new updates for spatial, multimodal, and massively scalable analysis. For more information on updates and improvements, check out our website https://satijalab.org/seurat/.
We are now preparing to release Seurat v5 to CRAN, and plan to submit it on October 23rd. While we have tried our best to keep things backward-compatible, it is possible that updates to Seurat and SeuratObject might break your existing functionality or tests. We wanted to reach out before the new version is on CRAN, so that there's time to report issues/incompatibilities and prepare you for any changes in your code base that might be necessary.

We apologize for any disruption or inconvenience, but hope that the improvements to Seurat v5 will benefit your users going forward.
To test the upcoming release, you can install Seurat from the seurat5 branch using the instructions available on this page: https://satijalab.org/seurat/articles/install.

Thank you!
Seurat v5 team

Return UMAP model with RunBBKNN

Hello, thanks for developing this package!

Can you please let me know how to return the UMAP model after running RunBBKNN?
This would substantially facilitate reference mapping based on an a BBKNN-generated reference.
I was trying to integrate this into the Seurat workflow but I had no success so far.

Something like this (return.model parameter)
seu <- RunUMAP(seu, reduction = "harmony", dims = 1:50, reduction.name = "umap.harmony", return.model = TRUE, umap.method = 'uwot')

Thank you!

Bug in uwot::umap

image

Strange bugs occur when I use a big number cells (about 70k). But using a smaller cluster seems to be good running.

Not all batches have at least 'neighbors_within_batch' cells in them.

Hello,
I am running bbknnR with code below
bbknnR::RunBBKNN(kera, batch=c('condition','dataset'))

where I get the error below

Running BBKNN using RcppAnnoy...
Error in bbknn_annoy(pca = object, batch_list = batch_list, neighbors_within_batch = neighbors_within_batch, :
Not all batches have at least 'neighbors_within_batch' cells in them.

Can anyone help me to figure out the problem??

Thanks!

Importing internal function from uwot

Hello, I am the maintainer of the uwot package. I recently attempted to submit a new version of uwot to CRAN to ensure it keeps working with a forthcoming version of the Matrix. Unfortunately, the submission failed because a change to an internal function (fuzzy_simplicial_set) broke your package.

A forthcoming submission will fix this issue, but please don't import internal functions from uwot into your packages if they are intended for use with CRAN. The reason fuzzy_simplicial_set is not in the NAMESPACE is because I don't want to promise to provide backwards compatibility for that function. It's also (at best) against the spirit of the CRAN submission policies:

  • CRAN packages should use only the public API. Hence they should not use entry points not declared as API in installed headers nor .Internal() nor .Call() etc calls to base packages. Also, ::: should not be used to access undocumented/internal objects in base packages (nor should other means of access be employed). Such usages can cause packages to break at any time, even in patched versions of R.

If you need the fuzzy_simplicial_set functionality, I would be happy to work on making it suitable for exporting as part of the public API and then I will commit to maintaining backwards compatibility. We can either discuss your needs here or please open an issue at the uwot repository.

bbknn not compatible with python

(base) xxxx@xxxxx:~/Documents/djangoproject$ conda install -c bioconda bbknn
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versionsThe following specifications were found to be incompatible with your system:

  • feature:/linux-64::__glibc==2.31=0
  • feature:|@/linux-64::__glibc==2.31=0
  • bbknn -> libgcc-ng[version='>=10.3.0'] -> __glibc[version='>=2.17']

Your installed version is: 2.31

And when i used pip directly, it installed successfully, but when I import it and ran it, I couldn't get any result.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.