be4311c07e14feb728abc6425ee606ffaa611a58 markd Fri Jan 22 06:46:58 2021 -0800 merge with master diff --git src/hg/lib/mafGene.c src/hg/lib/mafGene.c index 4fea9e9..65b2876 100644 --- src/hg/lib/mafGene.c +++ src/hg/lib/mafGene.c @@ -615,35 +615,48 @@ * remove all the dashes from the reference sequence, and collapse * all the separate maf blocks into one sequence */ static int copyAli(struct hash *siHash, struct mafAli *ali, int start) { struct mafComp *comp = ali->components; int jj; for(; comp; comp = comp->next) { char *chrom = strchr(comp->src, '.'); if (chrom == NULL) errAbort("all components must have a '.'"); - *chrom++ = 0; + // nowadays we may have a '.' in the assembly name, so if we don't find the chrom + // let's try to see if that extra dot is in there + char saveChar = *chrom; + *chrom = 0; struct speciesInfo *si = hashFindVal(siHash, comp->src); + if (si == NULL) // didn't find the chrom name... maybe because the assembly name has a dot + { + *chrom = saveChar; // restore the dot in the assembly name + chrom = strchr(chrom + 1, '.'); // look for the second dot + if (chrom == NULL) + continue; + *chrom = 0; + si = hashFindVal(siHash, comp->src); // did we find it? if (si == NULL) continue; + } + chrom++; if (comp->strand == '+') updatePosString(si, chrom, comp->strand, comp->start, comp->start + comp->size); else updatePosString(si, chrom, comp->strand, comp->srcSize - (comp->start + comp->size), comp->srcSize - comp->start); char *tptr = ali->components->text; int size = 0; for(jj = 0 ; jj < ali->textSize; jj++) if (*tptr++ != '-') size++;