void HDFCmpExperimentGroup::AddQVs(const std::vector<UChar> &qualityValues,
                                   const std::string &fieldName, unsigned int *offsetBegin,
                                   unsigned int *offsetEnd)
{
    std::vector<UChar> paddedQualityValues = qualityValues;
    paddedQualityValues.push_back(0);
    HDFArray<UChar> *arrayPtr = NULL;

    // This seems to be how we do it
    if (fieldName == "DeletionQV") {
        arrayPtr = &deletionQV;
    } else if (fieldName == "InsertionQV") {
        arrayPtr = &insertionQV;
    } else if (fieldName == "MergeQV") {
        arrayPtr = &mergeQV;
    } else if (fieldName == "SubstitutionQV") {
        arrayPtr = &substitutionQV;
    } else {
        assert(false);
    }

    if (!arrayPtr->isInitialized) arrayPtr->Initialize(experimentGroup, fieldName);
    *offsetBegin = arrayPtr->size();
    *offsetEnd = arrayPtr->size() + qualityValues.size();

    arrayPtr->Write(&paddedQualityValues[0], paddedQualityValues.size());
}
 int Initialize(HDFGroup &parentGroup) {
     if (movieInfoGroup.Initialize(parentGroup.group, "MovieInfo") == 0) {
         return 0;
     }
     if (idArray.Initialize(movieInfoGroup, "ID") == 0) {
         return 0;
     }
     if (nameArray.Initialize(movieInfoGroup, "Name") == 0) {
         return 0;
     }
     return 1;
 }
    void StoreFrameRate(int movieIndex, float frameRate) {
        if (movieIndex < 0) {
            cout << "ERROR. Invalid movie index " << movieIndex << endl;
            exit(1);
        }

        if (!frameRateArray.IsInitialized()) {
            if (!movieInfoGroup.ContainsObject("FrameRate")) {
                frameRateArray.Create(movieInfoGroup, "FrameRate");
            }
            else {
                frameRateArray.Initialize(movieInfoGroup, "FrameRate");
            }
        }
        frameRateArray.WriteToPos(&frameRate, 1, movieIndex);
    }
void HDFCmpExperimentGroup::AddTags(const std::vector<char> &qualityValues,
                                    const std::string &fieldName, unsigned int *offsetBegin,
                                    unsigned int *offsetEnd)
{
    std::vector<char> paddedQualityValues = qualityValues;
    paddedQualityValues.push_back(0);
    HDFArray<char> *arrayPtr = NULL;

    if (fieldName == "DeletionTag") {
        arrayPtr = &deletionTag;
    } else if (fieldName == "SubstitutionTag") {
        arrayPtr = &substitutionTag;
    } else {
        assert(false);
    }

    if (!arrayPtr->isInitialized) arrayPtr->Initialize(experimentGroup, fieldName);
    *offsetBegin = arrayPtr->size();
    *offsetEnd = arrayPtr->size() + qualityValues.size();

    arrayPtr->Write(&paddedQualityValues[0], paddedQualityValues.size());
}