Creation of cellDataSet in Monocle 2 wants undocumented AnnotatedDataFrame: assayData
2
0
Entering edit mode
6.9 years ago
mk ▴ 300

As directed in the Monocle 2 Documentation, the cellDataSet constructor is called on a sparse matrix and two AnnotatedDataFrames. Here is the suggested usage:

pd <- new("AnnotatedDataFrame", data = sample_sheet)
fd <- new("AnnotatedDataFrame", data = gene_annotation)
cds <- newCellDataSet(expr_matrix, phenoData = pd, featureData = fd)

Below, I show the matrix I am working with and the two AnnotatedDataFrames. When I attempt to create the new CellDataSet, I get an error that refers to the assayData parameter of CellDataSet's parent class, ExpressionSet. However, as far as I can tell, the assayData parameter (which is of type AnnotatedDataFrame) is replaced by a sparse matrix in Monocle 2's CellDataSet, so this error is cryptic.

> head(combined_mat_trimmed)
6 x 904 sparse Matrix of class "dgCMatrix"
   [[ suppressing 51 column names ‘Edge1_AAACGGGGTACCGTTA’, ‘Edge1_AAACGGGTCTGGCGAC’, ‘Edge1_AAAGATGAGCCTCGTG’ ... ]]

RP11-791M20.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ARIH2OS       . 2 . . . . . . . . 1 . . . . 1 . . . . . 1 1 1 . . . . . . . . . 1 . . . . 1 . . . . . 1 . . . . .
RP11-5P4.3    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RP11-561E1.1  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PROSC         1 . . . . 1 1 . . 1 . 1 . 1 . 4 2 1 . 2 1 . 1 2 . . 2 . 2 1 3 . . 5 . . 3 . 1 2 1 1 3 3 1 1 . 4 . 3
RP11-744I24.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

RP11-791M20.1 . ......
ARIH2OS       . ......
RP11-5P4.3    . ......
RP11-561E1.1  . ......
PROSC         1 ......
RP11-744I24.3 . ......

 .....suppressing columns in show(); maybe adjust 'options(max.print= *, width = *)'
 ..............................
> head(fd)
An object of class 'AnnotatedDataFrame'
  rowNames: RP11-34P13.7 FO538757.2 ... RP11-206L10.9 (6 total)
  varLabels: System
  varMetadata: labelDescription
> head(pd)
An object of class 'AnnotatedDataFrame'
  rowNames: Edge1_AAACGGGGTACCGTTA Edge1_AAACGGGTCTGGCGAC ... Edge1_AAAGTAGCAGCTCGAC (6 total)
  varLabels: Replicate
  varMetadata: labelDescription
> colonTumor <- newCellDataSet(combined_mat_trimmed, phenoData=pd, featureData=fd)
Error in validObject(.Object) : 
  invalid class “CellDataSet” object: featureNames differ between assayData and featureData
In addition: Warning messages:
1: In newCellDataSet(combined_mat_trimmed, phenoData = pd, featureData = fd) :
  Warning: featureData must contain a column verbatim named 'gene_short_name' for certain functions
2: In newCellDataSet(combined_mat_trimmed, phenoData = pd, featureData = fd) :
  Warning: featureData must contain a column verbatim named 'gene_short_name' for certain functions
3: In newCellDataSet(combined_mat_trimmed, phenoData = pd, featureData = fd) :
  Warning: featureData must contain a column verbatim named 'gene_short_name' for certain functions
monocle cellDataSet ExpressionSet • 4.2k views
ADD COMMENT
1
Entering edit mode
6.9 years ago
mk ▴ 300

turned out that fd was prepared based on a bad matrix. Issue resolved!

ADD COMMENT
0
Entering edit mode
4.2 years ago
3092605072 • 0

Hello ! I am really glad to log in and meet you here .Now ,I have the same question here .I am very curiosity of how do you figure out the question.Really hope for your response ! Bast wishes to you !

ADD COMMENT

Login before adding your answer.

Traffic: 1993 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