Пример #1
0
void hgGenericMicroarray(char *file)
/* Load the simple file into two tables.*/
{
struct expRecord *exps = NULL;
struct expData *data = NULL;
struct lineFile *lf = lineFileOpen(file,TRUE);
char *strings[1000];
int ncols, i, n;
/* First line has experiment info */
ncols = lineFileChopTab(lf,strings);
for (i = 1; i < ncols; i++)
    {
    struct expRecord *oneRec = NULL;
    AllocVar(oneRec);
    oneRec->id = i - 1;
    oneRec->name = cloneString(strings[i]);
    oneRec->description = cloneString(strings[i]);
    oneRec->url = CSNA;
    oneRec->ref = CSNA;
    oneRec->credit = CSNA;
    oneRec->numExtras = 3;
    AllocArray(oneRec->extras, oneRec->numExtras);
    oneRec->extras[0] = cloneString("n/a");
    oneRec->extras[1] = cloneString("n/a");
    oneRec->extras[2] = cloneString(strings[i]);
    slAddHead(&exps, oneRec);
    }
slReverse(&exps);
/* Other lines have the data. */
while ((n = lineFileChopTab(lf,strings)) > 0)
    {
    struct expData *oneGene = NULL;
    AllocVar(oneGene);
    oneGene->name = cloneString(strings[0]);
    oneGene->expCount = ncols - 1;
    AllocArray(oneGene->expScores, oneGene->expCount);
    for (i = 1; i < ncols; i++)
	oneGene->expScores[i-1] = sqlFloat(strings[i]);
    slAddHead(&data, oneGene);
    }
if ((n != ncols) && (n > 0))
    errAbort("Wrong number of columns in line %d of %s. Got %d, want %d", lf->lineIx, file, n, ncols);
slReverse(&data);
saveExpsTable(exps);
saveDataTable(data);
expRecordFreeList(&exps);
expDataFreeList(&data);
lineFileClose(&lf);
}
Пример #2
0
void EvalMainWindow::onActionSaveDataTable()
{
  emit saveDataTable();
}