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

Error filtering the sample #92

Open
Chhiring-Lama opened this issue Dec 3, 2021 · 0 comments
Open

Error filtering the sample #92

Chhiring-Lama opened this issue Dec 3, 2021 · 0 comments

Comments

@Chhiring-Lama
Copy link

Chhiring-Lama commented Dec 3, 2021

Hi, I am using Cellranger output to create the SummarizedExperiment object for chromvar. Instead of using the bam/bed file (as it was not working), I used the count and peakranges from a chromatin assay from seurat to create the object and it seems to work. However, when I try filtering the low reads from the sample I get the following error:

Error in filterSamples(fragment_counts) : colData for object must have column named depth with total reads per sample

Is there a function to add depth to the object@coldata?

This is my code:

#create a chromatin assay for these specific peaks
granges_pax5_pos_peaks <- StringToGRanges(PAX5_positive_peaks)

##create new count matrix based on the peaks above
macs2_counts_peaks <- FeatureMatrix(
fragments = Fragments(bm_1121_int),
features = granges_pax5_pos_peaks,
cells = colnames(bm_1121_int)
)

##subset the atac assay to only include the above peaks
peak_counts <- CreateChromatinAssay(
counts = macs2_counts_peaks,
fragments = "atac_fragments.tsv.gz",
annotation = annotation
)

create summarized experiment

fragment_counts <- SummarizedExperiment(assays = list(counts = peak_counts@counts),
rowRanges = peak_counts@ranges)

#Computes GC content for peaks
fragment_counts <- addGCBias(fragment_counts, genome = BSgenome.Hsapiens.UCSC.hg38)

counts_filtered <- filterSamples(fragment_counts)

-----error------
Error in filterSamples(fragment_counts) :
colData for object must have column named depth with total reads per sample

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