Entering edit mode
8.4 years ago
Anwesha_Ghosh
▴
10
I am trying to use the package EnrichedHeatmap on Bioconductor. I want to make my own promoters list in GRanges. The demo promoters list for EnrichedHeatmap is of the format:
## GRanges object with 5 ranges and 0 metadata columns:
## seqnames ranges strand
## <Rle> <IRanges> <Rle>
## ENSG00000141956.9 chr21 [43299591, 43299591] -
## ENSG00000141959.12 chr21 [45719934, 45719934] +
## ENSG00000142149.4 chr21 [33245628, 33245628] +
## ENSG00000142156.10 chr21 [47401651, 47401651] +
## ENSG00000142166.8 chr21 [34696734, 34696734] +
## -------
## seqinfo: 1 sequence from an unspecified genome; no seqlengths
I make my promoters list with:
library(biomaRt)
mart = useMart(biomart = "ENSEMBL_MART_ENSEMBL",
dataset = "hsapiens_gene_ensembl")
filterlist <- c(1:22, 'X', 'Y')
ds = useDataset('hsapiens_gene_ensembl', mart = mart)
egs = getBM(attributes = c('ensembl_gene_id', 'external_gene_name', 'chromosome_name', 'start_position', 'end_position', 'strand'),
filters = 'chromosome_name',
values = filterlist,
mart = ds)
egs$TSS = ifelse(egs$strand ==1, egs$start_position, egs$end_position)
head(egs)
promoter_regions = GRanges(egs$ensembl_gene_id,
seqnames = Rle(paste0('chr', egs$chromosome_name)),
ranges = IRanges(start = egs$TSS - 2000, end = egs$TSS + 2000),
strand = Rle(rep("*", nrow(egs))))
head(promoter_regions)
However, my gene id keeps getting added to the last column:
GRanges object with 6 ranges and 1 metadata column:
seqnames ranges strand | gene
<Rle> <IRanges> <Rle> | <character>
[1] chr1 [111039834, 111043834] * | ENSG00000252760
[2] chr1 [143437605, 143441605] * | ENSG00000252830
[3] chr1 [ 75785889, 75789889] * | ENSG00000207241
[4] chr1 [204725991, 204729991] * | ENSG00000251861
[5] chr1 [211673630, 211677630] * | ENSG00000117650
[6] chr1 [240152772, 240156772] * | ENSG00000202041
-------
Hence I get the following error while using
mat_438M <- normalizeToMatrix(BW_438M, promoter, value_column = "coverage", extend = 2000, mean_mode = "w0", w = 50)
Error in tapply(w * v, mtch[, 2], sum, na.rm = TRUE) :
arguments must have same length
How can I correct this? Alternatively, what other packages are there that take bigwig files and make heatmaps and profiles? ChIPseeker keeps throwing errors for bigwig files.