public String buildSVAlternate(String alternate, StructuralVariation sv) { if (sv != null) { if (StringUtils.isNotEmpty(sv.getLeftSvInsSeq()) || StringUtils.isNotEmpty(sv.getRightSvInsSeq())) { alternate = alternate + INS_SEQ_SEPARATOR + sv.getLeftSvInsSeq() + INS_SEQ_SEPARATOR + sv.getRightSvInsSeq(); } } return alternate; }
private String getLeftAlternate() { // alternate == <INS> <=> alternate seq is not complete and must be found within the variant.sv.rightSvInsSeq if (variant.getAlternate().startsWith(SYMBOLIC_START)) { if (variant.getSv() != null && variant.getSv().getLeftSvInsSeq() != null) { return variant.getSv().getLeftSvInsSeq(); } else { throw new IllegalArgumentException("Insertion found with <INS> tag in the alternate and no alternate" + " sequence available within variant.sv.leftSvInsSeq; Malformed variant object. Please, check."); } } else { return variant.getAlternate(); } }
private String getLeftAlternate() { // alternate == <INS> <=> alternate seq is not complete and must be found within the variant.sv.rightSvInsSeq if (variant.getAlternate().startsWith(SYMBOLIC_START)) { if (variant.getSv() != null && variant.getSv().getLeftSvInsSeq() != null) { return variant.getSv().getLeftSvInsSeq(); } else { throw new IllegalArgumentException("Insertion found with <INS> tag in the alternate and no alternate" + " sequence available within variant.sv.leftSvInsSeq; Malformed variant object. Please, check."); } } else { return variant.getAlternate(); } }
static String buildSVAlternate(String alternate, Integer end, StructuralVariation sv) { if (sv != null) { if (StructuralVariantType.TANDEM_DUPLICATION.equals(sv.getType())) { alternate = VariantBuilder.DUP_TANDEM_ALT; } alternate = alternate + SV_ALTERNATE_SEPARATOR + end + SV_ALTERNATE_SEPARATOR + (sv.getCiStartLeft() == null ? 0 : sv.getCiStartLeft()) + SV_ALTERNATE_SEPARATOR + (sv.getCiStartRight() == null ? 0 : sv.getCiStartRight()) + SV_ALTERNATE_SEPARATOR + (sv.getCiEndLeft() == null ? 0 : sv.getCiEndLeft()) + SV_ALTERNATE_SEPARATOR + (sv.getCiEndRight() == null ? 0 : sv.getCiEndRight()); if (StringUtils.isNotEmpty(sv.getLeftSvInsSeq()) || StringUtils.isNotEmpty(sv.getRightSvInsSeq())) { alternate = alternate + SV_ALTERNATE_SEPARATOR + sv.getLeftSvInsSeq() + SV_ALTERNATE_SEPARATOR + sv.getRightSvInsSeq(); } } return alternate; }
&& (getSv().getLeftSvInsSeq() != null || getSv().getRightSvInsSeq() != null)) { if (getSv().getLeftSvInsSeq() != null) { sb.append(getSv().getLeftSvInsSeq());
/** * Check if the structural variant information should be serialized. * * Checks if any field is non null, or the type is not COPY_NUMBER_GAIN nor COPY_NUMBER_LOSS * This two types are inferred from the Alternate * * @param sv StructuralVariation object * @return true if it should be serialized */ private boolean validSV(StructuralVariation sv) { if (sv == null) { return false; } else { StructuralVariantType type = sv.getType(); return type != null && !COPY_NUMBER_GAIN.equals(type) && !COPY_NUMBER_LOSS.equals(type) || sv.getCiStartLeft() != null || sv.getCiStartRight() != null || sv.getCiEndLeft() != null || sv.getCiEndRight() != null || sv.getLeftSvInsSeq() != null || sv.getRightSvInsSeq() != null || sv.getBreakend() != null; } }
mongoSv.put(SV_CN_FIELD, sv.getCopyNumber()); if (StringUtils.isNotEmpty(sv.getLeftSvInsSeq()) || StringUtils.isNotEmpty(sv.getRightSvInsSeq())) { mongoSv.put(SV_INS_SEQ, Arrays.asList(sv.getLeftSvInsSeq(), sv.getRightSvInsSeq()));
ifNotNull(sv.getCopyNumber(), svBuilder::setCopyNumber); ifNotNull(sv.getRightSvInsSeq(), svBuilder::setRightSvInsSeq); ifNotNull(sv.getLeftSvInsSeq(), svBuilder::setLeftSvInsSeq); ifNotNull(sv.getType(), type -> svBuilder.setType(VariantProto.StructuralVariantType.valueOf(sv.getType().toString()))); if (sv.getBreakend() != null) {