Integer cn = VariantBuilder.getCopyNumberFromAlternate(alternate);
Integer copyNumber = getCopyNumberFromAlternate(alternates.get(0)); if (copyNumber == null) { copyNumber = getCopyNumberFromFormat();
private StructuralVariation buildSv(String[] split, String reference, String alternate) { if (split.length == SV_SPLIT_LENGTH) { try { Breakend breakend = VariantBuilder.parseBreakend(reference, alternate); return new StructuralVariation( getInt(split, CI_POS_L), getInt(split, CI_POS_R), getInt(split, CI_END_L), getInt(split, CI_END_R), VariantBuilder.getCopyNumberFromAlternate(alternate), null, null, null, breakend); } catch (RuntimeException e) { for (String s : split) { // If any of the splits is non printable, the variantId had 4 colons in the SHA1 if (!StringUtils.isAsciiPrintable(s)) { return null; } } throw new IllegalArgumentException("Unable to build SV from " + String.join(SEPARATOR, split), e); } } else { return null; } }
@Deprecated public static StructuralVariation getStructuralVariation(Variant variant, StructuralVariantType tandemDuplication) { int[] impreciseStart = getImpreciseStart(variant); int[] impreciseEnd = getImpreciseEnd(variant); String[] svInsSeq = getSvInsSeq(variant); StructuralVariation sv = new StructuralVariation(); sv.setCiStartLeft(impreciseStart[0]); sv.setCiStartRight(impreciseStart[1]); sv.setCiEndLeft(impreciseEnd[0]); sv.setCiEndRight(impreciseEnd[1]); sv.setLeftSvInsSeq(svInsSeq[0]); sv.setRightSvInsSeq(svInsSeq[1]); // If it's not a tandem duplication, this will set the type to null sv.setType(tandemDuplication); // Will properly set the type if it's a CNV if (variant.getType().equals(VariantType.CNV)) { Integer copyNumber = getCopyNumberFromAlternate(variant.getAlternate()); if (copyNumber != null) { sv.setCopyNumber(copyNumber); sv.setType(getCNVSubtype(copyNumber)); } } return sv; }