Giter Site home page Giter Site logo

rnabioco / djvdj Goto Github PK

View Code? Open in Web Editor NEW
23.0 4.0 4.0 112.57 MB

An R package to analyze single-cell V(D)J data

Home Page: https://rnabioco.github.io/djvdj

License: Other

R 99.99% CSS 0.01%
single-cell-rna-seq immunoinformatics immunology vdj

djvdj's People

Contributors

jayhesselberth avatar kwells4 avatar raysinensis avatar sheridar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

djvdj's Issues

Cell barcodes do not match those in the object

I am trying to add VDJ data to a Seurat gene expression object and I run into this error.

library(djvdj)
female1 <- import_vdj(female,vdj_dir=c("tcr"="data/raw/project/count/PBMC_1_3_2/outs/per_sample_outs/PBMC_1_3_2/vdj_t/"),cell_prefix="-1",filter_contigs=TRUE)

Error in .merge_meta(input, res) : 
  Cell barcodes do not match those in the object, are you using the correct cell barcode prefixes?

If I check manually, the cell labels in the Seurat object and in the VDJ (airr_rearrangement.tsv for example) has the same format


> head(rownames(female[[]]))
[1] "AAACCTGTCTACTATC-1" "AAAGATGCAACTGCGC-1" "AAAGCAACAGCCAGAA-1"
[4] "AAAGCAATCCTCGCAT-1" "AAAGTAGGTCACCTAA-1" "AAAGTAGGTCGTCTTC-1"

head(read.table("data/raw/2021_084_Maria/count/PBMC_1_3_2/outs/per_sample_outs/PBMC_1_3_2/vdj_t/airr_rearrangement.tsv",sep="\t",header=TRUE)$cell_id)
[1] "AAACCTGTCTACTATC-1" "AAACCTGTCTACTATC-1" "AAAGCAACAGCCAGAA-1"
[4] "AACACGTGTGGTGTAG-1" "AACCATGTCGCAAACT-1" "AACCATGTCGCAAACT-1"

In fact, I have quantified the overlap between gene-expression and vdj.

a1    a2     a1_cells  a2_cells   shared_cells percent_shared
ge    vdj-b  523       12         12           2.3
ge    vdj-t  523       241        241          46

VDJ-B is not good, but VDJ-T has 46% overlap. So I would expect the overlapping cells to have the metadata added and others to have NAs. Also, is it possible to add only VDJ-T without VDJ-B?

R version 4.1.0 (2021-05-18)
djvdj: "0.0.0.9000"

input for djvdj

hello,
what output from cellranger can be used as input for djvdj to look at gene usage?
also, can this be customised...e.g. showing specific barcodes, rather than all those from cellranger?

thanks
ibseq

New diversity metric

  • inverse Simpson Index is not very useful when comparing clusters of different sizes
  • Include other methods?

Order of articles on package site

  • Currently articles are listed in alphabetical order in "Articles" menu on site
  • Would be better if we could specify the order so more basic ones are listed first, e.g. data import

Citation?

Really great tool! Maybe I missed it, but was hoping to cite this tool in a paper we are publishing and can't see if there is something to cite. Can always just cite the github directly, but was wondering if there is a paper, etc, I should cite instead? Thanks!

TCR antigene prediction

It would be also interesting if you could somehow integrate a function for TCR antigen prediction by comparing the TCR seqs with published TCR antigen-specific datasets, something similar to TCRmatch,
anther databases that might be of interest
VDJdb, TCRex, immuneML, TCRGP, NetTCR, ERGO ,DeepTCR, ImRex

targets <- antigen_predection(seuratobj, cellnames ="listofcellsname")

head(targets)
cellnames CDR3b CDR3a antigen score


Best way to store VDJ data in object

  • Often only some cells will have VDJ data available
  • Seurat does not like it when reductions, graphs, etc. only contain data for a subset of cells in the object

error while running import_vdj

HI,

I ran the following to add BCR data but got the both TCR and BCR chains are present error. But the input is only a BCR file.
Will you please let me know how to solve this?

Thanks

bcr_added=import_vdj(
input=seurat_obj,
vdj_dir = "BCR_data/sample_data/",
)

Error in .f(.x[[i]], ...): Malformed input data, both TCR and BCR chains are present.

Add useful examples

Jotting these down for reference to add later

filter_vdj()

#' @examples
#' # filter for cells with specific numbers of chains
#' filter_vdj(tiny_vdj, length(chains) == 3)

Clone similarity between samples

Hi, thank you for the program, it is very useful. We are looking to compare TCR/BCR sequences between samples to observe which cdr3 sequences are the same between samples. Is there a way to generate a list of conserved CDR3 sequences between multiple samples in a series, and perhaps a % which are the same as well? Using the calc_similarity with abdiv-jaccard, between two samples which appeared by eyeballing to have many overlapping TCR cdr3 sequences, it provided a jaccard calculation of 0.9712919 (which indictaes mostly dissimilar?). Thank you.

Andrew

Potential Features

  • Antigen affinity score
    • Incorporates AVID-seq counts and total receptor counts (CITE-seq/GEX counts)
  • Add VDJ data from cellranger to Seurat object
  • Receptor diversity
    • inverse Simpson index
  • Repertoire overlap
    • Jaccard index
    • Morisita-Horn Index
  • Cluster based on BCR sequence
    • wrapper for enclone
  • Plotting functions
    • Rarefaction curves

Identify useful data sets

  • Probably don't want to bundle AVID-seq data until it's published.
  • LIBRA-seq?
  • Other large TCR or BCR sequencing data sets?

Get complete TCR seq for cloning

Get complet TCR seq for cloning
seq <- fetch_complet_seq(object =seuratobj, cell_names = c("list_of_cells_names"))
Head(seq)
cellname cdr3a_nt cdr3b_nt cd3a cdrb tcra_chain tcrb_chian complete_tcra_seq complete_tcrb_seq
ATGTAGAG ATG ATG KLV KLV Trav15-Traj12 Trab6-trbj12 xxxxxxxxx xxxxxxx

Originally posted by @Ahmedalaraby20 in #95 (comment)

ROC analysis of CITE-seq / AVID-seq reagents

Thoughts on ROC analysis of protein-DNA tags as classifiers.

The question is how well a given reagent performs as a classifer relative to gene expression classifications (i.e., assuming these are the "gold standards"). AUC values could provide information about reagent quality and can be compared across reagents, batches, etc.

For a function roc_analysis(), Input data would be so or sce with:

  1. Cell type classifications based on gene expression (e.g. based on clustifyr)
  2. Raw or normalized counts of protein-DNA tags (CITE-seq antibodies, AVID-tags, antigen-DNA tags, etc)

For a comparison, assume two possible states (e.g., B vs T cell, or B cell vs all other cells). Then step through the range of recovered protein-DNA tag signal and calculate:

  1. True positive rate (TP / (TP + FN)). TP = number of B cells scoring positive, FN = number of B cells scoring negative.
  2. False positive rate (FP / FP + TN). FP = number of T cells scoring positive, TN = number of T cells scoring negative.

plot_roc() would plot TPR vs FPR for each of the ranked detection values, and roc_auc() would provide the AUC value from the data.

cc @catherinenicholas

Installing issue

Hey guys,
I have been trying to install djvdj but unfortunately I always end up with this error.

devtools::install_github("rnabioco/djvdj")

Error: Failed to install 'unknown package' from GitHub:
Timeout was reached: [api.github.com] Connection timed out after 10000 milliseconds

What am I doing wrong

DMS BCR experiment

Have been thinking lately about doing a deep mutational scan on the MD4 BCR. Would be different way to see if changes in affinity can be accurately measured by AVID-seq.

test for blank ggplot?

What is the best way to test for a blank ggplot?

library(testthat)
library(tidyverse)

dat <- tibble(
  x = seq(1, 10),
  y = x ^ 2
)

this throws an error:

dat %>%
  ggplot(aes(x, A)) +
  geom_point()

but the error is not caught:

expect_error(
  dat %>%
    ggplot(aes(x, A)) +
    geom_point(),
  NA
)

djvdj for SingleCellExperiment objects

Hi guys,

thanks for the very useful selection of functions you've created for interacting with VDJ data! I've started to edit the functions so that they'll work with SingleCellExperiment objects, too: https://github.com/friedue/SCEdjvdj

Feel free to link to it if someone comes asking; forks and contributions very welcome, of course.

Cheers,

Friederike

import_vdj function error

Hi, when I run the import_vdj function, I got the error message: "Malformed input data, NAs are present, check input files". Do you have any pointers on where I should troubleshoot? I checked the filtered_contig_annotations.csv file from the cellranger outs folder, and I do not find anything weird (except that the d_gene column has some NA values).

More visualization methods

Hey guys,
Would be really nice if you could include more visualization methods such as Circos
Thanks alot

import_vdj features

  • Automatically add isotype to meta.data for BCR data
  • Print fraction of cells with VDJ data

import vdj break when clonotype id is NA

Hi,
Thanks for your great work on djvdj.
I had some problem with the import function. When the clonotype id is NA the function don't concatenate the row, the function can't use barcode as metadata and break.

thanks a lot

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.