tanaylab / mcATAC

Metacell analysis for ATAC data
https://tanaylab.github.io/mcATAC/
Other
1 stars 0 forks source link

`atac_ignore_peaks` fails when given peak names #22

Closed aviezerl closed 2 years ago

aviezerl commented 2 years ago

This breaks filter_features (and its tests):

atac_sc <- import_from_10x("pbmc_data", genome = "hg38", id = "pbmc", description = "PBMC from a healthy donor - granulocytes removed through cell sorting (10k)")
atac_sc <- filter_features(atac_sc, minimal_max_umi = 3, min_peak_length = 200, max_peak_length = 1000, max_peak_density = 250)
#> Error in `name_enhancers()` at mcATAC/R/PeakIntervals.R:86:12:
#> ! Class of `atac` is not recognized (should be either ScATAC, McATAC or PeakIntervals
yonatans2 commented 2 years ago

Are you sure? What branch were you on? This is what I got:

> setwd('/home/aviezerl/src/mcATAC/')
> list.files()
 [1] "_pkgdown.yml" "data"         "data-raw"     "DESCRIPTION"  "exec"
 [6] "LICENSE"      "LICENSE.md"   "man"          "NAMESPACE"    "pbmc_data"
[11] "R"            "README.html"  "README.md"    "README.Rmd"   "test.ipynb"
[16] "test.r"       "tests"        "vignettes"
> devtools::load_all('/home/aviezerl/src/mcATAC/')
ℹ Loading mcATAC
> atac_sc <- import_from_10x("pbmc_data", genome = "hg38", id = "pbmc", description = "PBMC from a healthy donor - granulocytes removed through cell sorting (10k)")
• Importing matrix
ℹ Imported a matrix of 11909 cells and 144978 features
• Importing features
ℹ Removed 107861 ATAC peaks which were all zero
ℹ 107861 ATAC peaks
! removed 32 peaks from the following chromosome(s) which are missing from hg38: KI270727.1, GL000194.1, GL000205.2, GL000195.1, GL000219.1, KI270734.1, KI270721.1, KI270726.1, KI270713.1
✔ successfully imported to an ScATAC object with 11909 cells and 107829 ATAC peaks
> atac_sc <- filter_features(atac_sc, minimal_max_umi = 3, min_peak_length = 200, max_peak_length = 1000, max_peak_density = 250)
• 8544 features were shorter than 200bp
• 37160 features were longer than 1000bp
• 676 features had a maximal UMI count less than 3
• 107 features had a peak density of more than 250 UMIs per 100bp
✔ Removed 46487 peaks out of 107829 (43%). The object is left with 61342 peaks.
>
aviezerl commented 2 years ago

Yes, I am sure. You just loaded my local version in which I just spent a few hours fixing it :)

Will PR soon.