BAM file header error - ValueError: invalid coordinates:
0
0
Entering edit mode
7.2 years ago
rbronste ▴ 420

Hi everyone,

Using msCENTIPEDE which is the python version for TF foot printing. The examples given here (https://github.com/rajanil/msCentipede) work perfectly however when I replace their BAM files with mine I get the following error while attempting to learn model parameters:

loading motifs ... num of motif sites = 471 loading read counts ...

Traceback (most recent call last):
  File "call_binding.py", line 344, in <module>
    main()
  File "call_binding.py", line 337, in main
    learn_model(options)
  File "call_binding.py", line 70, in learn_model
    for bam_handle in bam_handles])
  File "/Users/rbronste/msCentipede/load_data.py", line 119, in get_read_counts
    sam_iter = self._handle.fetch(reference=chrom, start=left, end=right)
  File "pysam/calignmentfile.pyx", line 896, in pysam.calignmentfile.AlignmentFile.fetch (pysam/calignmentfile.c:10127)
  File "pysam/calignmentfile.pyx", line 821, in pysam.calignmentfile.AlignmentFile.parse_region (pysam/calignmentfile.c:9672)
ValueError: invalid coordinates: start (131130842) > end (130694993)

I assume the difference is in the BAM files themselves, so maybe the headers need to be changed so the tool works. Any ideas would be really helpful. Thank you.

Rob

software error • 2.2k views
ADD COMMENT
0
Entering edit mode

EDIT: Sorry, didn't read the stack trace. It's found a start position that is greater than a stop-position and can't make sense of it, by the looks of things. From the documentation: Start corresponds to the first base of the core motif for + strand motif instances and the last base of the core motif for - strand motif instances. In your BAM-files, is the start-positions on minus-strands greater than stop-position? If so, I'd try switching values for start- and stop-positions for - strand entries.

ADD REPLY

Login before adding your answer.

Traffic: 2662 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6