aertslab / pycisTopic

pycisTopic is a Python module to simultaneously identify cell states and cis-regulatory topics from single cell epigenomics data.
Other
58 stars 12 forks source link

bugfix read_fragments polars dynamic dtype #158

Closed camiel-m closed 2 months ago

camiel-m commented 2 months ago

Polar determines the dtypes dynamically in read_fragments by reading the first 100 lines. If the chromosome names contain strings that could be integers (e.g "1" instead of "chr1"), then the dtype will be set incorrectly. Best to set dtype in the function call instead of through .with_columns.

ghuls commented 2 months ago

read_fragments_from_file should be removed and fragments.read_fragments_to_pyranges should be used instead:

https://github.com/aertslab/pycisTopic/blob/d6a2f8c832c14faae07def1d3ad8755531f50ad5/src/pycisTopic/fragments.py#L21C1-L164C27

SeppeDeWinter commented 2 months ago

Thanks Camiel & Gert!

@camiel-m I just pushed some changes to your fork. To give some context, this code was already updated a while ago but not actually used ;).

@camiel-m can you test my changes to make sure the fragment files are read correctly?

Best,

Seppe

camiel-m commented 2 months ago

@SeppeDeWinter It worked fine for me.