public AggregatedSoftmaxGenotypePrediction(BaseInformationRecords.BaseInformation record, List<Prediction> individualOutputPredictions) { predictedAlleles = new ObjectArraySet<>(); trueAlleles = new ObjectArraySet<>(); set(record, (SoftmaxGenotypePrediction) individualOutputPredictions.get(0), (MetadataPrediction) individualOutputPredictions.get(1)); }
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; } }
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; }
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(); }
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; }
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; }
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; }
Set<Variant.FromTo> extendedTrueAlleles = new ObjectArraySet<>(trueAlleles);
@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());
trueAlleles = new ObjectArraySet<Variant.FromTo>(1); trueAlleles.add(new Variant.FromTo(referenceBase,referenceBase)); } else if (isVariant && variant.isIndel() && (!indelsAsRef) && (!considerIndels)){
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())) {
final int indelMappedLength = indelSequenceLength; Set<Integer> sampleIndices = new ObjectArraySet<>(); sampleIndices.add(germlineIndex); sampleIndices.add(somaticIndex);
final int indelMappedLength= indelSequenceLength; Set<Integer> sampleIndices = new ObjectArraySet<>(); sampleIndices.add(germlineIndex); sampleIndices.add(somaticIndex);
String previousChr = ""; int previousAlignmentStart = -1; ObjectSet<String> chromosomeSeen = new ObjectArraySet<String>();