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


Java IntArrayList.clear方法代碼示例

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


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

示例1: overlappingReadIndicesBySampleIndex

import it.unimi.dsi.fastutil.ints.IntArrayList; //導入方法依賴的package包/類
private int[][] overlappingReadIndicesBySampleIndex(final GenomeLoc overlap) {
    if (overlap == null)
        return null;
    final int sampleCount = samples.sampleCount();
    final int[][] result = new int[sampleCount][];
    final IntArrayList buffer = new IntArrayList(200);
    final int referenceIndex = overlap.getContigIndex();
    final int overlapStart = overlap.getStart();
    final int overlapEnd = overlap.getStop();
    for (int s = 0; s < sampleCount; s++) {
        buffer.clear();
        final GATKSAMRecord[] sampleReads = readsBySampleIndex[s];
        final int sampleReadCount = sampleReads.length;
        buffer.ensureCapacity(sampleReadCount);
        for (int r = 0; r < sampleReadCount; r++)
            if (unclippedReadOverlapsRegion(sampleReads[r], referenceIndex, overlapStart, overlapEnd))
                buffer.add(r);
        result[s] = buffer.toIntArray();
    }
    return result;
}
 
開發者ID:PAA-NCIC,項目名稱:SparkSeq,代碼行數:22,代碼來源:ReadLikelihoods.java

示例2: contaminationDownsampling

import it.unimi.dsi.fastutil.ints.IntArrayList; //導入方法依賴的package包/類
public void contaminationDownsampling(final Map<String, Double> perSampleDownsamplingFraction) {

        final int sampleCount = samples.sampleCount();
        final IntArrayList readsToRemove = new IntArrayList(10); // blind estimate, can be improved?
        final int alleleCount = alleles.alleleCount();
        for (int s = 0; s < sampleCount; s++) {
            final String sample = samples.sampleAt(s);
            final Double fractionDouble = perSampleDownsamplingFraction.get(sample);
            if (fractionDouble == null)
                continue;
            final double fraction = fractionDouble;
            if (Double.isNaN(fraction) || fraction <= 0.0)
                continue;
            if (fraction >= 1.0) {
                final int sampleReadCount = readsBySampleIndex[s].length;
                readsToRemove.ensureCapacity(sampleReadCount);
                for (int r = 0; r < sampleReadCount; r++)
                    readsToRemove.add(r);
                removeSampleReads(s, readsToRemove, alleleCount);
                readsToRemove.clear();
            } else {
                final Map<A, List<GATKSAMRecord>> readsByBestAllelesMap = readsByBestAlleleMap(s);
                removeSampleReads(s, AlleleBiasedDownsamplingUtils.selectAlleleBiasedReads(readsByBestAllelesMap, fraction), alleleCount);
            }
        }
    }
 
開發者ID:PAA-NCIC,項目名稱:SparkSeq,代碼行數:27,代碼來源:ReadLikelihoods.java

示例3: filterToOnlyOverlappingUnclippedReads

import it.unimi.dsi.fastutil.ints.IntArrayList; //導入方法依賴的package包/類
/**
 * Remove those reads that do not overlap certain genomic location.
 * <p>
 * <p>
 * This method modifies the current read-likelihoods collection.
 * </p>
 *
 * @param location the target location.
 * @throws IllegalArgumentException the location cannot be {@code null} nor unmapped.
 */
@SuppressWarnings("unused")
public void filterToOnlyOverlappingUnclippedReads(final GenomeLoc location) {
    if (location == null)
        throw new IllegalArgumentException("the location cannot be null");
    if (location.isUnmapped())
        throw new IllegalArgumentException("the location cannot be unmapped");

    final int sampleCount = samples.sampleCount();

    final int locContig = location.getContigIndex();
    final int locStart = location.getStart();
    final int locEnd = location.getStop();

    final int alleleCount = alleles.alleleCount();
    final IntArrayList removeIndices = new IntArrayList(10);
    for (int s = 0; s < sampleCount; s++) {
        int readRemoveCount = 0;
        final GATKSAMRecord[] sampleReads = readsBySampleIndex[s];
        final int sampleReadCount = sampleReads.length;
        for (int r = 0; r < sampleReadCount; r++)
            if (!unclippedReadOverlapsRegion(sampleReads[r], locContig, locStart, locEnd))
                removeIndices.add(r);
        removeSampleReads(s, removeIndices, alleleCount);
        removeIndices.clear();
    }
}
 
開發者ID:PAA-NCIC,項目名稱:SparkSeq,代碼行數:37,代碼來源:ReadLikelihoods.java


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