private Variant parseBreakendPair(VariantContext variantContext, VariantContext variantContext1) { // Get Variant object for the first BND Variant variant = converter.convert(variantContext); // Set mate position variant.getSv().getBreakend().getMate().setChromosome(variantContext1.getContig()); variant.getSv().getBreakend().getMate().setPosition(variantContext1.getStart()); // Check the second BND does have CIPOS List ciposValue = variantContext1.getAttributeAsList(CIPOS); if (!ciposValue.isEmpty()) { // Get CIPOS from second BND String ciposString = StringUtils.join(ciposValue, VCFConstants.INFO_FIELD_ARRAY_SEPARATOR); // Set CIPOS string of the sencond BND as part of the file INFO field in the first BND Map<String, String> attributesMap = variant.getStudies().get(0).getFiles().get(0).getAttributes(); attributesMap.put(MATE_CIPOS, ciposString); // CIPOS of the second breakend List ciposParts = variantContext1.getAttributeAsList(CIPOS); variant.getSv() .getBreakend() .getMate() .setCiPositionLeft(variantContext1.getStart() + Integer.valueOf((String) ciposParts.get(0))); variant.getSv() .getBreakend() .getMate() .setCiPositionRight(variantContext1.getStart() + Integer.valueOf((String) ciposParts.get(1))); // If not, it's a precise call, just position is stored (above) } return variant; }
BreakendMate mate = new BreakendMate(); mate.setChromosome(mongoBndMate.getString(SV_BND_MATE_CHR)); mate.setPosition(mongoBndMate.getInteger(SV_BND_MATE_POS)); mate.setCiPositionLeft(mongoBndMate.getInteger(SV_BND_MATE_CI_POS_L)); mate.setCiPositionRight(mongoBndMate.getInteger(SV_BND_MATE_CI_POS_R));