本文整理匯總了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;
}
示例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);
}
}
}
示例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();
}
}