Load packages
Load data from 10X folder
For 10X data (cell ranger output), user can call readDataFrom10X() function to read expression data for both RNA and ADT at the same time.
# Load in the RNA UMI matrix
cbmc.data <- readDataFrom10X(dir = "../1K/filtered_feature_bc_matrix/")
Seurat object can be created from the list just read from 10X data
Load data from UMI matrix
For UMI matrix, user should load them as txt files.
# Load in the RNA UMI matrix
cbmc.rna <- as.sparse(x = read.csv(file = "../../Tutorial/data/GSE100866_CBMC_8K_13AB_10X-RNA_umi.csv.gz",
sep = ",", header = TRUE, row.names = 1))
cbmc.rna <- CollapseSpeciesExpressionMatrix(object = cbmc.rna)
# Load in the ADT UMI matrix
cbmc.adt <- as.sparse(x = read.csv(file = "../../Tutorial/data/GSE100866_CBMC_8K_13AB_10X-ADT_umi.csv.gz",
sep = ",", header = TRUE, row.names = 1))
For multiple mopdalities input, createObject() will only keep the cells appear in both modalities.
Load data from CSV file
For CSV files, user can load data using loadMatrix() function
# load UMI
rna.table <- read.table("../ECCITEseq/GSE108313_RAW/GSM2895282_Hashtag-RNA.umi.txt.gz",
header = TRUE, row.names = 1)
rna.table <- as.sparse(rna.table)
rna.table <- CollapseSpeciesExpressionMatrix(object = rna.table)
# load HTO
hto.table <- loadMatrix(file = "../ECCITEseq/GSE108313_RAW/GSM2895283_Hashtag-HTO-count.csv",
header = TRUE, row.names = 1)
# load ADT
adt.table <- loadMatrix(file = "../ECCITEseq/GSE108313_RAW/GSM2895284_Hashtag-ADT2-count.csv",
header = TRUE, row.names = 1)
For multiple mopdalities input, createObject() will only keep the cells appear in both modalities.
load TCR information from CSV file
User can load TCR/BCR information from CSV file
tcr.ab <- loadTable(file = "../ECCITEseq/GSE126310_RAW/GSM3596088_mx-TCRab.csv",
)
tcr.gd <- loadTable(file = "../ECCITEseq/GSE126310_RAW/GSM3596089_mx-TCRgd.csv")
tcr.ab[1:10, ]
## barcode is_cell contig_id high_confidence
## 1 AAACCTGCAAGTTGTC True AAACCTGCAAGTTGTC-1_contig_1 True
## 2 AAACGGGGTTAGAACA True AAACGGGGTTAGAACA-1_contig_1 True
## 3 AAAGCAAAGGGCATGT True AAAGCAAAGGGCATGT-1_contig_1 True
## 4 AAAGCAAGTATAGGGC True AAAGCAAGTATAGGGC-1_contig_1 True
## 5 AAAGCAAGTATAGGGC True AAAGCAAGTATAGGGC-1_contig_2 True
## 6 AAAGTAGAGAGAGCTC True AAAGTAGAGAGAGCTC-1_contig_1 True
## 7 AAATGCCAGCCGCCTA True AAATGCCAGCCGCCTA-1_contig_1 True
## 8 AAATGCCAGCCGCCTA True AAATGCCAGCCGCCTA-1_contig_2 True
## 9 AAATGCCAGCCGCCTA True AAATGCCAGCCGCCTA-1_contig_3 True
## 10 AAATGCCTCGAATGGG True AAATGCCTCGAATGGG-1_contig_1 True
## length chain v_gene d_gene j_gene c_gene full_length productive
## 1 493 TRB TRBV15 TRBD1 TRBJ1-2 TRBC1 True True
## 2 562 TRB TRBV3-1 TRBD2 TRBJ2-3 TRBC2 True True
## 3 277 TRB TRBV16 None None TRBC1 False None
## 4 416 TRB TRBV16 None None TRBC1 False None
## 5 468 Multi TRBV28 None None IGHG1 False None
## 6 527 TRB TRBV7-9 TRBD2 TRBJ2-3 TRBC2 True True
## 7 477 TRB TRBV16 None None TRBC1 False None
## 8 568 TRB TRBV6-5 TRBD1 TRBJ2-7 TRBC2 True True
## 9 479 TRA TRAV4 None TRAJ35 TRAC True None
## 10 498 TRB TRBV5-1 TRBD2 TRBJ1-1 TRBC1 True True
## cdr3
## 1 CATSRETGGYGYTF
## 2 CASSQNPTGLAVADTQYF
## 3 None
## 4 None
## 5 None
## 6 CASSLNEAGPATDTQYF
## 7 None
## 8 CASSLGQHRESYYEQYF
## 9 None
## 10 CASSVREDTEAFF
## cdr3_nt reads umis
## 1 TGTGCCACCAGCAGAGAGACAGGAGGGTATGGCTACACCTTC 1408 8
## 2 TGTGCCAGCAGCCAAAACCCGACGGGACTAGCGGTCGCAGATACGCAGTATTTT 5877 16
## 3 None 308 1
## 4 None 753 4
## 5 None 196 1
## 6 TGTGCCAGCAGCTTAAATGAGGCGGGACCCGCGACAGATACGCAGTATTTT 1243 6
## 7 None 1388 4
## 8 TGTGCCAGCAGCCTCGGACAGCACCGAGAAAGTTACTACGAGCAGTACTTC 861 4
## 9 None 214 1
## 10 TGCGCCAGCAGTGTGCGGGAGGACACTGAAGCTTTCTTT 1862 4
## raw_clonotype_id raw_consensus_id
## 1 clonotype17 clonotype17_consensus_1
## 2 clonotype18 clonotype18_consensus_1
## 3 None None
## 4 None None
## 5 None None
## 6 clonotype19 clonotype19_consensus_1
## 7 clonotype1 None
## 8 clonotype1 clonotype1_consensus_1
## 9 clonotype1 None
## 10 clonotype20 clonotype20_consensus_2