Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filterpeaks error #111

Open
woooowonjin opened this issue Feb 16, 2024 · 0 comments
Open

filterpeaks error #111

woooowonjin opened this issue Feb 16, 2024 · 0 comments

Comments

@woooowonjin
Copy link

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
|
[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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant