當前位置: 首頁>>代碼示例>>Java>>正文


Java IntArrayList.get方法代碼示例

本文整理匯總了Java中it.unimi.dsi.fastutil.ints.IntArrayList.get方法的典型用法代碼示例。如果您正苦於以下問題:Java IntArrayList.get方法的具體用法?Java IntArrayList.get怎麽用?Java IntArrayList.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在it.unimi.dsi.fastutil.ints.IntArrayList的用法示例。


在下文中一共展示了IntArrayList.get方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: removeSampleReads

import it.unimi.dsi.fastutil.ints.IntArrayList; //導入方法依賴的package包/類
private void removeSampleReads(final int sampleIndex, final IntArrayList indexToRemove, final int alleleCount) {
    final int removeCount = indexToRemove.size();
    if (removeCount == 0)
        return;

    final GATKSAMRecord[] sampleReads = readsBySampleIndex[sampleIndex];
    final int sampleReadCount = sampleReads.length;

    final Object2IntMap<GATKSAMRecord> indexByRead = readIndexBySampleIndex[sampleIndex];
    if (indexByRead != null)
        for (int i = 0; i < removeCount; i++)
            indexByRead.remove(sampleReads[indexToRemove.getInt(i)]);
    final boolean[] removeIndex = new boolean[sampleReadCount];
    int firstDeleted = indexToRemove.get(0);
    for (int i = 0; i < removeCount; i++)
        removeIndex[indexToRemove.get(i)] = true;

    final int newSampleReadCount = sampleReadCount - removeCount;

    // Now we skim out the removed reads from the read array.
    final GATKSAMRecord[] oldSampleReads = readsBySampleIndex[sampleIndex];
    final GATKSAMRecord[] newSampleReads = new GATKSAMRecord[newSampleReadCount];

    System.arraycopy(oldSampleReads, 0, newSampleReads, 0, firstDeleted);
    Utils.skimArray(oldSampleReads, firstDeleted, newSampleReads, firstDeleted, removeIndex, firstDeleted);

    // Then we skim out the likelihoods of the removed reads.
    final double[][] oldSampleValues = valuesBySampleIndex[sampleIndex];
    final double[][] newSampleValues = new double[alleleCount][newSampleReadCount];
    for (int a = 0; a < alleleCount; a++) {
        System.arraycopy(oldSampleValues[a], 0, newSampleValues[a], 0, firstDeleted);
        Utils.skimArray(oldSampleValues[a], firstDeleted, newSampleValues[a], firstDeleted, removeIndex, firstDeleted);
    }
    valuesBySampleIndex[sampleIndex] = newSampleValues;
    readsBySampleIndex[sampleIndex] = newSampleReads;
    readListBySampleIndex[sampleIndex] = null; // reset the unmodifiable list.
}
 
開發者ID:PAA-NCIC,項目名稱:SparkSeq,代碼行數:38,代碼來源:ReadLikelihoods.java


注:本文中的it.unimi.dsi.fastutil.ints.IntArrayList.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。