Beispiel #1
0
Ladder* Bins :: AssembleAllLoci (RGDList& doNotExtend) {

	int nLoci;
	Ladder* newLadder = new Ladder ();
	Locus* nextLocus;
	nLoci = SplitFileIntoLocusStrings ();
	int i;
	int status;
	RGString name;

	if (nLoci <= 0) {

		cout << "Could not complete ladder setup" << endl;
		delete newLadder;
		return NULL;
	}

	for (i=1; i<=nLoci; i++) {

		SplitLocusStringIntoLines (i);
		nextLocus = AssembleLocusFromLineStrings ();
		status = newLadder->AddLocus (nextLocus);

		if (status < 0) {

			cout << "Locus name repeated in bins file:  " << nextLocus->GetName ().GetData () << endl;
			delete newLadder;
			return NULL;
		}

		name = nextLocus->GetName ();

		if (doNotExtend.Contains (&name))
			nextLocus->SetDoNotExtend ();
	}

	return newLadder;
}
Locus* Ladder :: FindLocusByName (const RGString& locusName) {

	Locus* nextLocus;
	list <Locus*>::const_iterator locusIterator;

	for (locusIterator = mLocusList.begin(); locusIterator != mLocusList.end(); locusIterator++) {

		nextLocus = *locusIterator;

		if (nextLocus->GetName () == locusName)
			return nextLocus;
	}

	return NULL;
}