DEGreport
DEGreport copied to clipboard
Plot shows only one coldata group on x-axis
When I run the following code, my x-axis only shows one group instead of the 7 "times" values(stations in my case).
res <- degPatterns(df, metadata = colData(dds), time = "station", minc = 1)
degPlotCluster(res$normalized, "station", lines=FALSE, min_genes = 1)
It runs fine for another column with a different condition of 3 groups (x-axis), however, when trying coldata station column (numbers 1-7) it plots the following.
Do you spot anything I might be missing in the code? df = data.matrix with all selected DEG coldata = includes a column of station numbers 1-7 for each of the samples
Hi,
hum, normally that happens when colData(dds)['station']
is not a factor. can you check what class(colData(dds)['station'])
is giving to you?
class(colData(dds)['station'])
[1] "DFrame"
attr(,"package")
[1] "S4Vectors"
colData(dds)['station'] = as.factor(colData(dds)['station'])
Error in as.vector(x, mode = "character") :
no method for coercing this S4 class to a vector
>
I am running the following code:
res <- degPatterns(df3, metadata = colData(dds), time = "station", minc = 5)
degPlotCluster(res$normalized, "station")
For which I obtain the following:
Working with 1312 genes.
Working with 1311 genes after filtering: minc > 5
Joining, by = "merge"
Joining, by = "merge"
geom_path: Each group consists of only one observation. Do you need to adjust the group aesthetic?
geom_path: Each group consists of only one observation. Do you need to adjust the group aesthetic?
...
I had the same issue and as @lpantano said, the probleme comes from the column used in "time" from the metadata, is not a factor! If another person find this, you can follow another answer from @lpantano to transform your column into factor: https://github.com/lpantano/DEGreport/issues/39#issuecomment-736546744
Here is the quick solution: your_metadata$column_used_in_time = as.factor(your_metadata$column_used_in_time)
It should do the trick :)
ps: thank you @lpantano