Esempio n. 1
0
struct asObject *bigBedAs(struct bbiFile *bbi)
/* Get autoSql object definition if any associated with file. */
{
if (bbi->asOffset == 0)
    return NULL;
char *asText = bigBedAutoSqlText(bbi);
struct asObject *as = asParseText(asText);
freeMem(asText);
return as;
}
Esempio n. 2
0
void bedToBigBed(char *inName, char *chromSizes, char *outName)
/* bedToBigBed - Convert bed file to bigBed.. */
{
struct slName *extraIndexList = slNameListFromString(extraIndex, ',');
struct asObject *as = asParseText(asText);
if (as == NULL)
    errAbort("AutoSql file (%s) not in legal format.", asFile);
asCompareObjAgainstStandardBed(as, bedN, TRUE); // abort if bedN columns are not standard
bbFileCreate(inName, chromSizes, blockSize, itemsPerSlot, asText, as, 
	doCompress, extraIndexList, outName);
}
Esempio n. 3
0
struct annoStreamer *annoStreamWigDbNew(char *db, char *table, struct annoAssembly *aa,
					int maxOutput)
/* Create an annoStreamer (subclass) object from a wiggle database table. */
{
struct annoStreamWig *self = NULL;
AllocVar(self);
self->wigStr = annoStreamDbNew(db, table, aa, maxOutput, NULL);
struct annoStreamer *streamer = &(self->streamer);
annoStreamerInit(streamer, aa, asParseText(annoRowWigAsText), self->wigStr->name);
streamer->rowType = arWigVec;
streamer->setRegion = aswSetRegion;
streamer->nextRow = aswNextRow;
streamer->close = aswClose;
return (struct annoStreamer *)self;
}
Esempio n. 4
0
struct annoStreamer *annoStreamBigWigNew(char *fileOrUrl, struct annoAssembly *aa)
/* Create an annoStreamer (subclass) object from a file or URL. */
{
struct bbiFile *bbi = bigWigFileOpen(fileOrUrl);
struct asObject *asObj = asParseText(annoRowBigWigAsText);
struct annoStreamBigWig *self = NULL;
AllocVar(self);
struct annoStreamer *streamer = &(self->streamer);
annoStreamerInit(streamer, aa, asObj, fileOrUrl);
streamer->rowType = arWig;
streamer->setRegion = asbwSetRegion;
streamer->nextRow = asbwNextRow;
streamer->close = asbwClose;
self->chromList = bbiChromList(bbi);
self->bbi = bbi;
return (struct annoStreamer *)self;
}
Esempio n. 5
0
struct asObject *getAsObj(int columnCount)
/* If the -as=table.as option was given, parse the autoSql file into an asObject.
 * Otherwise try to deduce autoSql from type; if no type info, just return NULL. */
{
struct asObject *asObj = NULL;
if (as != NULL)
    {
    asObj = asParseFile(as);
    if (asObj->next != NULL)
	errAbort("Can only handle .as files containing a single object.");
    if (typeBedN > 0)
	// abort if -type=bedN columns are not standard
	asCompareObjAgainstStandardBed(asObj, typeBedN, TRUE);
    }
else if (bedDetail)
    asObj = bedDetailAsObj();
else if (typeBedN > 0)
    {
    char *asText = bedAsDef(typeBedN, columnCount);
    asObj = asParseText(asText);
    freeMem(asText);
    }
return asObj;
}
Esempio n. 6
0
struct asObject *vcfAsObj()
// Return asObject describing fields of VCF
{
return asParseText(vcfDataLineAutoSqlString);
}
Esempio n. 7
0
struct asObject *makeItemsItemAsObj()
// Return asObject describing fields of makeItemsItem
{
return asParseText(makeItemsItemAutoSqlString);
}
Esempio n. 8
0
struct asObject *annoStreamBigWigAsObject()
/* Return an asObj that describes annoRow contents for wiggle (just float value). */
{
return asParseText(annoRowBigWigAsText);
}