본문 바로가기
프로그래밍/환경 구축 및 기타

tabix Error [E::hts_idx_push] chromosome blocks not continuous

by life_is_egg 2024. 5. 16.
반응형

여러 ATAC 데이터를 합쳐서 가공하기 위해서는 fragments 파일을 merge 하는 과정이 필요함.

이전 버전의 Signac 튜토리얼에서 fragments merge 방법에 대해 올려둔 것이 있어 따라 했는데,

계속 tabix 단계에서 오류(chromosome blocks not continuous)가 발생함.

 

찾아보니까 파일 sorting이 제대로 되어 있지 않아서 그렇다고 함

 

문제의 코드
# merge files (avoids having to re-sort)
sort -m -k1,1 -k2,2n atac_fragments_MCA3M.tsv atac_fragments_MCA12W.tsv atac_fragments_MHA12W.tsv > atac_fragments.tsv

# block gzip compress the merged file
bgzip -@ 8 atac_fragments.tsv # -@ 8 uses 8 threads

# index the bgzipped file
tabix -p bed atac_fragments.tsv.gz

Signac 튜토리얼을 따라 코드를 돌렸더니 아래와 같은 에러가 발생함

tabix Error [E::hts_idx_push] chromosome blocks not continuous

 

에러 해결한 코드
# merge files (avoids having to re-sort)
cat atac_fragments_MCA3M.tsv atac_fragments_MCA12W.tsv atac_fragments_MHA12W.tsv > atac_fragments.tsv
sort -k1,1 -k2,2n atac_fragments.tsv > sorted_atac_fragments.tsv

# block gzip compress the merged file
bgzip -@ 8 sorted_atac_fragments.tsv # -@ 8 uses 8 threads

# index the bgzipped file
tabix -p bed sorted_atac_fragments.tsv.gz

 

깃헙 찾아보니까 sort 버전 문제라는 말이 있었으나 sort 버전을 바꾸기는 귀찮아서 혹시나 데이터를 합치고

다시 sort를 해주었더니 성공적으로 돌아감

 

정확한 원인은 모르지만 아무튼 성공!

(원인 파악을 위해서는 sorting 전 후 파일을 뜯어봐야 할 것 같음)


 

참고사이트

1. https://stuartlab.org/signac/0.2/articles/merging#merge-fragment-files-1

 

Merging objects

Signac

stuartlab.org

 

2. https://github.com/bcbio/bcbio-nextgen/issues/624

 

tabix Error [E::hts_idx_push] chromosome blocks not continuous · Issue #624 · bcbio/bcbio-nextgen

Hi @chapmanb , I think I tracked down this error message which I reported before on #613 . It turns out that what happens is exactly what the message says ... Briefly, the pipeline sorts the bed fi...

github.com

 

반응형

댓글