diff --git a/CHANGELOG.md b/CHANGELOG.md index 886d224..f7066a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ Version 0.1.10: * Added the --version/-v option. * Fixed the -h/--help option, which actually wasn't recognized before! * Added the --minDepth option. + * Fixed handling of the `XG` auxiliary tag, since some aligners other than bismark are using it (and for different purposes). This is the single biggest annoyance of custom auxiliary tags. Version 0.1.9: diff --git a/common.c b/common.c index b633881..1e5d8a8 100644 --- a/common.c +++ b/common.c @@ -44,6 +44,8 @@ inline int isCHH(char *seq, int pos, int seqlen) { int getStrand(bam1_t *b) { char *XG = (char *) bam_aux_get(b, "XG"); + //Only bismark uses the XG tag like this. Some other aligners use it for other purposes... + if(XG != NULL && *(XG+1) != 'C' && *(XG+1) != 'G') XG = NULL; if(XG == NULL) { //Can't handle non-directional libraries! if(b->core.flag & BAM_FPAIRED) { if((b->core.flag & 0x50) == 0x50) return 2; //Read1, reverse comp. == OB