Hello, I'm a beginner in bioinformatics. I want to proceed with chromVAR using bulk ATAC-seq data, but I encountered an error. For the chromVAR input, I used 1) bam files and 2) peaks. For the peaks, I created a consensus peak file using the corceslab/ATAC_IterativeOverlapPeakMerging tool and inputted this file into the peaks. Everything seemed to work fine up to "Getting GC content of peaks." However, I encountered an error during the step counts_filtered <- filterPeaks(counts_filtered, non_overlapping = TRUE). The error was: "Matrix::rowSums(counts(object)) encountered the following error: object 'R_dense_rowSums' not found." Could you please help me solve this? Thank you.
Loading the package
library(chromVAR) library(motifmatchr) library(Matrix) library(SummarizedExperiment) library(BiocParallel) set.seed(2017)
Setting multiprocessing options
register(SnowParam(workers = 4, type = "SOCK")) #Windiows
Reading in inputs
1)Peaks
peaks<- readRDS("iterative_2_0/All_Samples.fwp.filter.non_overlapping.rds")
head(peaks) GRanges object with 6 ranges and 2 metadata columns: seqnames ranges strand | score name <Rle> <IRanges> <Rle> | <matrix> <character> [1] chr1 827265-827765 | 11.9715 2uM_1 [2] chr1 869700-870200 | 15.9742 2uM_2 [3] chr1 904462-904962 | 11.1568 2uM_3 [4] chr1 906688-907188 | 15.3457 2uM_4 [5] chr1 911094-911594 * | 18.8817 2uM_5
[6] chr1 912767-913267 * | 22.2830 2uM_6
seqinfo: 93 sequences from an unspecified genome; no seqlengths
peak sorting
peaks <- sort(peaks)
2-Counts
bamfiles <- c(
- "bam/HepG2_0uM_D_sort_dedup.bam",
- "bam/HepG2_0uM_S_sort_dedup.bam",
- "bam/HepG2_0uM_W_sort_dedup.bam",
- "bam/HepG2_2uM_re1_sort_dedup.bam",
- "bam/HepG2_2uM_re2_sort_dedup.bam",
- "bam/HepG2_2uM_re3_sort_dedup.bam")
print(bamfiles) [1] "bam/HepG2_0uM_D_sort_dedup.bam" "bam/HepG2_0uM_S_sort_dedup.bam" "bam/HepG2_0uM_W_sort_dedup.bam" "bam/HepG2_2uM_re1_sort_dedup.bam" [5] "bam/HepG2_2uM_re2_sort_dedup.bam" "bam/HepG2_2uM_re3_sort_dedup.bam"
fragment_counts <- getCounts(bamfiles,
- peaks2,
- paired = TRUE,
- by_rg = FALSE,
- format = "bam",
- colData = DataFrame(condition = c("0uM", "0uM","0uM",
- "2uM", "2uM","2uM"),
- replicates = c("1", "2","3",
- "1", "2","3"))) Reading in file: bam/HepG2_0uM_D_sort_dedup.bam Reading in file: bam/HepG2_0uM_S_sort_dedup.bam Reading in file: bam/HepG2_0uM_W_sort_dedup.bam Reading in file: bam/HepG2_2uM_re1_sort_dedup.bam Reading in file: bam/HepG2_2uM_re2_sort_dedup.bam Reading in file: bam/HepG2_2uM_re3_sort_dedup.bam
head(fragment_counts) class: RangedSummarizedExperiment dim: 6 6 metadata(0): assays(1): counts rownames: NULL rowData names(2): score name colnames(6): HepG2_0uM_D_sort_dedup.bam HepG2_0uM_S_sort_dedup.bam ... HepG2_2uM_re2_sort_dedup.bam HepG2_2uM_re3_sort_dedup.bam colData names(3): condition replicates depth
Getting GC content of peaks
library(BSgenome.Hsapiens.UCSC.hg38)
gc_counts <- addGCBias(fragment_counts,
- genome = BSgenome.Hsapiens.UCSC.hg38) head(rowData(gc_counts)) DataFrame with 6 rows and 3 columns score name bias <matrix> <character> <numeric> 1 11.9715 2uM_1 0.694611 2 15.9742 2uM_2 0.736527 3 11.1568 2uM_3 0.746507 4 15.3457 2uM_4 0.608782 5 18.8817 2uM_5 0.610778 6 22.2830 2uM_6 0.612774
Filtering inputs
counts_filtered <- filterPeaks(counts_filtered, non_overlapping = TRUE) Matrix::rowSums(counts(object)) encountered the following error: object 'R_dense_rowSums' not found