higlass / higlass/higlass-python

Load local bed file

Đang mở
#136 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
66
Fork
11
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Description:**

When I try to load a bedfile using the following code:

```python
import higlass as hg
ts3 = hg.bed2ddb('Regular/H3K27ac_EA92-97_peaks.xls.bed.beddb')

hg.view(
hg.track("top-axis"),
ts3.track("chromosome-labels"),
ts3.track("horizontal-bar"),
)
```
File "/Users/smit/anaconda3/envs/3dfolding/lib/python3.11/site-packages/higlass/tilesets.py", line 46, in tiles
return self._tiles(tile_ids)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/smit/anaconda3/envs/3dfolding/lib/python3.11/site-packages/clodius/tiles/bed2ddb.py", line 41, in tiles
return tiles_1d(filepath, tile_ids)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/smit/anaconda3/envs/3dfolding/lib/python3.11/site-packages/clodius/tiles/bed2ddb.py", line 64, in tiles_1d
to_return += [(tile_id, get_1d_tiles(filepath, int(z), int(x))[int(x)])]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/smit/anaconda3/envs/3dfolding/lib/python3.11/site-packages/clodius/tiles/bed2ddb.py", line 117, in get_1d_tiles
rows = c.execute(query).fetchall()
^^^^^^^^^^^^^^^^
sqlite3.OperationalError: no such column: fromX

While debugging, I reviewed the clodius repository in the [aggregate.py](https://github.com/higlass/clodius/blob/de67e9df2cd296d3681dcf438c0895638de672e4/clodius/cli/aggregate.py) file and found out that the _bedpe format uses the fromX column. As a result, my beddb file doesn't have this column information.

Direct reference:
[aggregate.py#L346](https://github.com/higlass/clodius/blob/de67e9df2cd296d3681dcf438c0895638de672e4/clodius/cli/aggregate.py#L346)

However, hg.bed2ddb is expecting the 'fromX' column name.

Supporting Information:

Bed file format

```
chr1 3062508 3062700 H3K27ac_EA92-97_peak_1 1.50105
chr1 3671399 3672083 H3K27ac_EA92-97_peak_2 2.19707
chr1 4491709 4492214 H3K27ac_EA92-97_peak_3 2.94584
chr1 4493155 4493533 H3K27ac_EA92-97_peak_4 3.21493
chr1 4571589 4571963 H3K27ac_EA92-97_peak_5 1.64992
chr1 4653954 4654123 H3K27ac_EA92-97_peak_6 1.64383
```

Command to convert bed file to bed2d format:

```clodius aggregate bedfile --chromsizes-filename ../CUT-Tag_NIPBL/CUT-Tag_NIPBL-FKBP-EA18.1/mm10.size.txt Regular/H3K27ac_EA92-97_peaks.xls.bed```
mm10.size.txt was retrieved from [this link](http://hgdownload.cse.ucsc.edu/goldenpath/mm10/bigZips/mm10.chrom.sizes).

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start with clodius/tiles/bed2ddb.py, especially get_1d_tiles, and compare its query with the schema produced by clodius/cli/aggregate.py around line 346. Reproduce the failure using the supplied BED example and aggregate command. Done means the resulting beddb loads through hg.bed2ddb and can render the listed tracks without the fromX error.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python, sqlite
Lĩnh vực
data, databases
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.