cgat-developers / cgat-apps

cgat-apps repository
Other
33 stars 14 forks source link

{is} bam2geneprofile bigwig #68

Closed IanSudbery closed 4 years ago

IanSudbery commented 4 years ago

Addresses #36 and #67.

Mostly completing the changes so that bam2geneprofile uses pyBigWig rather than bx-python.

Also adds routines that checks if the requested intervals were

  1. Zero length
  2. Go off the end of the contig.

Currently going off the 5' end of the contig is checked by the the (Gene/UTR/Intron etc)Counters, while the 3' is only checked in IntervalCounterBigWig. 3' ends should probably be checked for BAM based counting as well (3' ends can't be checked for Bed based counting).

Currently the Signal file backed counters are the only ones with access to the contig sizes. This makes sense, because whether or not they are available depends on the type of file backing them. The interval backed counters are the ones that know if an interval is a primary interval or a flank.

Both 3' and 5' checks should be moved to one or the other, and extended to all file types (where possible). But not clear how to do this.

Acribbs commented 4 years ago

Looks good to me. However, I thought that you were going to warn users rather than error?

IanSudbery commented 4 years ago

The error is for if the interval is invalid for an unknown reason. Lines 476, 477 and 480 deal with overhanging intervals.

Acribbs commented 4 years ago

Ah ok, I see now.

Acribbs commented 4 years ago

Can this be merged @IanSudbery?

IanSudbery commented 4 years ago

Yes