public List<String> getSampleNames(String studyId) { StudyEntry studyEntry = getStudy(studyId); if (studyEntry == null) { return null; } return studyEntry.getOrderedSamplesName(); }
public Integer getLengthReference() { return VariantBuilder.getLengthReference(getReference(), getType(), getLength()); }
public Integer getLengthAlternate() { return VariantBuilder.getLengthAlternate(getAlternate(), getType(), getLength()); }
public static Variant asVariant(Variant v) { Variant variant = new Variant(v.getChromosome(), v.getStart(), v.getEnd(), v.getReference(), v.getAlternate(), v.getStrand()); variant.setType(v.getType()); return variant; }
public void resetLength() { setLength(VariantBuilder.inferLength(getReference(), getAlternate(), getStart(), getEnd(), getType())); }
public void resetType() { setType(VariantBuilder.inferType(getReference(), getAlternate())); }
private synchronized void updateSamplesPosition() { if (samplesPosition == null) { List<String> samples = getSampleIds(); if (samples == null) { samplesPosition = null; } else { LinkedHashMap<String, Integer> newSamplesPosition = getSamplesPositionMap(samples); samplesPosition = newSamplesPosition; } } }
private void checkStudy(String method) { if (!hasStudyId()) { setStudyId(""); // throw new IllegalArgumentException("Can not " + method + " without study."); } }
@Override protected Set<String> featureValueOf(StudyEntry actual) { return actual.getSamplesName(); } };
public VariantBuilder(String chromosome, Integer start, Integer end, String reference, String alternate) { this.chromosome = chromosome; this.start = start; this.end = end; setReference(reference); setAlternate(alternate); call = null; }
@Override public String toString() { return "VariantStudy{" + "fileName='" + getFileName() + '\'' + ", fleId='" + getFileId() + '\'' + ", samples=" + getSamples() + ", metadata=" + getMetadata() + // ", stats=" + stats + '}'; }
public VcfSliceToVariantListConverter(Map<String, Integer> samplesPosition, String fileId, String studyId) { this.samplesPosition = StudyEntry.sortSamplesPositionMap(samplesPosition); this.fileId = fileId; this.studyId = studyId; }
public VariantBuilder setFormat(List<String> format) { checkStudy("set format"); this.format = format; return this; }
public VariantBuilder setAttributes(Map<String, String> attributes) { checkFile("set attributes"); this.attributes = attributes; return this; }
public VariantBuilder setFileId(String fileId) { checkStudy("set file id"); this.fileId = fileId; return this; }
public VariantBuilder setCall(String call) { checkFile("set call"); this.call = call; return this; }
public VariantBuilder setSamplesData(List<List<String>> samplesData) { checkStudy("set samples data"); this.samplesData = samplesData; return this; }
public VariantBuilder setSamplesPosition(LinkedHashMap<String, Integer> samplesPosition) { checkStudy("set samples position"); this.samplesPosition = samplesPosition; return this; }