1. 查看数据结构
> str(main_tiss_filtered1)
Formal class 'Seurat' [package "Seurat"] with 13 slots
..@ assays :List of 1
.. ..$ RNA:Formal class 'Assay' [package "Seurat"] with 8 slots
.. .. .. ..@ counts :Formal class 'dgCMatrix' [package "Matrix"] with 6 slots
.. .. .. .. .. ..@ i : int [1:71326513] 0 3 23 25 39 41 66 80 85 88 ...
.. .. .. .. .. ..@ p : int [1:23515] 0 2969 5234 12319 14233 21507 23971 27395 31379 32472 ...
.. .. .. .. .. ..@ Dim : int [1:2] 26485 23514
.. .. .. .. .. ..@ Dimnames:List of 2
.. .. .. .. .. .. ..$ : chr [1:26485] "A1BG" "A1BG-AS1" "A1CF" "A2M" ...
.. .. .. .. .. .. ..$ : chr [1:23514] "A10_1001000329" "A10_1001000407" "A10_1001000408" "A10_1001000410" ...
.. .. .. .. .. ..@ x : num [1:71326513] 3 68 141 12 1 553 2 17 1 219 ...
.. .. .. .. .. ..@ factors : list()
.. .. .. ..@ data :Formal class 'dgCMatrix' [package "Matrix"] with 6 slots
.. .. .. .. .. ..@ i : int [1:71326513] 0 3 23 25 39 41 66 80 85 88 ...
.. .. .. .. .. ..@ p : int [1:23515] 0 2969 5234 12319 14233 21507 23971 27395 31379 32472 ...
.. .. .. .. .. ..@ Dim : int [1:2] 26485 23514
.. .. .. .. .. ..@ Dimnames:List of 2
.. .. .. .. .. .. ..$ : chr [1:26485] "A1BG" "A1BG-AS1" "A1CF" "A2M" ...
.. .. .. .. .. .. ..$ : chr [1:23514] "A10_1001000329" "A10_1001000407" "A10_1001000408" "A10_1001000410" ...
.. .. .. .. .. ..@ x : num [1:71326513] 3 68 141 12 1 553 2 17 1 219 ...
.. .. .. .. .. ..@ factors : list()
.. .. .. ..@ scale.data : num[0 , 0 ]
.. .. .. ..@ key : chr "rna_"
.. .. .. ..@ assay.orig : NULL
.. .. .. ..@ var.features : logi(0)
.. .. .. ..@ meta.features:'data.frame': 26485 obs. of 0 variables
.. .. .. ..@ misc : NULL
..@ meta.data :'data.frame': 23514 obs. of 52 variables:
.. ..$ orig.ident : chr [1:23514] "SeuratProject" "SeuratProject" "SeuratProject" "SeuratProject" ...
.. ..$ nCount_RNA : num [1:23514] 594781 662644 602263 185720 914254 ...
.. ..$ nFeature_RNA : int [1:23514] 2969 2265 7085 1914 7274 2464 3424 3984 1093 717 ...
.. ..$ well : chr [1:23514] "A10" "A10" "A10" "A10" ...
.. ..$ plate : chr [1:23514] "1001000329" "1001000407" "1001000408" "1001000410" ...
.. ..$ cell_id : chr [1:23514] "A10_1001000329" "A10_1001000407" "A10_1001000408" "A10_1001000410" ...
.. ..$ sample_name : chr [1:23514] "LT_S07" "LT_S21" "LT_S21" "LT_S21" ...
.. ..$ patient_id : chr [1:23514] "TH103" "TH185" "TH185" "TH185" ...
.. ..$ gender : chr [1:23514] "Female" "Male" "Male" "Male" ...
.. ..$ race : chr [1:23514] "White or Caucasian" "Asian" "Asian" "Asian" ...
.. ..$ smokingHx : chr [1:23514] "Never" "Never" "Never" "Never" ...
.. ..$ histolgy : chr [1:23514] "Adenocarcinoma" "Adenocarcinoma" "Adenocarcinoma" "Adenocarcinoma" ...
.. ..$ driver_gene : chr [1:23514] "ALK" "EGFR" "EGFR" "EGFR" ...
.. ..$ driver_mutation : chr [1:23514] "fusion" "L858R" "L858R" "L858R" ...
.. ..$ secondary_mutation : chr [1:23514] NA "CDK2NA/B, STK11 R86*, TP53 C242S, S241F" "CDK2NA/B, STK11 R86*, TP53 C242S, S241F" "CDK2NA/B, STK11 R86*, TP53 C242S, S241F" ...
.. ..$ Notes : chr [1:23514] NA NA NA NA ...
.. ..$ stage.at.dx : chr [1:23514] "IV" "IV" "IV" "IV" ...
.. ..$ pathlogy_review : chr [1:23514] "positive" "no eval" "no eval" "no eval" ...
.. ..$ biopsy_date : chr [1:23514] "2017-02-22" "2017-07-18" "2017-07-18" "2017-07-18" ...
.. ..$ sort_date : chr [1:23514] "2017-02-22" "2017-07-18" "2017-07-18" "2017-07-18" ...
.. ..$ biopsy_type : chr [1:23514] "Thoracentesis" "Thoracentesis" "Thoracentesis" "Thoracentesis" ...
.. ..$ biopsy_site : chr [1:23514] "Pleura" "Pleura" "Pleura" "Pleura" ...
.. ..$ primary_or_metastaic : chr [1:23514] "Metastatic" "Metastatic" "Metastatic" "Metastatic" ...
.. ..$ biopsy_time_status : chr [1:23514] "PD" "Early" "Early" "Early" ...
.. ..$ early_treatment_status : chr [1:23514] NA "PD" "PD" "PD" ...
.. ..$ best_response_status : chr [1:23514] "PD" "PD" "PD" "PD" ...
.. ..$ biopsy_timing : chr [1:23514] "Late" "Early" "Early" "Early" ...
.. ..$ analysis : chr [1:23514] "grouped_pd" "grouped_pd" "grouped_pd" "grouped_pd" ...
.. ..$ treatment_history : chr [1:23514] "prior" "naive" "naive" "naive" ...
.. ..$ treatment_history_detail : chr [1:23514] "Prior TKI/ immunotherapy" "on firsline TKI" "on firsline TKI" "on firsline TKI" ...
.. ..$ line_of_therapy : chr [1:23514] "6th" "1st" "1st" "1st" ...
.. ..$ treatment_type : chr [1:23514] "TKI" "TKI" "TKI" "TKI" ...
.. ..$ treatment : chr [1:23514] "trametinib" "erlotinib" "erlotinib" "erlotinib" ...
.. ..$ percent_PFS_ref_values : num [1:23514] NA 9.7 9.7 9.7 9.7 NA NA NA NA 18.9 ...
.. ..$ percent.PFS.reference.values: chr [1:23514] NA "9路7 months (95% CI 8路4-12路3)" "9路7 months (95% CI 8路4-12路3)" "9路7 months (95% CI 8路4-12路3)" ...
.. ..$ infections : chr [1:23514] "none" "none" "none" "none" ...
.. ..$ early_bx_day : int [1:23514] NA 2 2 2 2 NA NA NA NA NA ...
.. ..$ treatment_start_date : chr [1:23514] "2017-02-24" "2017-07-15" "2017-07-15" "2017-07-15" ...
.. ..$ pfs_over_under : chr [1:23514] NA "under" "under" "under" ...
.. ..$ pfs_day : chr [1:23514] "4" "110" "110" "110" ...
.. ..$ pfs_month : chr [1:23514] "0.1" "3.7" "3.7" "3.7" ...
.. ..$ date_of_death : chr [1:23514] "2017-03-02" "2018-05-25" "2018-05-25" "2018-05-25" ...
.. ..$ stageIII.IV_ca_dx_date : chr [1:23514] "2014-03-01" "2017-06-20" "2017-06-20" "2017-06-20" ...
.. ..$ ca_dx_OS : chr [1:23514] "1,097" "339" "339" "339" ...
.. ..$ percent.ercc : num [1:23514] 0.127 0 0 0 0 ...
.. ..$ percent.ribo : num [1:23514] 0.0118 0.0434 0.0239 0.0494 0.0218 ...
.. ..$ X : int [1:23514] NA NA NA NA NA NA NA NA NA NA ...
.. ..$ sample_type : chr [1:23514] NA NA NA NA ...
.. ..$ sort_plate_number : chr [1:23514] NA NA NA NA ...
.. ..$ Sequence_Run1 : chr [1:23514] NA NA NA NA ...
.. ..$ stage : chr [1:23514] NA NA NA NA ...
.. ..$ treatment_status : chr [1:23514] NA NA NA NA ...
..@ active.assay: chr "RNA"
..@ active.ident: Factor w/ 1 level "SeuratProject": 1 1 1 1 1 1 1 1 1 1 ...
.. ..- attr(*, "names")= chr [1:23514] "A10_1001000329" "A10_1001000407" "A10_1001000408" "A10_1001000410" ...
..@ graphs : list()
..@ neighbors : list()
..@ reductions : list()
..@ images : list()
..@ project.name: chr "SeuratProject"
..@ misc : list()
..@ version :Classes 'package_version', 'numeric_version' hidden list of 1
.. ..$ : int [1:3] 3 2 3
..@ commands : list()
..@ tools : list()
2.提取表达矩阵
> GetAssayData(object = main_tiss_filtered1, slot = "counts")
26485 x 23514 sparse Matrix of class "dgCMatrix"
[[ suppressing 38 column names ‘A10_1001000329’, ‘A10_1001000407’, ‘A10_1001000408’ ... ]]
[[ suppressing 38 column names ‘A10_1001000329’, ‘A10_1001000407’, ‘A10_1001000408’ ... ]]
A1BG 3 . . . . 18 74 1 . . . . . . . . . . 1 . . 12 43 . . . . 12 . . .
A1BG-AS1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
A1CF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A2M 68 . . . . . 201 702 . . 99 6 . 932 . 7263 100 1520 . . . . 4 . . . . . 1550 . .
A2M-AS1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A2ML1 . . 1 . 2 . . . . . . . . . . . . . . . . . . . . . . . . . .
A2MP1 . . . . . . . . . . . . . . . . . . . . . . . . . . 4 . . . .
A3GALT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A4GALT . 52 3 . 34 . . . . . . . . . 90 269 . . . . . . . . . . . . 33 . .
A4GNT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
AA06 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
AAAS . . 25 . . . . . 18 . . . . . 342 . . . . . . . 2 . 165 . . . . . .
AACS . . 8 . . . . . . . . . . . 11 . . . . . . . . . . . . . . . 664
A1BG . . 4 . . . . ......
A1BG-AS1 . . . . . . 11 ......
A1CF . . . . . . . ......
A2M . 1735 29 1503 . 1166 221 ......
A2M-AS1 . . . . . . . ......
A2ML1 . . . . . . . ......
A2MP1 . . . . . . . ......
A3GALT2 . . . . . . . ......
A4GALT . 14 . . . . . ......
A4GNT . . . . . . . ......
AA06 . . . . . . . ......
AAAS . . . . . 33 . ......
AACS . . . . . . . ......
..............................
........suppressing 23476 columns and 26459 rows in show(); maybe adjust 'options(max.print= *, width = *)'
..............................
[[ suppressing 38 column names ‘A10_1001000329’, ‘A10_1001000407’, ‘A10_1001000408’ ... ]]
ZSWIM8-AS1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ZUFSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ZW10 . . . . 75 . . . . . . . . . . . . . . . . . . . . . . . . . .
ZWILCH . . 2 . 29 . . . . . . 23 . . . . . . . . . . . . . . . . . . .
ZWINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ZXDA . . . . 15 . . . . . . . . . . . . . . . . . . . . . . . . . .
ZXDB . . . . . . . . . 31 . . . . . . . . . . . . . . . . . 162 . . .
ZXDC . . . . 11 11 177 . . . . . . . 110 . . . . . . . . . . . . . 81 . .
ZYG11A . . . . . . . . . . . . . . . . . . 3 . . . . . . . . . . . .
ZYG11B . . . . 1 . 50 . . . 1 . . 221 7 . . . . . . . 52 . 25 . . . 15 . .
ZYX 292 3 31 . 42 11 6 783 . 1 64 . . . 228 261 37 368 . 4 . 12 16 . 85 . . . 135 4 .
ZZEF1 66 . 3 . . . 74 . . 1 95 509 . . . . . . . . . 37 . . . . . . 92 . .
ZZZ3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 . .
ZSWIM8-AS1 . . . . . 71 . ......
ZUFSP . . . . 538 . . ......
ZW10 145 . . . . . . ......
ZWILCH . . . . . . . ......
ZWINT . . . . . . . ......
ZXDA . . . . . 180 . ......
ZXDB . . . . . . . ......
ZXDC . . 17 . . . . ......
ZYG11A . . . . . . . ......
ZYG11B . . 2 . . . . ......
ZYX 37 102 79 16 . 2 . ......
ZZEF1 58 . . . . . . ......
ZZZ3 186 . . . . . . ......
> ls <- GetAssayData(object = main_tiss_filtered1, slot = "counts")
> dim(ls)
[1] 26485 23514
> ls[1:4,1:4]
4 x 4 sparse Matrix of class "dgCMatrix"
A10_1001000329 A10_1001000407 A10_1001000408 A10_1001000410
A1BG 3 . . .
A1BG-AS1 . . . .
A1CF . . . .
A2M 68 . . .
> class(ls)
[1] "dgCMatrix"
attr(,"package")
[1] "Matrix"
> write.csv(ls,file = 'ls.csv')