cole-trapnell-lab / cicero-release

https://cole-trapnell-lab.github.io/cicero-release/
MIT License
56 stars 14 forks source link

Generating CCANs with inconsistent numbering #64

Closed genomaxx closed 4 years ago

genomaxx commented 4 years ago

Hello, I am not sure if this is a bug or if I have perhaps misunderstood the function, but when calculating cis co-accessibility using the generate_ccans function, the CCAN numbers occasionally begin at 2 other times at 1, but then always seemingly skip numbers at random as they increase. Small code example:

> CCAN_assigns <- generate_ccans(conns)
[1] "Coaccessibility cutoff used: 0.36"
> min(CCAN_assigns$CCAN)
[1] 2
> max(CCAN_assigns$CCAN)
[1] 3772
> length(unique(CCAN_assigns$CCAN))
[1] 2280
> CCAN_assigns <- generate_ccans(conns, coaccess_cutoff_override = .4)
[1] "Coaccessibility cutoff used: 0.4"
> min(CCAN_assigns$CCAN)
[1] 1
> max(CCAN_assigns$CCAN)
[1] 3752
> length(unique(CCAN_assigns$CCAN))
[1] 2213

Are the assigned CCAN numbers not supposed to be assigned sequentially?

Thanks a bunch!

hpliner commented 4 years ago

Hello, sorry for the delay. The non-sequential numbering is an artifact of the fact that a CCAN has to have more than 2 members, but a Louvain cluster only has to have more than 1... so after sequentially numbering, the function filters all of the communities of only 2. Sorry for the confusion, but the above is acting as intended!