美文网首页
R语言 Tips

R语言 Tips

作者: 火卫控 | 来源:发表于2023-07-23 15:50 被阅读0次

    R语言 Tips
    R命令行模式下

    查看当前路径:

    getwd()

    > getwd()
    [1] "/mnt/g/big_datas/scRNAseq"
    

    修改工作路径,

    需要预先创建好文件夹,才能将路径更改到指定位置。
    setwd(dir = "C:/User/czm/Desktop/RData/")

    列出当前目录下文件

    list.files()

    > list.files()
    [1] "fastgenomics-Hv1h5ad_2000vf-202304231117.rds"
    [2] "pbmc2_children_pca_ed_202304071957.rds"
    [3] "pbmc3k_final.rds"
    
    

    单细胞数据RDS文件的读入

    pb <- readRDS(file="pbmc3k_final.rds")

    library(dplyr)
    library(Seurat)
    library(patchwork)
    
    > pb <- readRDS(file="pbmc3k_final.rds")
    The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
    which was just loaded, will retire in October 2023.
    Please refer to R-spatial evolution reports for details, especially
    https://r-spatial.org/r/2023/05/15/evolution4.html.
    It may be desirable to make the sf package available;
    package maintainers should consider adding sf to Suggests:.
    The sp package is now running under evolution status 2
         (status 2 uses the sf package in place of rgdal)
    > pb
    An object of class Seurat
    13714 features across 2638 samples within 1 assay
    Active assay: RNA (13714 features, 2000 variable features)
     2 dimensional reductions calculated: pca, umap
    

    查看当前变量。

    ls()

    > ls()
    [1] "all.genes" "features"  "h2000"     "pb"        "pbmc"      "plot1"
    [7] "plot2"     "Proteases" "top10"
    

    查看当前所有变量的详细信息。

    ls.str()

    > ls.str()
    all.genes :  chr [1:13714] "AL627309.1" "AP006222.2" "RP11-206L10.2" "RP11-206L10.9" ...
    features :  chr [1:9] "MS4A1" "GNLY" "CD3E" "CD14" "FCER1A" "FCGR3A" "LYZ" "PPBP" ...
    h2000 : Formal class 'Seurat' [package "SeuratObject"] with 13 slots
    pb : Formal class 'Seurat' [package "SeuratObject"] with 13 slots
    pbmc : Formal class 'Seurat' [package "SeuratObject"] with 13 slots
    plot1 : List of 9
     $ data       :'data.frame':    2638 obs. of  3 variables:
     $ layers     :List of 1
     $ scales     :Classes 'ScalesList', 'ggproto', 'gg' <ggproto object: Class ScalesList, gg>
        add: function
        clone: function
        find: function
        get_scales: function
        has_scale: function
        input: function
        n: function
        non_position_scales: function
        scales: list
        super:  <ggproto object: Class ScalesList, gg>
     $ mapping    :List of 2
     $ theme      :List of 97
     $ coordinates:Classes 'CoordCartesian', 'Coord', 'ggproto', 'gg' <ggproto object: Class CoordCartesian, Coord, gg>
        aspect: function
        backtransform_range: function
        clip: on
        default: TRUE
        distance: function
        expand: TRUE
        is_free: function
        is_linear: function
        labels: function
        limits: list
        modify_scales: function
        range: function
        render_axis_h: function
        render_axis_v: function
        render_bg: function
        render_fg: function
        setup_data: function
        setup_layout: function
        setup_panel_guides: function
        setup_panel_params: function
        setup_params: function
        train_panel_guides: function
        transform: function
        super:  <ggproto object: Class CoordCartesian, Coord, gg>
     $ facet      :Classes 'FacetNull', 'Facet', 'ggproto', 'gg' <ggproto object: Class FacetNull, Facet, gg>
        compute_layout: function
        draw_back: function
        draw_front: function
        draw_labels: function
        draw_panels: function
        finish_data: function
        init_scales: function
        map_data: function
        params: list
        setup_data: function
        setup_params: function
        shrink: TRUE
        train_scales: function
        vars: function
        super:  <ggproto object: Class FacetNull, Facet, gg>
     $ plot_env   :<environment: 0x7f37accefb70>
     $ labels     :List of 4
    plot2 : List of 9
     $ data       :'data.frame':    2638 obs. of  3 variables:
     $ layers     :List of 1
     $ scales     :Classes 'ScalesList', 'ggproto', 'gg' <ggproto object: Class ScalesList, gg>
        add: function
        clone: function
        find: function
        get_scales: function
        has_scale: function
        input: function
        n: function
        non_position_scales: function
        scales: list
        super:  <ggproto object: Class ScalesList, gg>
     $ mapping    :List of 2
     $ theme      :List of 97
     $ coordinates:Classes 'CoordCartesian', 'Coord', 'ggproto', 'gg' <ggproto object: Class CoordCartesian, Coord, gg>
        aspect: function
        backtransform_range: function
        clip: on
        default: TRUE
        distance: function
        expand: TRUE
        is_free: function
        is_linear: function
        labels: function
        limits: list
        modify_scales: function
        range: function
        render_axis_h: function
        render_axis_v: function
        render_bg: function
        render_fg: function
        setup_data: function
        setup_layout: function
        setup_panel_guides: function
        setup_panel_params: function
        setup_params: function
        train_panel_guides: function
        transform: function
        super:  <ggproto object: Class CoordCartesian, Coord, gg>
     $ facet      :Classes 'FacetNull', 'Facet', 'ggproto', 'gg' <ggproto object: Class FacetNull, Facet, gg>
        compute_layout: function
        draw_back: function
        draw_front: function
        draw_labels: function
        draw_panels: function
        finish_data: function
        init_scales: function
        map_data: function
        params: list
        setup_data: function
        setup_params: function
        shrink: TRUE
        train_scales: function
        vars: function
        super:  <ggproto object: Class FacetNull, Facet, gg>
     $ plot_env   :<environment: 0x7f37a992c668>
     $ labels     :List of 4
    Proteases :  chr [1:13] "ACE2" "TMPRSS2" "TMPRSS13" "TMPRSS11D" "TMPRSS11E" "TMPRSS11F" ...
    top10 :  chr [1:10] "PPBP" "LYZ" "S100A9" "IGLL5" "GNLY" "FTL" "PF4" "FTH1" "GNG11" ...
    >
    
    

    查看数据结构

    str(pb)

    > str(pb)
    Formal class 'Seurat' [package "SeuratObject"] with 13 slots
      ..@ assays      :List of 1
      .. ..$ RNA:Formal class 'Assay' [package "SeuratObject"] with 8 slots
      .. .. .. ..@ counts       :Formal class 'dgCMatrix' [package "Matrix"] with 6 slots
      .. .. .. .. .. ..@ i       : int [1:2238732] 29 73 80 148 163 184 186 227 229 230 ...
      .. .. .. .. .. ..@ p       : int [1:2639] 0 779 2131 3260 4220 4741 5522 6304 7094 7626 ...
      .. .. .. .. .. ..@ Dim     : int [1:2] 13714 2638
      .. .. .. .. .. ..@ Dimnames:List of 2
      .. .. .. .. .. .. ..$ : chr [1:13714] "AL627309.1" "AP006222.2" "RP11-206L10.2" "RP11-206L10.9" ...
      .. .. .. .. .. .. ..$ : chr [1:2638] "AAACATACAACCAC-1" "AAACATTGAGCTAC-1" "AAACATTGATCAGC-1" "AAACCGTGCTTCCG-1" ...
      .. .. .. .. .. ..@ x       : num [1:2238732] 1 1 2 1 1 1 1 41 1 1 ...
      .. .. .. .. .. ..@ factors : list()
      .. .. .. ..@ data         :Formal class 'dgCMatrix' [package "Matrix"] with 6 slots
      .. .. .. .. .. ..@ i       : int [1:2238732] 29 73 80 148 163 184 186 227 229 230 ...
      .. .. .. .. .. ..@ p       : int [1:2639] 0 779 2131 3260 4220 4741 5522 6304 7094 7626 ...
      .. .. .. .. .. ..@ Dim     : int [1:2] 13714 2638
      .. .. .. .. .. ..@ Dimnames:List of 2
      .. .. .. .. .. .. ..$ : chr [1:13714] "AL627309.1" "AP006222.2" "RP11-206L10.2" "RP11-206L10.9" ...
      .. .. .. .. .. .. ..$ : chr [1:2638] "AAACATACAACCAC-1" "AAACATTGAGCTAC-1" "AAACATTGATCAGC-1" "AAACCGTGCTTCCG-1" ...
      .. .. .. .. .. ..@ x       : num [1:2238732] 1.64 1.64 2.23 1.64 1.64 ...
      .. .. .. .. .. ..@ factors : list()
      .. .. .. ..@ scale.data   : num [1:13714, 1:2638] -0.0581 -0.0336 -0.0417 -0.0336 -0.0822 ...
      .. .. .. .. ..- attr(*, "dimnames")=List of 2
      .. .. .. .. .. ..$ : chr [1:13714] "AL627309.1" "AP006222.2" "RP11-206L10.2" "RP11-206L10.9" ...
      .. .. .. .. .. ..$ : chr [1:2638] "AAACATACAACCAC-1" "AAACATTGAGCTAC-1" "AAACATTGATCAGC-1" "AAACCGTGCTTCCG-1" ...
      .. .. .. ..@ key          : chr "rna_"
      .. .. .. ..@ assay.orig   : NULL
      .. .. .. ..@ var.features : chr [1:2000] "PPBP" "LYZ" "S100A9" "IGLL5" ...
      .. .. .. ..@ meta.features:'data.frame':      13714 obs. of  5 variables:
      .. .. .. .. ..$ vst.mean                 : num [1:13714] 0.00341 0.00114 0.0019 0.00114 0.00682 ...
      .. .. .. .. ..$ vst.variance             : num [1:13714] 0.0034 0.00114 0.00189 0.00114 0.00678 ...
      .. .. .. .. ..$ vst.variance.expected    : num [1:13714] 0.00365 0.00114 0.00197 0.00114 0.00748 ...
      .. .. .. .. ..$ vst.variance.standardized: num [1:13714] 0.933 0.992 0.963 0.992 0.906 ...
      .. .. .. .. ..$ vst.variable             : logi [1:13714] FALSE FALSE FALSE FALSE FALSE FALSE ...
      .. .. .. ..@ misc         : list()
      ..@ meta.data   :'data.frame':        2638 obs. of  6 variables:
      .. ..$ orig.ident     : Factor w/ 1 level "pbmc3k": 1 1 1 1 1 1 1 1 1 1 ...
      .. ..$ nCount_RNA     : num [1:2638] 2419 4903 3147 2639 980 ...
      .. ..$ nFeature_RNA   : int [1:2638] 779 1352 1129 960 521 781 782 790 532 550 ...
      .. ..$ percent.mt     : num [1:2638] 3.02 3.79 0.89 1.74 1.22 ...
      .. ..$ RNA_snn_res.0.5: Factor w/ 9 levels "0","1","2","3",..: 3 4 3 2 7 3 5 5 1 6 ...
      .. ..$ seurat_clusters: Factor w/ 9 levels "0","1","2","3",..: 3 4 3 2 7 3 5 5 1 6 ...
      ..@ active.assay: chr "RNA"
      ..@ active.ident: Factor w/ 9 levels "Naive CD4 T",..: 3 4 3 2 7 3 5 5 1 6 ...
      .. ..- attr(*, "names")= chr [1:2638] "AAACATACAACCAC-1" "AAACATTGAGCTAC-1" "AAACATTGATCAGC-1" "AAACCGTGCTTCCG-1" ...
      ..@ graphs      :List of 2
      .. ..$ RNA_nn :Formal class 'Graph' [package "SeuratObject"] with 7 slots
      .. .. .. ..@ assay.used: chr "RNA"
      .. .. .. ..@ i         : int [1:52760] 0 6 102 203 292 421 451 511 547 618 ...
      .. .. .. ..@ p         : int [1:2639] 0 37 55 78 95 102 114 152 175 186 ...
      .. .. .. ..@ Dim       : int [1:2] 2638 2638
      .. .. .. ..@ Dimnames  :List of 2
      .. .. .. .. ..$ : chr [1:2638] "AAACATACAACCAC-1" "AAACATTGAGCTAC-1" "AAACATTGATCAGC-1" "AAACCGTGCTTCCG-1" ...
      .. .. .. .. ..$ : chr [1:2638] "AAACATACAACCAC-1" "AAACATTGAGCTAC-1" "AAACATTGATCAGC-1" "AAACCGTGCTTCCG-1" ...
      .. .. .. ..@ x         : num [1:52760] 1 1 1 1 1 1 1 1 1 1 ...
      .. .. .. ..@ factors   : list()
      .. ..$ RNA_snn:Formal class 'Graph' [package "SeuratObject"] with 7 slots
      .. .. .. ..@ assay.used: chr "RNA"
      .. .. .. ..@ i         : int [1:194568] 0 6 76 102 167 171 187 203 229 292 ...
      .. .. .. ..@ p         : int [1:2639] 0 81 147 199 253 300 368 465 525 575 ...
      .. .. .. ..@ Dim       : int [1:2] 2638 2638
      .. .. .. ..@ Dimnames  :List of 2
      .. .. .. .. ..$ : chr [1:2638] "AAACATACAACCAC-1" "AAACATTGAGCTAC-1" "AAACATTGATCAGC-1" "AAACCGTGCTTCCG-1" ...
      .. .. .. .. ..$ : chr [1:2638] "AAACATACAACCAC-1" "AAACATTGAGCTAC-1" "AAACATTGATCAGC-1" "AAACCGTGCTTCCG-1" ...
      .. .. .. ..@ x         : num [1:194568] 1 0.1111 0.0811 0.2121 0.0811 ...
      .. .. .. ..@ factors   : list()
      ..@ neighbors   : list()
      ..@ reductions  :List of 2
      .. ..$ pca :Formal class 'DimReduc' [package "SeuratObject"] with 9 slots
      .. .. .. ..@ cell.embeddings           : num [1:2638, 1:50] -4.73 -0.517 -3.189 12.793 -3.129 ...
      .. .. .. .. ..- attr(*, "dimnames")=List of 2
      .. .. .. .. .. ..$ : chr [1:2638] "AAACATACAACCAC-1" "AAACATTGAGCTAC-1" "AAACATTGATCAGC-1" "AAACCGTGCTTCCG-1" ...
      .. .. .. .. .. ..$ : chr [1:50] "PC_1" "PC_2" "PC_3" "PC_4" ...
      .. .. .. ..@ feature.loadings          : num [1:2000, 1:50] 0.01099 0.11623 0.11541 -0.00799 -0.01524 ...
      .. .. .. .. ..- attr(*, "dimnames")=List of 2
      .. .. .. .. .. ..$ : chr [1:2000] "PPBP" "LYZ" "S100A9" "IGLL5" ...
      .. .. .. .. .. ..$ : chr [1:50] "PC_1" "PC_2" "PC_3" "PC_4" ...
      .. .. .. ..@ feature.loadings.projected: num[0 , 0 ]
      .. .. .. ..@ assay.used                : chr "RNA"
      .. .. .. ..@ global                    : logi FALSE
      .. .. .. ..@ stdev                     : num [1:50] 7.1 4.5 3.87 3.75 3.17 ...
      .. .. .. ..@ key                       : chr "PC_"
      .. .. .. ..@ jackstraw                 :Formal class 'JackStrawData' [package "SeuratObject"] with 4 slots
      .. .. .. .. .. ..@ empirical.p.values     : num [1:2000, 1:20] 0 0 0 0.0075 0 0 0.008 0 0.016 0 ...
      .. .. .. .. .. .. ..- attr(*, "dimnames")=List of 2
      .. .. .. .. .. .. .. ..$ : chr [1:2000] "PPBP" "LYZ" "S100A9" "IGLL5" ...
      .. .. .. .. .. .. .. ..$ : chr [1:20] "PC1" "PC2" "PC3" "PC4" ...
      .. .. .. .. .. ..@ fake.reduction.scores  : num [1:2000, 1:20] -0.003133 0.000127 -0.000119 0.002002 0.000613 ...
      .. .. .. .. .. ..@ empirical.p.values.full: logi [1, 1] NA
      .. .. .. .. .. ..@ overall.p.values       : num [1:20, 1:2] 1 2 3 4 5 6 7 8 9 10 ...
      .. .. .. .. .. .. ..- attr(*, "dimnames")=List of 2
      .. .. .. .. .. .. .. ..$ : NULL
      .. .. .. .. .. .. .. ..$ : chr [1:2] "PC" "Score"
      .. .. .. ..@ misc                      :List of 1
      .. .. .. .. ..$ total.variance: num 1734
      .. ..$ umap:Formal class 'DimReduc' [package "SeuratObject"] with 9 slots
      .. .. .. ..@ cell.embeddings           : num [1:2638, 1:2] 3.69 5.48 6.69 -11.11 3.15 ...
      .. .. .. .. ..- attr(*, "scaled:center")= num [1:2] -2.468 0.466
      .. .. .. .. ..- attr(*, "dimnames")=List of 2
      .. .. .. .. .. ..$ : chr [1:2638] "AAACATACAACCAC-1" "AAACATTGAGCTAC-1" "AAACATTGATCAGC-1" "AAACCGTGCTTCCG-1" ...
      .. .. .. .. .. ..$ : chr [1:2] "UMAP_1" "UMAP_2"
      .. .. .. ..@ feature.loadings          : num[0 , 0 ]
      .. .. .. ..@ feature.loadings.projected: num[0 , 0 ]
      .. .. .. ..@ assay.used                : chr "RNA"
      .. .. .. ..@ global                    : logi TRUE
      .. .. .. ..@ stdev                     : num(0)
      .. .. .. ..@ key                       : chr "UMAP_"
      .. .. .. ..@ jackstraw                 :Formal class 'JackStrawData' [package "SeuratObject"] with 4 slots
      .. .. .. .. .. ..@ empirical.p.values     : num[0 , 0 ]
      .. .. .. .. .. ..@ fake.reduction.scores  : num[0 , 0 ]
      .. .. .. .. .. ..@ empirical.p.values.full: num[0 , 0 ]
      .. .. .. .. .. ..@ overall.p.values       : num[0 , 0 ]
      .. .. .. ..@ misc                      : list()
      ..@ images      : list()
      ..@ project.name: chr "pbmc3k"
      ..@ misc        : list()
      ..@ version     :Classes 'package_version', 'numeric_version'  hidden list of 1
      .. ..$ : int [1:3] 4 1 3
      ..@ commands    :List of 9
      .. ..$ NormalizeData.RNA       :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots
      .. .. .. ..@ name       : chr "NormalizeData.RNA"
      .. .. .. ..@ time.stamp : POSIXct[1:1], format: "2023-04-05 14:59:55"
      .. .. .. ..@ assay.used : chr "RNA"
      .. .. .. ..@ call.string: chr "NormalizeData(pbmc)"
      .. .. .. ..@ params     :List of 5
      .. .. .. .. ..$ assay               : chr "RNA"
      .. .. .. .. ..$ normalization.method: chr "LogNormalize"
      .. .. .. .. ..$ scale.factor        : num 10000
      .. .. .. .. ..$ margin              : num 1
      .. .. .. .. ..$ verbose             : logi TRUE
      .. ..$ FindVariableFeatures.RNA:Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots
      .. .. .. ..@ name       : chr "FindVariableFeatures.RNA"
      .. .. .. ..@ time.stamp : POSIXct[1:1], format: "2023-04-05 14:59:59"
      .. .. .. ..@ assay.used : chr "RNA"
      .. .. .. ..@ call.string: chr "FindVariableFeatures(pbmc, selection.method = \"vst\", nfeatures = 2000)"
      .. .. .. ..@ params     :List of 12
      .. .. .. .. ..$ assay              : chr "RNA"
      .. .. .. .. ..$ selection.method   : chr "vst"
      .. .. .. .. ..$ loess.span         : num 0.3
      .. .. .. .. ..$ clip.max           : chr "auto"
      .. .. .. .. ..$ mean.function      :function (mat, display_progress)
      .. .. .. .. ..$ dispersion.function:function (mat, display_progress)
      .. .. .. .. ..$ num.bin            : num 20
      .. .. .. .. ..$ binning.method     : chr "equal_width"
      .. .. .. .. ..$ nfeatures          : num 2000
      .. .. .. .. ..$ mean.cutoff        : num [1:2] 0.1 8
      .. .. .. .. ..$ dispersion.cutoff  : num [1:2] 1 Inf
      .. .. .. .. ..$ verbose            : logi TRUE
      .. ..$ ScaleData.RNA           :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots
      .. .. .. ..@ name       : chr "ScaleData.RNA"
      .. .. .. ..@ time.stamp : POSIXct[1:1], format: "2023-04-05 15:00:10"
      .. .. .. ..@ assay.used : chr "RNA"
      .. .. .. ..@ call.string: chr "ScaleData(pbmc, features = all.genes)"
      .. .. .. ..@ params     :List of 10
      .. .. .. .. ..$ features          : chr [1:13714] "AL627309.1" "AP006222.2" "RP11-206L10.2" "RP11-206L10.9" ...
      .. .. .. .. ..$ assay             : chr "RNA"
      .. .. .. .. ..$ model.use         : chr "linear"
      .. .. .. .. ..$ use.umi           : logi FALSE
      .. .. .. .. ..$ do.scale          : logi TRUE
      .. .. .. .. ..$ do.center         : logi TRUE
      .. .. .. .. ..$ scale.max         : num 10
      .. .. .. .. ..$ block.size        : num 1000
      .. .. .. .. ..$ min.cells.to.block: num 2638
      .. .. .. .. ..$ verbose           : logi TRUE
      .. ..$ RunPCA.RNA              :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots
      .. .. .. ..@ name       : chr "RunPCA.RNA"
      .. .. .. ..@ time.stamp : POSIXct[1:1], format: "2023-04-05 15:01:26"
      .. .. .. ..@ assay.used : chr "RNA"
      .. .. .. ..@ call.string: chr "RunPCA(pbmc, features = VariableFeatures(object = pbmc))"
      .. .. .. ..@ params     :List of 11
      .. .. .. .. ..$ assay          : chr "RNA"
      .. .. .. .. ..$ features       : chr [1:2000] "PPBP" "LYZ" "S100A9" "IGLL5" ...
      .. .. .. .. ..$ npcs           : num 50
      .. .. .. .. ..$ rev.pca        : logi FALSE
      .. .. .. .. ..$ weight.by.var  : logi TRUE
      .. .. .. .. ..$ verbose        : logi TRUE
      .. .. .. .. ..$ ndims.print    : int [1:5] 1 2 3 4 5
      .. .. .. .. ..$ nfeatures.print: num 30
      .. .. .. .. ..$ reduction.name : chr "pca"
      .. .. .. .. ..$ reduction.key  : chr "PC_"
      .. .. .. .. ..$ seed.use       : num 42
      .. ..$ JackStraw.RNA.pca       :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots
      .. .. .. ..@ name       : chr "JackStraw.RNA.pca"
      .. .. .. ..@ time.stamp : POSIXct[1:1], format: "2023-04-05 15:11:31"
      .. .. .. ..@ assay.used : chr "RNA"
      .. .. .. ..@ call.string: chr "JackStraw(pbmc, num.replicate = 100)"
      .. .. .. ..@ params     :List of 7
      .. .. .. .. ..$ reduction    : chr "pca"
      .. .. .. .. ..$ assay        : chr "RNA"
      .. .. .. .. ..$ dims         : num 20
      .. .. .. .. ..$ num.replicate: num 100
      .. .. .. .. ..$ prop.freq    : num 0.01
      .. .. .. .. ..$ verbose      : logi TRUE
      .. .. .. .. ..$ maxit        : num 1000
      .. ..$ ScoreJackStraw          :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots
      .. .. .. ..@ name       : chr "ScoreJackStraw"
      .. .. .. ..@ time.stamp : POSIXct[1:1], format: "2023-04-05 15:13:08"
      .. .. .. ..@ assay.used : chr "RNA"
      .. .. .. ..@ call.string: chr "ScoreJackStraw(pbmc, dims = 1:20)"
      .. .. .. ..@ params     :List of 4
      .. .. .. .. ..$ reduction   : chr "pca"
      .. .. .. .. ..$ dims        : int [1:20] 1 2 3 4 5 6 7 8 9 10 ...
      .. .. .. .. ..$ score.thresh: num 1e-05
      .. .. .. .. ..$ do.plot     : logi FALSE
      .. ..$ FindNeighbors.RNA.pca   :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots
      .. .. .. ..@ name       : chr "FindNeighbors.RNA.pca"
      .. .. .. ..@ time.stamp : POSIXct[1:1], format: "2023-04-05 15:27:51"
      .. .. .. ..@ assay.used : chr "RNA"
      .. .. .. ..@ call.string: chr "FindNeighbors(pbmc, dims = 1:10)"
      .. .. .. ..@ params     :List of 17
      .. .. .. .. ..$ reduction      : chr "pca"
      .. .. .. .. ..$ dims           : int [1:10] 1 2 3 4 5 6 7 8 9 10
      .. .. .. .. ..$ assay          : chr "RNA"
      .. .. .. .. ..$ k.param        : num 20
      .. .. .. .. ..$ return.neighbor: logi FALSE
      .. .. .. .. ..$ compute.SNN    : logi TRUE
      .. .. .. .. ..$ prune.SNN      : num 0.0667
      .. .. .. .. ..$ nn.method      : chr "annoy"
      .. .. .. .. ..$ n.trees        : num 50
      .. .. .. .. ..$ annoy.metric   : chr "euclidean"
      .. .. .. .. ..$ nn.eps         : num 0
      .. .. .. .. ..$ verbose        : logi TRUE
      .. .. .. .. ..$ force.recalc   : logi FALSE
      .. .. .. .. ..$ do.plot        : logi FALSE
      .. .. .. .. ..$ graph.name     : chr [1:2] "RNA_nn" "RNA_snn"
      .. .. .. .. ..$ l2.norm        : logi FALSE
      .. .. .. .. ..$ cache.index    : logi FALSE
      .. ..$ FindClusters            :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots
      .. .. .. ..@ name       : chr "FindClusters"
      .. .. .. ..@ time.stamp : POSIXct[1:1], format: "2023-04-05 15:28:48"
      .. .. .. ..@ assay.used : chr "RNA"
      .. .. .. ..@ call.string: chr "FindClusters(pbmc, resolution = 0.5)"
      .. .. .. ..@ params     :List of 10
      .. .. .. .. ..$ graph.name      : chr "RNA_snn"
      .. .. .. .. ..$ modularity.fxn  : num 1
      .. .. .. .. ..$ resolution      : num 0.5
      .. .. .. .. ..$ method          : chr "matrix"
      .. .. .. .. ..$ algorithm       : num 1
      .. .. .. .. ..$ n.start         : num 10
      .. .. .. .. ..$ n.iter          : num 10
      .. .. .. .. ..$ random.seed     : num 0
      .. .. .. .. ..$ group.singletons: logi TRUE
      .. .. .. .. ..$ verbose         : logi TRUE
      .. ..$ RunUMAP.RNA.pca         :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots
      .. .. .. ..@ name       : chr "RunUMAP.RNA.pca"
      .. .. .. ..@ time.stamp : POSIXct[1:1], format: "2023-04-05 15:31:17"
      .. .. .. ..@ assay.used : chr "RNA"
      .. .. .. ..@ call.string: chr "RunUMAP(pbmc, dims = 1:10)"
      .. .. .. ..@ params     :List of 26
      .. .. .. .. ..$ dims                : int [1:10] 1 2 3 4 5 6 7 8 9 10
      .. .. .. .. ..$ reduction           : chr "pca"
      .. .. .. .. ..$ assay               : chr "RNA"
      .. .. .. .. ..$ slot                : chr "data"
      .. .. .. .. ..$ umap.method         : chr "uwot"
      .. .. .. .. ..$ return.model        : logi FALSE
      .. .. .. .. ..$ n.neighbors         : int 30
      .. .. .. .. ..$ n.components        : int 2
      .. .. .. .. ..$ metric              : chr "cosine"
      .. .. .. .. ..$ learning.rate       : num 1
      .. .. .. .. ..$ min.dist            : num 0.3
      .. .. .. .. ..$ spread              : num 1
      .. .. .. .. ..$ set.op.mix.ratio    : num 1
      .. .. .. .. ..$ local.connectivity  : int 1
      .. .. .. .. ..$ repulsion.strength  : num 1
      .. .. .. .. ..$ negative.sample.rate: int 5
      .. .. .. .. ..$ uwot.sgd            : logi FALSE
      .. .. .. .. ..$ seed.use            : int 42
      .. .. .. .. ..$ angular.rp.forest   : logi FALSE
      .. .. .. .. ..$ densmap             : logi FALSE
      .. .. .. .. ..$ dens.lambda         : num 2
      .. .. .. .. ..$ dens.frac           : num 0.3
      .. .. .. .. ..$ dens.var.shift      : num 0.1
      .. .. .. .. ..$ verbose             : logi TRUE
      .. .. .. .. ..$ reduction.name      : chr "umap"
      .. .. .. .. ..$ reduction.key       : chr "UMAP_"
      ..@ tools       : list()
    >
    
    

    相关文章

      网友评论

          本文标题:R语言 Tips

          本文链接:https://www.haomeiwen.com/subject/zawfpdtx.html