0

I am trying to run a gene set enrichment analysis following the vignette here: http://yulab-smu.top/clusterProfiler-book/chapter7.html

I have been trying to use this particular code:

data(df, package="DOSE")
gene <- names(df)[abs(df) > 2]
head(gene)

When I run the above I get the following error:

data set ‘df’ not found[1] NA NA NA NA NA NA
[1] FALSE

I am trying to apply a cut off of 1 to a dataset of Log2FoldChange (values from -x through to +x). I would then like to take this and the corresponding names (ENTREZ ID) and put it into a data frame named gene so I can then run the enrichment analysis.

If I specify columns of the data:

#Define DEG as LFC>1
data(df, package="DOSE")
gene <- names(df$ENTREZ)[abs(df$log2FoldChange) > 2]
head(gene)

gene <- (abs(1) > 1)
head(gene)

I get:

data set ‘df’ not foundNULL
[1] FALSE

The above 'abs()' function doesnt work (I have copied and modified as above from the vignette).

I have found another explanation here that suggests perhaps a different route. Ordering multiple columns using cut-off values in R

Have I missed some syntax to get this work? Any help would be greatly appreciated.

Thank you

Phil
  • 7,287
  • 3
  • 36
  • 66
  • I don't see a dataset called `df` in the DOSE package: https://bioconductor.org/packages/release/bioc/manuals/DOSE/man/DOSE.pdf – Phil Mar 17 '21 at 14:09

1 Answers1

0

It is normal you have an error as data(df, package="DOSE") is an invalid command. You should replace df by your dataframe.

Basti
  • 1,703
  • 3
  • 10
  • 25
  • Hi Bastien. I have named df as my data frame. ``` df <- read.csv("geneList_por.csv") ``` Hence why I have used 'df'. As I assumed that df is data frame of 14277 abs of 2 variables. – Rob Staruch Mar 17 '21 at 13:10
  • Ok thanks for the precision. Then I don't understand why your problem is "data set 'df' not found" as you have created it, you should not have this error – Basti Mar 17 '21 at 13:18