Ejemplo n.º 1
0
static void addAttrVals(struct gff3Ann *g3a, char *attr, char *valStr)
/* Add an attribute to the list of attributes.  If attribute has already been
 * specified, values are merged.  Attribute name must already be unescaped,
 * attribute values will be split and then unescaped. */
{
struct gff3AttrVals *attrVals = gff3AnnFindAttr(g3a, attr);
if (attrVals == NULL)
    {
    attrVals = gff3FileAlloc(g3a->file, sizeof(struct gff3AttrVals));
    attrVals->attr = gff3FileCloneStr(g3a->file, attr);
    slAddHead(&g3a->attrs, attrVals);
    }
attrVals->vals = slCat(attrVals->vals, parseAttrVals(g3a, attr, valStr));
}
Ejemplo n.º 2
0
static void processMatchLine(FILE *pslF, struct gff3Ann *node,
                             struct hash *chromHash)
{
    struct gff3Attr *attr = gff3AnnFindAttr(node, "Gap");

    char *cigar = NULL;
    if (!((attr == NULL) || (attr->vals == NULL) || (attr->vals->name == NULL)))
        cigar = attr->vals->name;

    struct nameAndSize *nsT = getNameAndSize(chromHash, node->targetId);
    struct nameAndSize *nsQ = getNameAndSize(chromHash, node->seqid);

    struct psl *psl = pslFromGff3Cigar(node->seqid, nsQ->size,  node->start, node->end,
                                       nsT->name, nsT->size,  node->targetStart, node->targetEnd,
                                       node->targetStrand, cigar);
    pslOutput(psl, pslF, '\t' , '\n');
    pslFree(&psl);
}