Exemple #1
0
bool GenotypesForAMarkerSet :: ContainsSampleTriallele (const RGString& locusName, RGDList& alleles) {

	RGDList locusCollection;

	if (mSampleTriAlleles == NULL)
		return false;

	if (!mSampleTriAlleles->FindAllCopiesOfNamedLocus (locusName, locusCollection))
		return false;

	RGDListIterator itCollection (locusCollection);
	IndividualLocus* nextLocus;

	while (nextLocus = (IndividualLocus*) itCollection ()) {

		if (nextLocus->IsContainedIn (alleles)) {

			locusCollection.Clear ();
			return true;
		}
	}
	
	locusCollection.Clear ();
	return false;
}
Exemple #2
0
bool GenotypesForAMarkerSet :: ContainsOffLadderAllele (const RGString& locusName, const RGString& alleleName) {

	RGDList alleleList;
	bool returnValue;

	if (mOffLadderAlleles == NULL)
		return false;

	if (!mOffLadderAlleles->FindAllAllelesForNamedLocus (locusName, alleleList)) {

		alleleList.Clear ();
		return false;
	}

	IndividualAllele target;
	target.SetName (alleleName);

	if (alleleList.Contains (&target))
		returnValue = true;

	else
		returnValue = false;

	alleleList.Clear ();
	return returnValue;
}
Exemple #3
0
Boolean STRBaseLocus :: ExtractGridSignals (RGDList& channelSignalList, const LaneStandard* ls, RGDList& locusDataSignalList, ChannelData* lsData, Locus* locus) {

    int lsSize = ls->GetNumberOfCharacteristics ();
    int i1;
    int i2;
    double c1;
    double c2;
    Notice* newNotice;

    if (lsSize < 0) {

        Msg << "Number of characteristics not available for Locus named " << LocusName << "\n";
        newNotice = new SetupErrorNumberPeaksUnavailableForLocus;
        locus->AddNoticeToList (newNotice);
        return FALSE;
    }

    if (LowerBoundGridLSBasePair < 0.0) {

        i1 = (int) floor (LowerBoundGridLSIndex);

        if (i1 < 0) {

            Msg << "Internal Lane Standard lower bound index for Grid is out of bounds for Locus named " << LocusName << "\n";
            return FALSE;
        }

        i2 = i1 + 1;
        c2 = LowerBoundGridLSIndex - i1;
        c1 = 1.0 - c2;
        MinimumGridTime = c1 * ls->GetLaneStandardTimeForCharacteristicNumber (i1) +
                          c2 * ls->GetLaneStandardTimeForCharacteristicNumber (i2);
//		cout << "Not using base pairs for minimum of locus " << LocusName << endl;
    }

    else
        MinimumGridTime = lsData->GetTimeForSpecifiedID (LowerBoundGridLSBasePair);

    if (UpperBoundGridLSBasePair < 0.0) {

        i1 = (int) floor (UpperBoundGridLSIndex);

        if (i1 < 0) {

            Msg << "Internal Lane Standard upper bound index for Grid is out of bounds for Locus named " << LocusName << "\n";
            return FALSE;
        }

        i2 = i1 + 1;
        c2 = UpperBoundGridLSIndex - i1;
        c1 = 1.0 - c2;
        MaximumGridTime = c1 * ls->GetLaneStandardTimeForCharacteristicNumber (i1) +
                          c2 * ls->GetLaneStandardTimeForCharacteristicNumber (i2);
//		cout << "Not using base pairs for maximum of locus " << LocusName << endl;
    }

    else
        MaximumGridTime = lsData->GetTimeForSpecifiedID (UpperBoundGridLSBasePair);

    RGDListIterator it (channelSignalList);
    DataSignal* nextSignal;
    double nextMean;
    locusDataSignalList.Clear ();

    // Assume channelSignalList is in increasing order by signal means

    while (nextSignal = (DataSignal*) it ()) {

        nextMean = nextSignal->GetMean ();

        if (nextMean >= MinimumGridTime) {

            if (nextMean <= MaximumGridTime) {

                it.RemoveCurrentItem ();
                locusDataSignalList.Append (nextSignal);
            }

            else
                break;
        }
    }

    if (locusDataSignalList.Entries () < mLocusSize) {

        Msg << "Locus named " << LocusName << " could not find the required number of unanalyzed peaks in range\n";
        newNotice = new LocusHasTooFewPeaks;
        locus->AddNoticeToList (newNotice);
        return FALSE;
    }

    return TRUE;
}