コード例 #1
0
ファイル: Bins.cpp プロジェクト: HelloWilliam/osiris
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;
}