Tabnine Logo
ObjectArraySet
Code IndexAdd Tabnine to your IDE (free)

How to use
ObjectArraySet
in
it.unimi.dsi.fastutil.objects

Best Java code snippets using it.unimi.dsi.fastutil.objects.ObjectArraySet (Showing top 20 results out of 315)

origin: CampagneLaboratory/variationanalysis

public AggregatedSoftmaxGenotypePrediction(BaseInformationRecords.BaseInformation record,
                      List<Prediction> individualOutputPredictions) {
  predictedAlleles = new ObjectArraySet<>();
  trueAlleles = new ObjectArraySet<>();
  set(record, (SoftmaxGenotypePrediction) individualOutputPredictions.get(0),
      (MetadataPrediction) individualOutputPredictions.get(1));
}
origin: it.unimi.dsi/fastutil

/**
 * Creates a new array set copying the contents of a given set.
 * 
 * @param c
 *            a collection.
 */
public ObjectArraySet(final Collection<? extends K> c) {
  this(c.size());
  addAll(c);
}
/**
origin: it.unimi.dsi/fastutil

@Override
public boolean contains(final Object k) {
  return findKey(k) != -1;
}
@Override
origin: CampagneLaboratory/variationanalysis

if (alleleIsCalled) predictedAlleles.add(allele);
if (alleleIsInTrueGenotype) trueAlleles.add(allele);
origin: CampagneLaboratory/variationanalysis

  public static Set<String> getGenotype(String genotype){
    Set<String> alleles = new ObjectArraySet<>();
    for (String allele : genotype.split("/")){
      alleles.add(allele);
    }
    alleles.remove("");
    alleles.remove("?");
    alleles.remove(".");
    return alleles;
  }
}
origin: it.unimi.dsi/fastutil

@Override
public boolean remove(final Object k) {
  final int pos = findKey(k);
  if (pos == -1)
    return false;
  final int tail = size - pos - 1;
  for (int i = 0; i < tail; i++)
    a[pos + i] = a[pos + i + 1];
  size--;
  a[size] = null;
  return true;
}
@Override
origin: it.unimi.dsi/fastutil

/**
 * Creates a new array set copying the contents of a given collection.
 * 
 * @param c
 *            a collection.
 */
public ObjectArraySet(ObjectCollection<K> c) {
  this(c.size());
  addAll(c);
}
/**
origin: CampagneLaboratory/variationanalysis

public static Set<String> fromTosToAlleles(Set<Variant.FromTo> alleles) {
  Set<String> toSet = new ObjectArraySet<>(alleles.size());
  for (Variant.FromTo allele : alleles) {
    toSet.add(allele.getTo());
  }
  return toSet;
}
origin: it.unimi.dsi/fastutil

@Override
public boolean add(final K k) {
  final int pos = findKey(k);
  if (pos != -1)
    return false;
  if (size == a.length) {
    final Object[] b = new Object[size == 0 ? 2 : size * 2];
    for (int i = size; i-- != 0;)
      b[i] = a[i];
    a = b;
  }
  a[size++] = k;
  return true;
}
@Override
origin: CampagneLaboratory/variationanalysis

public SegmentLabelMapper(int ploidy) {
  this.ploidy = ploidy;
  this.labels = new ObjectArraySet<>();
  this.labels.addAll(this.buildLabels(ploidy));
  this.numberOfLabelsPerBase = this.labels.size();
  this.indexedLabels = this.buildLabelMap();
}
origin: CampagneLaboratory/variationanalysis

private int[] assignSelectedIndices(String[] inputNames, Set<String> inputNamesToExport) {
  if (inputNamesToExport == null) {
    inputNamesToExport = new ObjectArraySet<>();
    inputNamesToExport.addAll(ObjectArrayList.wrap(inputNames));
  }
  int[] inputIndicesSelected = new int[inputNames.length];
  if (!inputNamesToExport.isEmpty()) {
    // the none keyword makes it possible to export no inputs.
    inputNamesToExport.remove("none");
    inputIndicesSelected = new int[inputNamesToExport.size()];
    Arrays.fill(inputIndicesSelected, -1);
    int i = 0;
    for (int j = 0; j < inputNames.length; j++) {
      if (inputNamesToExport.contains(inputNames[j])) {
        inputIndicesSelected[i++] = j;
      }
    }
    for (int index : inputIndicesSelected) {
      if (index == -1) {
        System.err.printf("An argument to --export-inputs/outputs does not match actual inputs/outputs.");
        System.exit(1);
      }
    }
  }
  return inputIndicesSelected;
}
origin: CampagneLaboratory/variationanalysis

public static Set<String> alleles(String genotype) {
  genotype = genotype.toUpperCase();
  ObjectSet<String> result = new ObjectArraySet<>();
  Collections.addAll(result, genotype.split("[|/]"));
  result.remove("|");
  result.remove("/");
  result.remove("?");
  result.remove(".");
  result.remove("");
  return result;
}
origin: CampagneLaboratory/variationanalysis

public static Set<String> alleles(String genotype) {
  genotype = genotype.toUpperCase();
  ObjectSet<String> result = new ObjectArraySet<>();
  Collections.addAll(result, genotype.split("[|/]"));
  result.remove("|");
  result.remove("/");
  result.remove("?");
  result.remove(".");
  result.remove("");
  return result;
}
origin: CampagneLaboratory/variationanalysis

Set<Variant.FromTo> extendedTrueAlleles = new ObjectArraySet<>(trueAlleles);
origin: CampagneLaboratory/variationanalysis

@Override
public void execute()  {
  Set<String> testIDs = new ObjectArraySet<>(args().testChromosomes);
  Set<String> valIDs = new ObjectArraySet<>(args().valChromosomes);
  Map<String,Integer> testCounts = new Object2IntArrayMap<>(testIDs.size());
  Map<String,Integer> valCounts = new Object2IntArrayMap<>(valIDs.size());
origin: CampagneLaboratory/variationanalysis

  trueAlleles = new ObjectArraySet<Variant.FromTo>(1);
  trueAlleles.add(new Variant.FromTo(referenceBase,referenceBase));
} else if (isVariant && variant.isIndel() && (!indelsAsRef) && (!considerIndels)){
origin: CampagneLaboratory/variationanalysis

Set<Variant.FromTo> predictedFromTos = new ObjectArraySet<>(2);
Set<Variant.FromTo> trueFromTos = new ObjectArraySet<>(2);
for (BaseInformationRecords.CountInfo c : currentRecord.getSamples(0).getCountsList()) {
  if (predictedAlleles().contains(c.getToSequence())) {
origin: CampagneLaboratory/variationanalysis

final int indelMappedLength = indelSequenceLength;
Set<Integer> sampleIndices = new ObjectArraySet<>();
sampleIndices.add(germlineIndex);
sampleIndices.add(somaticIndex);
origin: CampagneLaboratory/variationanalysis

final int indelMappedLength= indelSequenceLength;
Set<Integer> sampleIndices = new ObjectArraySet<>();
sampleIndices.add(germlineIndex);
sampleIndices.add(somaticIndex);
origin: igvteam/igv

String previousChr = "";
int previousAlignmentStart = -1;
ObjectSet<String> chromosomeSeen = new ObjectArraySet<String>();
it.unimi.dsi.fastutil.objectsObjectArraySet

Javadoc

A simple, brute-force implementation of a set based on a backing array.

The main purpose of this implementation is that of wrapping cleanly the brute-force approach to the storage of a very small number of items: just put them into an array and scan linearly to find an item.

Most used methods

  • <init>
    Creates a new array set using the given backing array and the given number of elements of the array.
  • add
  • addAll
  • findKey

Popular in Java

  • Start an intent from android
  • getContentResolver (Context)
  • getApplicationContext (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now