Example #1
0
static void sequenceSetup() {
    metaSequence = metaSequence_construct(0, 10, "ACTGACTGAC", ">one",
            event_getName(eventTree_getRootEvent(eventTree)), cactusDisk);
    sequence = sequence_construct(metaSequence, flower);
    metaSequence2 = metaSequence_construct(0, 10, "ACTGACTGAC", ">two",
            event_getName(eventTree_getRootEvent(eventTree)), cactusDisk);
    sequence2 = sequence_construct(metaSequence2, flower);
}
static void cactusMetaSequenceTestSetup() {
	if(!nestedTest) {
		cactusMetaSequenceTestTeardown();
		cactusDisk = testCommon_getTemporaryCactusDisk();
		metaSequence = metaSequence_construct(1, 10, sequenceString,
					   headerString, eventName, cactusDisk);
	}
}
Example #3
0
void testCactusDisk_getMetaSequence(CuTest* testCase) {
    cactusDiskTestSetup();
    MetaSequence *metaSequence = metaSequence_construct(1, 10, "ACTGACTGAG",
            "FOO", 10, cactusDisk);
    MetaSequence *metaSequence2 = metaSequence_construct(2, 10, "CCCCCCCCCC",
            "BAR", 10, cactusDisk);
    CuAssertTrue(testCase, cactusDisk_getMetaSequence(cactusDisk, metaSequence_getName(metaSequence)) == metaSequence);
    CuAssertTrue(testCase, cactusDisk_getMetaSequence(cactusDisk, metaSequence_getName(metaSequence2)) == metaSequence2);
    //now try closing the disk, then reloading it, to see if we get the same result.
    Name name1 = metaSequence_getName(metaSequence);
    Name name2 = metaSequence_getName(metaSequence2);
    cactusDisk_write(cactusDisk);
    cactusDisk_destruct(cactusDisk);
    cactusDisk = cactusDisk_construct(conf, 0);
    metaSequence = cactusDisk_getMetaSequence(cactusDisk, name1);
    metaSequence2 = cactusDisk_getMetaSequence(cactusDisk, name2);
    CuAssertTrue(testCase, metaSequence != NULL);
    CuAssertTrue(testCase, metaSequence2 != NULL);
    CuAssertTrue(testCase, metaSequence_getName(metaSequence) == name1);
    CuAssertTrue(testCase, metaSequence_getName(metaSequence2) == name2);
    cactusDiskTestTeardown();
}
Example #4
0
void processSequence(const char *fastaHeader, const char *string, int64_t length) {
    /*
     * Processes a sequence by adding it to the flower disk.
     */
    End *end1;
    End *end2;
    Cap *cap1;
    Cap *cap2;
    MetaSequence *metaSequence;
    Sequence *sequence;

    //Now put the details in a flower.
    metaSequence = metaSequence_construct(2, length, string, fastaHeader, event_getName(event), cactusDisk);
    sequence = sequence_construct(metaSequence, flower);

    end1 = end_construct2(0, isComplete, flower);
    end2 = end_construct2(1, isComplete, flower);
    cap1 = cap_construct2(end1, 1, 1, sequence);
    cap2 = cap_construct2(end2, length + 2, 1, sequence);
    cap_makeAdjacent(cap1, cap2);
    totalSequenceNumber++;
}