# #消息= FALSE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -库(scPipe)库(SingleCellExperiment) data_dir = tempdir() # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #文件路径:ERCCfa_fn =系统。文件(“extdata”、“ERCC92。足总”,包= " scPipe”) ERCCanno_fn =系统。文件(“extdata”、“ERCC92_anno。gff3”,包= " scPipe”) barcode_annotation_fn =系统。文件(“extdata”、“barcode_anno。csv”,包= " scPipe”) # # - - - - - eval = TRUE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fq_R1 =系统。文件(“extdata”、“simu_R1.fastq。广州”,包= " scPipe”) fq_R2 =系统。文件(“extdata”、“simu_R2.fastq。广州”,包= " scPipe”) # # - - - - - eval = TRUE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sc_trim_barcode(文件。路径(data_dir combined.fastq.gz), fq_R1 fq_R2 read_structure =列表(bs1 = 1, b11 = 0, bs2 = 6, b12 = 8,我们= 0,ul = 6)) # # - - - - - eval = TRUE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -如果(.Platform $ OS。类型! =“窗口”){Rsubread: buildindex(: =文件。路径(data_dir ERCC_index),参考= ERCCfa_fn) Rsubread:对齐(指数=文件。路径(data_dir ERCC_index), readfile1 =文件。路径(data_dir combined.fastq.gz), output_file =文件。路径(data_dir out.aln.bam), phredOffset = 64)} # # - - - - - eval = TRUE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -如果(.Platform $ OS。类型! =“窗口”){sc_exon_mapping(文件。路径(data_dir out.aln.bam),文件。path(data_dir, "out.map.bam"), ERCCanno_fn) } ## ----eval=TRUE---------------------------------------------------------------- if(.Platform$OS.type != "windows"){ sc_demultiplex(file.path(data_dir, "out.map.bam"), data_dir, barcode_annotation_fn, has_UMI=FALSE) sc_gene_counting(data_dir, barcode_annotation_fn) } ## ----------------------------------------------------------------------------- if(.Platform$OS.type != "windows"){ sce = create_sce_by_dir(data_dir) dim(sce) } ## ----------------------------------------------------------------------------- data("sc_sample_data") data("sc_sample_qc") sce = SingleCellExperiment(assays = list(counts = as.matrix(sc_sample_data))) # generate new sce with gene count matrix QC_metrics(sce) = sc_sample_qc demultiplex_info(sce) = cell_barcode_matching UMI_dup_info(sce) = UMI_duplication ## ---- fig.height=7, fig.width=7----------------------------------------------- plot_demultiplex(sce) ## ---- fig.height=7, fig.width=7----------------------------------------------- plot_UMI_dup(sce) ## ---- warning=FALSE, message=FALSE-------------------------------------------- sce = calculate_QC_metrics(sce) sce = detect_outlier(sce) ## ---- fig.height=7, fig.width=7----------------------------------------------- plot_mapping(sce, percentage = TRUE, dataname = "sc_sample_data") ## ---- warning=FALSE, message=FALSE, fig.height=7, fig.width=7----------------- plot_QC_pairs(sce) ## ----------------------------------------------------------------------------- sce = remove_outliers(sce) dim(sce) ## ----------------------------------------------------------------------------- sessionInfo()