int main(int argc, char *argv[])
{
char *db="hg15";
printf("%s organism ID = %d\n", db, hOrganismID(db));
printf("%s scientific name = %s\n", db, hScientificName(db));
return 0;
}
Ejemplo n.º 2
0
static void getAssemblyInfo(struct cartJson *cj, struct hash *paramHash)
/* Return useful things from dbDb (or track hub) and assembly description html (possibly NULL).
 * If db param is NULL, use db from cart. */
{
char *db = cartJsonOptionalParam(paramHash, "db");
if (db == NULL)
    db = cartString(cj->cart, "db");
jsonWriteString(cj->jw, "db", db);
jsonWriteString(cj->jw, "commonName", hGenome(db));
jsonWriteString(cj->jw, "scientificName", hScientificName(db));
jsonWriteString(cj->jw, "dbLabel", hFreezeDate(db));
//#*** TODO: move jsonStringEscape inside jsonWriteString
jsonWriteString(cj->jw, "assemblyDescription", jsonStringEscape(hAssemblyDescription(db)));
}
static int findTaxon(struct sqlConnection *conn, char *db)
/* return the taxon for the given db, or abort */
{
char sql[256];
int taxon = 0;
char *fmt = "select ncbi_taxa_id from go.species "
"where concat(genus,' ',species) = '%s'";
safef(sql,sizeof(sql),fmt,hScientificName(db));
taxon = sqlQuickNum(conn, sql);
if (taxon == 0) 
    {
    if (sameString(db,"nibb"))   /* we don't really have this frog as an assembly */
	taxon = 8355;    /* Xenopus laevis - African clawed frog */
    /* can put more here in future */    
    }
if (taxon == 0)
   errAbort("unknown taxon for db = %s, unable to continue until its taxon is defined.",db);
return taxon;
}