robinweide / GENOVA

GENome Organisation Visual Analytics
GNU General Public License v3.0
69 stars 15 forks source link

APA fails on unsorted anchor list (?) #204

Closed deWitLab closed 4 years ago

deWitLab commented 4 years ago

APA function seems to fail when an unsorted loop anchor list is used. At least ‘Error: No suitable anchors left after out-of-bounds filtering.’ can be solved by sorting loop anchor list.

teunbrand commented 4 years ago

I'm not sure what you mean with loop anchor list? Is it a list of BEDPE-formatted data.frames, a list of pre-converted anchor objects or simply an unlisted/flat BEDPE-formatted data.frame?

deWitLab commented 4 years ago

Unlisted BEDPE formatted data.frame (6 columns).

teunbrand commented 4 years ago

I can't reproduce this error, I tried the following:

scrambled <- bedpe[sample(nrow(bedpe)),]
dim(bedpe)
# [1] 6976    6

# Run APAs
apa_standard <- APA(list(exp, exp2), bedpe = bedpe)
apa_scrambled <- APA(list(exp, exp2), bedpe = scrambled)

# Extract raw data
standard <- apa_standard$signal_raw[[1]]
scrambld <- apa_scrambled$signal_raw[[1]]

# Order identically
standard <- standard[order(rownames(standard)),,]
scrambld <- scrambld[order(rownames(scrambld)),,]

# Check equivalence
identical(standard, scrambld)
# [1] TRUE
teunbrand commented 4 years ago

I'm closing this for now, if it is more clear how to make this error occur, please feel free to reopen.