Ejemplo n.º 1
0
static int releaseSanity(struct gbRelease* release, char *database)
/* Run sanity checks on a release */
{
unsigned orgCats;
int checkedSetCnt = 0;

/* check if native, and/or xeno should be included */
orgCats = getLoadOrgCats(database, release->srcDb, GB_MRNA);
if (orgCats != 0)
    {
    if (checkRelease(release, database, GB_MRNA, orgCats, NULL))
        checkedSetCnt++;
    }

orgCats = getLoadOrgCats(database, release->srcDb, GB_EST);
if (orgCats != 0)
    {
    struct slName* prefixes, *prefix;
    boolean checkedSome = FALSE;
    if (gOptions.accPrefixRestrict != NULL)
        prefixes = newSlName(gOptions.accPrefixRestrict);
    else
        prefixes = gbReleaseGetAccPrefixes(release, GB_PROCESSED, GB_EST);
    for (prefix = prefixes; prefix != NULL; prefix = prefix->next)
        {
        if (checkRelease(release, database, GB_EST, orgCats, prefix->name))
            checkedSome = TRUE;
        }
    slFreeList(&prefixes);
    if (checkedSome)
        checkedSetCnt++;
    }
return checkedSetCnt;
}
Ejemplo n.º 2
0
struct gbRelease* loadIndex(char* relName, unsigned types, char* database)
/* load processed section of index for release */
{
struct gbIndex* index = gbIndexNew(database, NULL);
struct gbSelect select;
ZeroVar(&select);
select.release = gbIndexMustFindRelease(index, relName);

if (types & GB_MRNA)
    {
    select.type = GB_MRNA;
    gbReleaseLoadProcessed(&select);
    }
if ((types & GB_EST) && (select.release->srcDb == GB_GENBANK))
    {
    struct slName* prefixes, *prefix;
    select.type = GB_EST;
    prefixes = gbReleaseGetAccPrefixes(select.release, GB_PROCESSED, GB_EST);
    for (prefix = prefixes; prefix != NULL; prefix = prefix->next)
        {
        select.accPrefix = prefix->name;
        gbReleaseLoadProcessed(&select);
        }
    select.accPrefix = NULL;
    slFreeList(&prefixes);
    }

return select.release;
}
Ejemplo n.º 3
0
static void testLoadPrefixes(struct gbSelect* select, unsigned flags,
                             char* restrictPrefix)
/* do load testing of part of a release */
{
struct slName* prefixes, *prefix;
if (restrictPrefix != NULL)
    prefixes = slNameNew(restrictPrefix);
else
    prefixes = gbReleaseGetAccPrefixes(select->release, GB_PROCESSED, GB_EST);
for (prefix = prefixes; prefix != NULL; prefix = prefix->next)
    {
    select->accPrefix = prefix->name;
    testLoad(select, flags);
    }
slFreeList(&prefixes);
select->accPrefix = NULL;
}
Ejemplo n.º 4
0
static void getReleasePartitions(struct gbSelect** selectList,
                                 struct gbRelease* release,
                                 unsigned state,
                                 unsigned types,
                                 unsigned orgCats,
                                 char *limitAccPrefix)
/* Get partitions for a release and add to list */
{
if (types & GB_MRNA)
    getTypePartitions(selectList, release, GB_MRNA, orgCats, NULL);
if ((types & GB_EST) && (release->srcDb != GB_REFSEQ))
    {
    struct slName* prefixes, *prefix;
    if (limitAccPrefix != NULL)
        prefixes = newSlName(limitAccPrefix);
    else
        prefixes = gbReleaseGetAccPrefixes(release, state, GB_EST);

    for (prefix = prefixes; prefix != NULL; prefix = prefix->next)
        getTypePartitions(selectList, release, GB_EST, orgCats, prefix->name);
    slFreeList(&prefixes);
    }
}