static boolean isNameMatch(struct track *track, char *str, char *op)
{
return str && strlen(str) &&
    ((sameString(op, "is") && !strcasecmp(track->shortLabel, str)) ||
    (sameString(op, "is") && !strcasecmp(track->longLabel, str)) ||
    (sameString(op, "contains") && containsStringNoCase(track->shortLabel, str) != NULL) ||
    (sameString(op, "contains") && containsStringNoCase(track->longLabel, str) != NULL));
}
Beispiel #2
0
static struct mappingInfo *mappingInfoNew(struct sqlConnection *conn,
                                          char *tbl, char *mappedId)
/* load mapping info for a mapped gene */
{
struct mappingInfo *mi;
int preLen;
char *suffix = containsStringNoCase(tbl,"Info");
int suffixLen = 4;
AllocVar(mi);
if (startsWith("retroAnc", tbl))
    safef(mi->tblPre, sizeof(mi->tblPre), "retroAnc");
else if (startsWith("retroOld", tbl))
    safef(mi->tblPre, sizeof(mi->tblPre), "retroOld");
else if (startsWith("retro", tbl))
    safef(mi->tblPre, sizeof(mi->tblPre), "retro");
else
    {
    safef(mi->tblPre, sizeof(mi->tblPre), "ucsc");
    suffix = containsStringNoCase(tbl,"Ali");
    suffixLen = 3;
    }
if (suffix != NULL)
    {
    suffix +=suffixLen;
    safef(mi->suffix,ID_BUFSZ,"%s",suffix);
    }

preLen = strlen(mi->tblPre);
if (startsWith("retroAugust", tbl))
    safef(mi->geneSet, sizeof(mi->geneSet), "August");
else if (startsWith("retro", tbl))
    safef(mi->geneSet, sizeof(mi->geneSet), "Mrna");
else
    safef(mi->geneSet, sizeof(mi->geneSet), "Retro");
if (suffix != NULL && strlen(suffix) > 0)
    mi->pg = sqlQueryObjs(conn, (sqlLoadFunc)ucscRetroInfoLoad, sqlQueryMust|sqlQuerySingle,
                      "select * from %s%sInfo%s where name='%s'", mi->tblPre, mi->geneSet, suffix,
                       mappedId);
else
    {
    mi->pg = sqlQueryObjs(conn, (sqlLoadFunc)ucscRetroInfoLoad, sqlQueryMust|sqlQuerySingle,
                      "select * from %s%sInfo where name='%s'", mi->tblPre, mi->geneSet,
                       mappedId);
    }
parseSrcId(mi);
getGenbankInfo(conn, mi);
return mi;
}
int main(int argc, char *argv[]) 
{
if(argc == 1 && !cgiIsOnWeb())
    usage();
cgiSpoof(&argc, argv);
checkArguments();
hSetDb(origGenome);
if(hgTest)
    runSamples("hgCoordConv.test.good", "hgCoordConv.test.bad", origGenome, origGenome, numTests);
else 
    {
/* do our thing  */
    if(calledSelf)  
        {
	cartEmptyShell(doConvertCoordinates, hUserCookie(), excludeVars, NULL);
        }
    else
        {
        /* Check to see if in zoo browser... if so call doFormZoo */
        if (!containsStringNoCase(origDb, "zoo"))
	cartEmptyShell(doForm, hUserCookie(), excludeVars, NULL);
    else
	cartEmptyShell(doFormZoo, hUserCookie(), excludeVars, NULL);
        }    
    }
return 0;
}
Beispiel #4
0
static boolean keepGbEntry(boolean isEst)
/* should the current entry in the kvt be kept? */
{
char *acc = gbAccessionField->val->string;
char *cat = kvtGet(kvt, "cat")->val;
char *org = kvtGet(kvt, "org")->val;

if (genbankBlackListFail(acc, blackListRanges))
    return FALSE;
else if (gbOrg && (differentString(org, gbOrg)))
    return FALSE;
else if (gbGuessSrcDb(acc) == GB_REFSEQ)
    {
    return (startsWith("NM_", acc) || startsWith("NR_", acc)
            || ((startsWith("XM_", acc) && inclXMs)));
    }
else if ((sameString(cat, "GSS") || 
         sameString(cat, "HTG") || 
        sameString(cat, "STS") || 
        sameString(cat, "CON")) && !(gbType & GB_DNA))
    return FALSE;   // division to ignore
else
    {
    if (sameString(cat, "EST")) {
        return (gbType & GB_EST) != 0;
        }
    else if (gbType & GB_MRNA)
        {
        // not an EST, keep any type of RNA
        return containsStringNoCase(kvtGet(kvt, "mol")->val, "RNA") != NULL;
        }
    else if (gbType & GB_DNA)
        {
        // keep any type of DNA if DNA filter set
        return containsStringNoCase(kvtGet(kvt, "mol")->val, "DNA") != NULL;
        }
    else
        return FALSE;
    }
}