R/GEX_cluster_genes.R
GEX_cluster_genes.Rd
For more flexibility consider GEX_DEgenes(). Extracts the differentially expressed genes between two samples. This function uses the FindMarkers function from the Seurat package. Further parameter control can be accomplished by calling the function directly on the output of automate_GEX or VDJ_GEX_matrix.
GEX_cluster_genes(GEX, min.pct, filter, base, platypus.version)
Output Seurat object of either automate_GEX for platypus.version v2 or of VDJ_GEX_matrix for platypus.version v3 (usually VDJ_GEX_matrix.output[[2]])
The minimum percentage of cells expressing a gene in either of the two groups to be compared. Default is 0.25
Character vector of initials of the genes to be filtered. Default is c("MT-", "RPL", "RPS"), which filters mitochondrial and ribosomal genes.
The base with respect to which logarithms are computed. Default: 2
is set automatically
Returns a dataframe containing the output from the FindMarkers function, which contains information regarding the genes that are differentially regulated, statistics (p value and log fold change), and the percent of cells expressing the particular gene. Ech element in the list corresponds to the clusters in numerical order. For example, the first element in the list output[[1]] corresponds to the genes deferentially expressed in cluster 0 in GEX
#Platypus version v2
#GEX_cluster_genes(GEX =automate_GEX_output[[i]], min.pct = .25
#, filter = c("MT-", "RPL", "RPS"))
#Platypus version v3
GEX_cluster_genes(GEX = subset(Platypus::small_vgm[[2]], seurat_clusters %in% c(0,1)), min.pct = .25
, filter = c("MT-", "RPL", "RPS"))
#>
| | 0 % ~calculating
|+++++++++++++++++ | 33% ~00s
|++++++++++++++++++++++++++++++++++ | 67% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s
#>
| | 0 % ~calculating
|+++++++++++++++++ | 33% ~00s
|++++++++++++++++++++++++++++++++++ | 67% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s
#> [[1]]
#> [1] p_val avg_logFC pct.1 pct.2 p_val_adj SYMBOL cluster
#> <0 rows> (or 0-length row.names)
#>
#> [[2]]
#> [1] p_val avg_logFC pct.1 pct.2 p_val_adj SYMBOL cluster
#> <0 rows> (or 0-length row.names)
#>