Пример #1
0
bool Record::intersects(const Record *record,
                        bool wantSameStrand, bool wantDiffStrand, float overlapFraction, bool reciprocal) const
{
    //must be on same chromosome
    if (!sameChrom(record)) {
        return false;
    }
    return sameChromIntersects(record, wantSameStrand, wantDiffStrand, overlapFraction, reciprocal);
}
Пример #2
0
bool Record::operator > (const Record &other) const {
    if (!sameChrom(&other)) {
        return chromAfter(&other);
    }
    if (_startPos != other._startPos) {
        return _startPos > other._startPos;
    }
    if (_endPos != other._endPos) {
        return _endPos > other._endPos;
    }
    return false;
}
Пример #3
0
bool Record::lessThan(const Record *other) const
{
	if (!sameChrom(other)) {
		return chromBefore(other);
	}
	if (_startPos != other->_startPos) {
		return _startPos < other->_startPos;
	}
	if (_endPos != other->_endPos) {
		return _endPos < other->_endPos;
	}
	return false;
}
Пример #4
0
bool Record::operator < (const Record &other) const
{

    if (!sameChrom(&other)) {
        return chromBefore(&other);
    }
    if (_startPos != other._startPos) {
        return _startPos < other._startPos;
    }
    if (_endPos != other._endPos) {
        return _endPos < other._endPos;
    }
    return false;
}
Пример #5
0
bool Record::greaterThan(const Record *other) const
{
	if (!sameChrom(other)) {
		return chromAfter(other);
	}
	if (_startPos != other->_startPos) {
		return _startPos > other->_startPos;
	}
	if (_endPos != other->_endPos) {
		return _endPos > other->_endPos;
	}
	return false;

}
Пример #6
0
bool Record::intersects(const Record *record,
                        bool sameStrand,
                        bool diffStrand,
                        float overlapFractionA,
                        float overlapFractionB,
                        bool reciprocalFraction,
                        bool eitherFraction) const
{
	//must be on same chromosome
	if (!sameChrom(record)) {
		return false;
	}
	return sameChromIntersects(record,
                               sameStrand, diffStrand,
                               overlapFractionA, overlapFractionB,
                               reciprocalFraction, eitherFraction);
}
Пример #7
0
bool Record::after(const Record *other) const
{
	return (sameChrom(other) && _startPos >= other->_endPos);
}
void cdnaOnOoJobs(char *ooDir, char *conDir, int cdnaCount, char *cdnaTypes[])
/* cdnaOnOoJobs - make condor submission file for EST and mRNA alignments on draft assembly. */
{
char chromDir[512];
char chromFile[512];
char conFile[512];
char shFile[512];
char conPslDir[512];
char conOutDir[512];
char conErrDir[512];
char conLogDir[512];
char conInDir[512];
struct fileInfo *cfaList, *cfa;
struct fileInfo *chromList, *chromEl;
static char lastChromName[64] = "9X8Y";	/* Something uniq. */
boolean lastDoFull = FALSE;
FILE *con, *sh;
int i;


/* Set up basic directory structure in output dir. */
makeDir(conDir);
sprintf(conPslDir, "%s/psl", conDir);
makeDir(conPslDir);
sprintf(conOutDir, "%s/out", conDir);
makeDir(conOutDir);
sprintf(conLogDir, "%s/log", conDir);
makeDir(conLogDir);
sprintf(conErrDir, "%s/err", conDir);
makeDir(conErrDir);
sprintf(conInDir, "%s/in", conDir);
makeDir(conInDir);

/* Create list files for mrna and est. */
for (i=0; i<cdnaCount; i++)
    {
    char fileName[512];
    sprintf(fileName, "/var/tmp/hg/h/mrna/%s.fa", cdnaTypes[i]);
    makeSimpleIn(conInDir, cdnaTypes[i], fileName);
    }

/* Create condor submission file and write header. */
sprintf(conFile, "%s/all.con", conDir);
con = mustOpen(conFile, "w");
fprintf(con, "#File created by cdnaOnOoJobs %s %s\n\n", ooDir, conDir);
fprintf(con,
"universe        = vanilla\n"
"notification    = error\n"
"requirements    = memory > 250\n"
"executable      = /cse/guests/kent/bin/i386/psLayout\n"
"initialdir      = %s\n"
"\n"
 , conDir);

/* Create shell script to finish job. */
sprintf(shFile, "%s/finish.sh", conDir);
sh = mustOpen(shFile, "w");

/* Loop through each chromosome directory. */
chromList = listDirX(ooDir, "*", FALSE);
for (chromEl = chromList; chromEl != NULL; chromEl = chromEl->next)
    {
    int len = strlen(chromEl->name);
    if (chromEl->isDir && len <= 2)
        {
	sprintf(chromDir, "%s/%s", ooDir, chromEl->name);
	cfaList = listDirX(chromDir, "chr*.fa", FALSE);
	slSort(&cfaList, cmpFileInfoUnderbar);

	/* Get list of assembled chromosomes in dir. */
	for (cfa = cfaList; cfa != NULL; cfa = cfa->next)
	    {
	    /* See if is _random version of previous chromosome, in which
	     * case we follow the lead of last time. */
	    printf("%s size %d\n", cfa->name, cfa->size);
	    sprintf(chromFile, "%s/%s", chromDir, cfa->name);
	    if (sameChrom(lastChromName, cfa->name))
		{
		if (lastDoFull)
		    {
		    for (i=0; i<cdnaCount; ++i)
			doFullJob(con, chromFile, lastChromName, conDir, conPslDir, 
				conOutDir, conLogDir, conErrDir, conInDir, cdnaTypes[i]);
		    }
		}
	    else
		{
		strcpy(lastChromName, cfa->name);
		chopSuffix(lastChromName);
		if (cfa->size < 60000000)
		    {
		    lastDoFull = TRUE;
		    for (i=0; i<cdnaCount; ++i)
			doFullJob(con, chromFile, lastChromName, conDir, conPslDir, conOutDir, 
			    conLogDir, conErrDir, conInDir, cdnaTypes[i]);
		    }
		else
		    {
		    lastDoFull = FALSE;
		    for (i=0; i<cdnaCount; ++i)
			doPieceJob(con, sh, ooDir, lastChromName+3, cdnaTypes[i], 
			    conDir, conPslDir, conOutDir, conLogDir, conErrDir, conInDir);
		    }
		}
	    }
	}
    }
}