R/Spatial_VDJ_assignment.R
Spatial_VDJ_assignment.Rd
Assign simulated immune repertoire sequences (BCR or TCR) simulated by Echidna to transcriptome and location in a spatial image in function of cell type.
Spatial_VDJ_assignment(
GEX_matrix,
vgm,
vgm_VDJ,
celltype,
simulated_VDJ,
method = c("random", "density", "germline")
)
Dataframe containing barcode, imagecol and imagerow from bcs_merge.
Output of VDJ_GEX_matrix function with already the simulated VDJ data.
Dataframe from VDJ_GEX_matrix output (vgm[[1]]).
Character designating the cell type that we want to study either "B" or "T".
Large list, output of Echidna simulate_repertoire function. Only needed if we use simulated data.
Character to chose the assignment method of BCR or TCR to transcriptomic information, it can be "random", "density" or "germline".
A dataframe corresponding to the VDJ (VGM[[1]]) with GEX_barcode and x, y coordinates column (allowing to localise each BCR or TCR on the spatial image).
if (FALSE) {
#1)Assignment random to GEX
random_BCR_assignment <- Spatial_VDJ_assignment(GEX_matrix = GEX_matrix,
vgm = vgm_with_simulated_VDJ,
vgm_VDJ = vgm_with_simulated_VDJ$VDJ, celltype = "B",
simulated_VDJ = simulated_B_cells_VDJ, method = "random")
#2)Assignment density-based
density_BCR_assignment<-Spatial_VDJ_assignment(GEX_matrix = GEX_matrix,
vgm = vgm_with_simulated_VDJ,
vgm_VDJ = vgm_with_simulated_VDJ$VDJ, celltype = "B",
simulated_VDJ = simulated_B_cells_VDJ, method = "density")
#3)Assignment germline-based
germline_BCR_assignment<-Spatial_VDJ_assignment(GEX_matrix = GEX_matrix,
vgm = vgm_with_simulated_VDJ,
vgm_VDJ = vgm_with_simulated_VDJ$VDJ, celltype = "B",
simulated_VDJ = simulated_B_cells_VDJ, method = "germline")
}