fsctype

Modification of the Original ScType Method for Barcode Annotation using KNN Algorithm

https://github.com/shahrozeabbas/fsctype

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.1%) to scientific vocabulary

Keywords

annotation-tool celltype-annotation seurat single-cell spatialtranscriptomics
Last synced: 6 months ago · JSON representation ·

Repository

Modification of the Original ScType Method for Barcode Annotation using KNN Algorithm

Basic Info
  • Host: GitHub
  • Owner: shahrozeabbas
  • License: gpl-3.0
  • Language: R
  • Default Branch: main
  • Homepage:
  • Size: 46.9 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
annotation-tool celltype-annotation seurat single-cell spatialtranscriptomics
Created over 2 years ago · Last pushed about 2 years ago
Metadata Files
Readme License Citation

README.md

fsctype - Modification of the Original ScType Method for Barcode Annotation using the KNN Algorithm

Description

The fsctype method is based on the original ScType method used for cluster annotation of single-cell datasets using known markers.

This variation uses the data.table package to substantially speed up calculations and also makes use of the future package for parallel execution.

A typical dataset of 10,000 barcodes or less will run in under 10 seconds in a memory efficient way. You should only rely on parallel execution if your dataset is larger than 50,000 barcodes as the speed up is minimal otherwise and not noticeable.

This method is different than the original in that instead of relying on precomputed clusters for annotation, it traverses each barcode in a neighborhood graph and uses the k nearest-neighbors to assign a per-cell annotation using the original ScType calculation.

Installation

You can install all required packages directly from CRAN

install.packages(c('Seurat', 'dplyr', 'ggplot2', 'data.table', 'igraph')) or via mamba and the environment file that is provided. mamba env create -f fsctype.yml

Tutorial

This method is highly sensitive to the marker genes used. The more specific your markers are the better the annotation will be. You can use the marker genes from the original ScType database or provide your own, as long as the input marker list is created to look like the output of gene_sets_prepare.R from the original method. In other words, you need a nested named list with at least positive markers for your cell types or regions of interest.

Your dataset must be processed up to the shared neighborhood graph calculation or some igraph object with similarity weights for edges.

``` pkgs <- c('Seurat', 'dplyr', 'ggplot2', 'data.table', 'igraph') invisible(lapply(pkgs, require, character.only=TRUE))

object <- CreateSeuratObject(counts=Read10Xh5('filteredfeaturebcmatrix.h5'))

object <- object %>%

            NormalizeData() %>%
            FindVariableFeatures() %>%
            ScaleData(verbose=FALSE) %>%
            RunPCA(verbose=FALSE) %>%
            FindNeighbors(dims=seq(10)) %>%
            RunUMAP(dims=seq(10))

```

Once you have run FindNeighbors, you can use this graph downstream for fsctype as it relies on the k nearest neighbors of each cell for annotation. The annotation_markers_list.rds is a created marker list as defined by gene_sets_prepare.R. You can use this from the original ScType method or create your own.

``` source('https://raw.githubusercontent.com/shahrozeabbas/fsctype/main/R/fsctype.R')

markers <- readRDS('annotationmarkerslist.rds')

counts <- as.data.frame( object %>% Seurat::ScaleData(verbose=FALSE, features=unique(unlist(markers))) %>% Seurat::GetAssayData(slot='scale.data') )

cells <- colnames(object) graph <- object %>% get_graph() k <- round(sqrt(ncol(object) * 0.5))

predictions <- fsctype(barcodes=cells, graph=graph, counts=counts, markers=markers, n_neighbors=k)

celltype <- predictions[, prediction] names(celltype) <- predictions[, barcodes] object <- object %>% AddMetaData(metadata=factor(celltype), col.name='celltype')

ggplot2::ggsave( width=12, height=8, filename='fsctypepredictionsumap.png', plot=DimPlot(object, group.by='cell_type', label=TRUE, repel=TRUE, pt.size=1) )

```

If you use fsctype please cite using the link under the 'About' section.

Owner

  • Name: Shahroze Abbas
  • Login: shahrozeabbas
  • Kind: user
  • Location: Arlington, VA
  • Company: National Institutes of Health - NCI

Bioinformatics Scientist for the Pediatric Oncology Branch at the NCI

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: fsctype
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Shahroze
    family-names: Abbas
    email: shahroze@datatecnica.com
    affiliation: Data Tecnica
repository-code: 'https://github.com/shahrozeabbas/fsctype'
license: GPL-3.0
version: '1.0'
date-released: '2023-10-09'

GitHub Events

Total
  • Push event: 2
Last Year
  • Push event: 2