How to delete the cells belongs to particlar CellType in R?
1
1
Entering edit mode
6.7 years ago
John ▴ 270

Hi, Below is what I have,

    >DCX
    CellDataSet (storageMode: environment)
    assayData: 22995 features, 64 samples 
      element names: exprs 
    protocolData: none
    phenoData
      sampleNames: CN01 CN02 ... CN64 (64 total)
      varLabels: V1 Size_Factor ... CellType (10 total)
      varMetadata: labelDescription
    featureData
      featureNames: 0610007P14Rik 0610009B22Rik ... Zzz3 (22995 total)
      fvarLabels: gene_short_name num_cells_expressed use_for_ordering
      fvarMetadata: labelDescription
    experimentData: use 'experimentData(object)'
    Annotation:

> head(pData(DCX))
       V1 Size_Factor num_genes_expressed Cluster peaks  halo     delta
CN01 CN01    1.907703                5062       3 FALSE FALSE 0.5659337
CN02 CN02    2.659821                7054       2 FALSE FALSE 0.5043280
CN03 CN03    2.389068                7099       4 FALSE FALSE 0.3798056
CN04 CN04    1.832047                7099       2 FALSE FALSE 0.6221111
CN05 CN05    1.784817                6444       2 FALSE FALSE 0.5936016
CN06 CN06    2.762373                5910       3 FALSE FALSE 0.5549383
           rho nearest_higher_density_neighbor        CellType
CN01 0.7087620                              NA OLIGODENDROCYTE
CN02 1.1789535                              NA          NEURON
CN03 0.7203490                              NA       ASTROCYTE
CN04 1.3089645                              NA          NEURON
CN05 0.3867494                              NA          NEURON
CN06 0.3565931                              NA OLIGODENDROCYTE

How can I delete the all cells which belongs to NEURON celltype?

Please help, I am new to R!

RNA-Seq R r software error • 1.5k views
ADD COMMENT
1
Entering edit mode
6.7 years ago
DCX2 = DCX[, pData(DCX)$CellType != "NEURON"]
table(pData(DCX2)$CellType)
ADD COMMENT
0
Entering edit mode

thanks, but not working!

> DCX2 = DCX[pData(DCX)$CellType != "NEURON", ]
> table(pData(DCX2)$CellType)

      ASTROCYTE          NEURON OLIGODENDROCYTE      RADIALGLIA 
             15              17              21              11

p.s. I want to delete all the corresponding samples/cell numbers in "DCX object" which is classified as 'NEURON'.

ADD REPLY
1
Entering edit mode

Sorry. Typo in my original reply--should be fixed now. Just a note that understanding how these objects work is pretty important, so you might have noticed that my answer was incorrectly subsetting the "genes" rather than the "samples".

In any case, I have fixed my answer.

ADD REPLY
0
Entering edit mode

thank you so much! now i understood!

ADD REPLY

Login before adding your answer.

Traffic: 1514 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6