Read the barcodes, features (genes), and matrices from STARsolo outputs. Import them as one SingleCellExperiment object.
importSTARsolo( STARsoloDirs, samples, STARsoloOuts = "Gene/filtered", matrixFileNames = "matrix.mtx", featuresFileNames = "features.tsv", barcodesFileNames = "barcodes.tsv", gzipped = "auto", class = c("Matrix", "matrix"), delayedArray = FALSE )
STARsoloDirs | A vector of root directories of STARsolo output files.
The paths should be something like this:
/PATH/TO/prefixSolo.out. For example: |
---|---|
samples | A vector of user-defined sample names for the sample to be
imported. Must have the same length as |
STARsoloOuts | Character vector. The intermediate
paths to filtered or raw cell barcode, feature, and matrix files
for each of |
matrixFileNames | Filenames for the Market Exchange Format (MEX) sparse
matrix file (.mtx file). Must have length 1 or the same
length as |
featuresFileNames | Filenames for the feature annotation file.
Must have length 1 or the same
length as |
barcodesFileNames | Filenames for the cell barcode list file.
Must have length 1 or the same
length as |
gzipped | Boolean. |
class | Character. The class of the expression matrix stored in the SCE object. Can be one of "Matrix" (as returned by readMM function), or "matrix" (as returned by matrix function). Default "Matrix". |
delayedArray | Boolean. Whether to read the expression matrix as
DelayedArray object or not. Default |
A SingleCellExperiment
object containing the count
matrix, the gene annotation, and the cell annotation.
# Example #1 # FASTQ files were downloaded from # https://support.10xgenomics.com/single-cell-gene-expression/datasets/3.0.0 # /pbmc_1k_v3 # They were concatenated as follows: # cat pbmc_1k_v3_S1_L001_R1_001.fastq.gz pbmc_1k_v3_S1_L002_R1_001.fastq.gz > # pbmc_1k_v3_R1.fastq.gz # cat pbmc_1k_v3_S1_L001_R2_001.fastq.gz pbmc_1k_v3_S1_L002_R2_001.fastq.gz > # pbmc_1k_v3_R2.fastq.gz # The following STARsolo command generates the filtered feature, cell, and # matrix files # STAR \ # --genomeDir ./index \ # --readFilesIn ./pbmc_1k_v3_R2.fastq.gz \ # ./pbmc_1k_v3_R1.fastq.gz \ # --readFilesCommand zcat \ # --outSAMtype BAM Unsorted \ # --outBAMcompression -1 \ # --soloType CB_UMI_Simple \ # --soloCBwhitelist ./737K-august-2016.txt \ # --soloUMIlen 12 # The top 20 genes and the first 20 cells are included in this example. sce <- importSTARsolo( STARsoloDirs = system.file("extdata/STARsolo_PBMC_1k_v3_20x20", package = "singleCellTK"), samples = "PBMC_1k_v3_20x20")