jsh58 / Genrich

Detecting sites of genomic enrichment
MIT License
182 stars 27 forks source link

Error code: "SAM/BAM file not sorted by queryname (samtools sort -n)" #68

Closed ydchung15 closed 3 years ago

ydchung15 commented 3 years ago

Hi, I got an error code with ""SAM/BAM file not sorted by queryname (samtools sort -n)", although all my bam files were properly sorted. When i tried stdin as the input file using a pipe (samtools sort -n | Genrich -t - -o ) , I got an error code with "Cannot pipe in gzip-compressed file (use zcat instead)". Thus I used samtools output option to the SAM format (adding '-O SAM' option to the samtools sort command), I finally got the narrowPeak file!

It seems likely to me that the Genrich cannot handle bam files at all in my system. Could you please tell me how can I fix this problem? Thanks in advance!

ydchung15 commented 3 years ago

I found my bam files had problems. After resorting the bam files, everything worked fine.

Castel-Tao commented 1 year ago

May I ask what issues you encountered with the BAM file? I have encountered the same problem