for (FileEntry file : files) { if (StringUtils.isEmpty(file.getCall())) { file.setCall(call);
fileEntry.setCall(ori.get("s") + ":" + ori.get("i"));
fileEntry.setCall(fileInfoAttributes.get("fileCall")); fileInfoAttributes.remove("fileCall"); fileEntry.setAttributes(fileInfoAttributes);
@Test public void resolve_INS_SNP_SEC_ALT() throws Exception { Variant a = getVariant("1:100:-:GGTTG", "PASS", "390", "1/2"); Variant b = getVariant("1:100:G:-", "PASS", "390", "0/0"); Variant c = getVariant("1:102:-:AGGA", "PASS", "390", "0/1"); b.setType(NO_VARIATION); a.getStudies().get(0).getSecondaryAlternates().add( new AlternateCoordinate(c.getChromosome(), c.getStart(), c.getEnd(), c.getReference(), c.getAlternate(), INDEL)); a.getStudies().get(0).getFiles().get(0).setCall("100:TT:GGTTGTT,TTAGGA:0"); b.getStudies().get(0).getFiles().get(0).setCall("100:TT:GGTTGTT,TTAGGA:0"); c.getStudies().get(0).getFiles().get(0).setCall("100:TT:GGTTGTT,TTAGGA:1"); Collection<Variant> resolved = new VariantLocalConflictResolver().resolveConflicts(Arrays.asList(a, b, c)); assertEquals(2, resolved.size()); }
@Test public void resolveSameVariantWithSecAlt() throws Exception { Variant a = getVariant("2:10048155:TCTTTTTTTT:AC", "PASS", "220", "1/2"); Variant b = getVariant("2:10048155:TCTTTTTTTT:-", "PASS", "220", "2/1"); a.getStudies().get(0).getSecondaryAlternates().add(new AlternateCoordinate("2", b.getStart(), b.getEnd(), b.getReference(), b.getAlternate(), INDEL)); a.getStudies().get(0).getFiles().get(0).setCall("10048155:TTCTTTTTTTT:TAC,T:0"); b.getStudies().get(0).getSecondaryAlternates().add(new AlternateCoordinate("2", a.getStart(), a.getEnd(), a.getReference(), a.getAlternate(), INDEL)); b.getStudies().get(0).getFiles().get(0).setCall("10048155:TTCTTTTTTTT:TAC,T:1"); Collection<Variant> resolved = new VariantLocalConflictResolver().resolveConflicts(Arrays.asList(a, b)); assertEquals(1, resolved.size()); }
fileEntry.getAttributes().remove(VCFConstants.END_KEY); if (StringUtils.isEmpty(fileEntry.getCall())) { fileEntry.setCall(archiveVariant.getStart() + ":" + archiveVariant.getReference() + ":" + archiveVariant.getAlternate() + ":0");
entry.getFiles().forEach(fileEntry -> fileEntry.setCall(sameVariant ? null : call)); samplesData = entry.getSamplesData(); } else {
fileEntry.getAttributes().put("QUAL", "0.01"); fileEntry.getAttributes().put("AN", "2"); fileEntry.setCall(null); studyEntry.setFormatAsString("GT:DP");
public Variant convert(VcfSliceProtos.VcfRecord vcfRecord, String chromosome, int slicePosition) { int start = getStart(vcfRecord, slicePosition); int end = getEnd(vcfRecord, slicePosition); Variant variant = new Variant(chromosome, start, end, vcfRecord.getReference(), vcfRecord.getAlternate()); variant.setType(getVariantType(vcfRecord.getType())); variant.setIds(vcfRecord.getIdNonDefaultList()); variant.resetLength(); FileEntry fileEntry = new FileEntry(); fileEntry.setFileId(fileId); Map<String, String> attributes = getFileAttributes(vcfRecord); fileEntry.setAttributes(attributes); fileEntry.setCall(vcfRecord.getCall().isEmpty() ? null : vcfRecord.getCall()); if (vcfRecord.getType().equals(VariantProto.VariantType.NO_VARIATION)) { attributes.put("END", Integer.toString(end)); } StudyEntry studyEntry = new StudyEntry(studyId); studyEntry.setFiles(Collections.singletonList(fileEntry)); studyEntry.setFormat(getFormat(vcfRecord)); studyEntry.setSamplesData(getSamplesData(vcfRecord, studyEntry.getFormatPositions())); studyEntry.setSamplesPosition(retrieveSamplePosition()); studyEntry.getFormatPositions(); // Initialize the map List<VariantProto.AlternateCoordinate> alts = vcfRecord.getSecondaryAlternatesList(); studyEntry.setSecondaryAlternates(getAlternateCoordinates(alts)); variant.addStudyEntry(studyEntry); studyEntry.getFormatPositions(); // Initialize the map return variant; }
for (FileEntry fileEntry : loadedStudy.getFiles()) { if(StringUtils.isEmpty(fileEntry.getCall())) { fileEntry.setCall(null);