This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Changing values in cummeRbund CuffSet-class in R

I recently completed cuffdiff on my data set and now I'm trying to work with the data using cummeRbund. I would like to be able to change some of the values in the default CuffSet data object.

library("cummeRbund")
cuffdat<-readCufflinks(dir = "../cuffdiff", gtfFile="../cuffmerge/merged.gtf", genome="GRCh38")
samples(cuffdat)$sample_name <- c("hello", "world")

returns

Error in samples(cuffdat)$sample_name <- c("hello", "world") : 
  could not find function "samples<-"

However, this works :

s<-samples(cuffdat)
s$sample_name<-c("hello", "world")
s

returns

   sample_index sample_name sample_name parameter value
1             1       hello        <NA>      <NA>  <NA>
2             2       world        <NA>      <NA>  <NA>
3             3       hello        <NA>      <NA>  <NA>
4             4       world        <NA>      <NA>  <NA>
5             5       hello        <NA>      <NA>  <NA>
6             6       world        <NA>      <NA>  <NA>
7             7       hello        <NA>      <NA>  <NA>
8             8       world        <NA>      <NA>  <NA>
9             9       hello        <NA>      <NA>  <NA>
10           10       world        <NA>      <NA>  <NA>
11           11       hello        <NA>      <NA>  <NA>
12           12       world        <NA>      <NA>  <NA>
13           13       hello        <NA>      <NA>  <NA>
14           14       world        <NA>      <NA>  <NA>
15           15       hello        <NA>      <NA>  <NA>
16           16       world        <NA>      <NA>  <NA>
17           17       hello        <NA>      <NA>  <NA>
18           18       world        <NA>      <NA>  <NA>

Why can't I change samples(cuffdat)$sample_name? It is a data frame just like s.

rna-seq r

1 answer

What is cuffdat ?

A CuffSet object. A ’pointer’ class that allows interaction with cufflinks/cuffdiff data via a SQLite database backend.

The object s is a data frame but not cuffdat.

Log in to answer this question.