open2c / open2c_examples

16 stars 9 forks source link

order arms as chromosomes in scalings #2

Closed sergpolly closed 4 years ago

sergpolly commented 4 years ago

@golobor could we change:

hg38_arms = hg38_arms[hg38_arms.chrom.isin(clr.chromnames)].reset_index(drop=True)

to

hg38_arms = hg38_arms.set_index("chrom").loc[clr.chromnames].reset_index()

this way we are both subsetting arms down to the chromosomes present in the cooler and we are preserving the order of arms according to the chrom names

This would be helpful downstream for inter-chromosomal regions - as they have to be from the upper triangle - and it would be more concise to have them ordered right away.

Also it would be nice to pass hg38_arms through bioframe.parse_regions to assign them some names - as those can be used later to reorder pivoted dataframe with trans-expected

sergpolly commented 4 years ago

changes are in https://github.com/open2c/open2c_examples/pull/3

golobor commented 4 years ago

agreed!