Entering edit mode
15 months ago
Chris
▴
340
Hi all,
I try to add gene name to differential accessibility peaks by using ClosestFeature():
da_peaks$closest_gene <- ClosestFeature(data, regions = rownames(da_peaks))$gene_name
However I got this:
Error in $<-.data.frame
(*tmp*
, closest_gene, value = c("MIB2", "SKI", :
replacement has 49180 rows, data has 49193
The da_peaks has 49193 rows meanwhile I only have 49180 genes so how can I modify them to make them equal? Would you please tell me how to fix this error? Thank you so much!
https://stuartlab.org/signac/articles/pbmc_vignette
Thank you for your help! No error with your code. However, I try to follow this one: https://github.com/mousepixels/sanbomics_scripts/blob/main/scATAC_intro_R.Rmd.
which has a little modification, so when I try to add a new column name
closets_gene
intoda_peaks
, I will get error because two value is not the same.You r welcome! Please go ahead and accept the answer if that had worked for you.
So if I want to add a new column name
closets_gene
indoda_peaks
, would you recommend a way to fix this error? Seem I have 13 peaks that don't have equivalent genes which cause the error.