c26a1d576fadc122a2b907b25d72935f4428ad22 braney Wed Jan 6 11:17:58 2021 -0800 look for a dot in organism names if we're not finding the name without the dot diff --git src/hg/utils/mafToBigMaf/mafToBigMaf.c src/hg/utils/mafToBigMaf/mafToBigMaf.c index 221afe0..2c5808b 100644 --- src/hg/utils/mafToBigMaf/mafToBigMaf.c +++ src/hg/utils/mafToBigMaf/mafToBigMaf.c @@ -36,31 +36,42 @@ char lastChrom[1024]; *lastChrom = 0; unsigned lastEnd = 0; while ((ali = mafNext(mf)) != NULL) { struct mafComp *master = ali->components; char *dot = strchr(master->src, '.'); if (dot == NULL) errAbort("maf block on line %d missing properly formated reference sequence", mf->lf->lineIx); *dot = 0; char *chrom = dot + 1; if (differentString(referenceDb, master->src)) + { + // there might be a dot in the organism name + *dot = '.'; + dot = strchr(dot + 1, '.'); + if (dot != NULL) + { + *dot = 0; + chrom = dot + 1; + } + if ((dot == NULL) || differentString(referenceDb, master->src)) errAbort("reference databases (%s) must be first component of every block on line %d", referenceDb, mf->lf->lineIx); + } if (master->strand != '+') errAbort("reference sequence has to be on positive strand on line %d", mf->lf->lineIx); if (sameString(lastChrom, chrom)) { if (master->start < lastEnd) errAbort("reference sequence out of order on line %d (start address %d is less than last end address %d)", mf->lf->lineIx, master->start, lastEnd); } else safecpy(lastChrom, sizeof lastChrom, chrom); lastEnd = master->start + master->size; fprintf(out, "%s\t%d\t%d\t", chrom, master->start, lastEnd);