Entering edit mode
17 months ago
halimaakhter014
•
0
This is the code I am using to predict cell cycle phases. But I keep getting NA from the final output. I am using Gene Expression part from the single cell multiomic data that means it contains scRNA and scATAC both.
library(Seurat)
library(Signac)
library(EnsDb.Hsapiens.v86)
library(dplyr)
library(ggplot2)
library(tidyverse)
library(scran)
hs.pairs <<- readRDS(system.file("exdata", "human_cycle_markers.rds", package="scran"))
myFunction <- function(colnam){
first_column <- hs.pairs[[1]][colnam]
print(first_column)
unique_f_value <- unique(first_column)
cv_unique_f_value <- unlist(unique_f_value)
print(cv_unique_f_value)
print(length(cv_unique_f_value))
print(unique_f_value)
return(cv_unique_f_value)
}
u1 <- myFunction ("first")
u2 <- myFunction ("second")
srt1 <- Read10X_h5("D:/Halima's Data/Thesis/single_cell_data/filtered_feature_bc_matrix.h5")
# extract RNA and ATAC data
rna_counts_srt1 <- srt1$`Gene Expression`
count_matrix <- as.matrix(rna_counts_srt1)
geneID_col_first <- ensembldb::select(EnsDb.Hsapiens.v86, keys= u1, keytype = "GENEID", columns = c("SYMBOL","GENEID"))
geneID_col_second <- ensembldb::select(EnsDb.Hsapiens.v86, keys= u2, keytype = "GENEID", columns = c("SYMBOL","GENEID"))
# Replace ensemble IDs with gene symbols in hs.pairs[[1]]$first
gene_symbols_first <- geneID_col_first$SYMBOL
hs.pairs[[1]]$first <- gene_symbols_first[match(hs.pairs[[1]]$first, geneID_col_first$GENEID)]
# Replace ensemble IDs with gene symbols in hs.pairs[[1]]$second
gene_symbols_second <- geneID_col_second$SYMBOL
hs.pairs[[1]]$second <- gene_symbols_second[match(hs.pairs[[1]]$second, geneID_col_second$GENEID)]
print(hs.pairs[[1]]$first)
print(hs.pairs[[1]]$second)
row_names <- rownames(count_matrix)
print(row_names)
assignments <- cyclone(count_matrix,pairs=hs.pairs)
print(assignments)
plot(assignments$score$G1, assignments$score$G2M,
xlab="G1 score", ylab="G2/M score", pch=16)
when I print this:
print(assignments)
I get this :
G1 S G2M
1 0.000 NA NA
2 0.003 NA NA
3 0.000 NA NA
4 0.000 NA NA
5 0.000 NA NA
6 0.010 NA NA
7 0.000 NA NA
..
..
The plot function doesn't show anything. Somebody help me!
Sorry cannot answer that question directly, but in general Cyclone is quite old package not really working well for cell cycle scRNA-seq data. I would recommend ”Tricycle”. See survey of different methods: https://arxiv.org/abs/2208.05229
Thank you for trying though!