/** * Get names of read elements expected in each read * * @return Ordered list of read element names */ public final ArrayList<String> getElementNames() { ArrayList<String> rtrn = new ArrayList<String>(); for (ReadSequenceElement elt : elements) { rtrn.add(elt.elementName()); } return rtrn; }
/** * @param elementSequence Sequence of elements expected in each read * @param readLength Read length */ public ReadLayout(ArrayList<ReadSequenceElement> elementSequence, int readLength) { int totalLen = 0; for (ReadSequenceElement elt : elementSequence) { totalLen += elt.getLength(); } if (totalLen > readLength) { throw new IllegalArgumentException( "Total length of read sequence elements (" + totalLen + ") must be at most declared read length (" + readLength + ")."); } elements = elementSequence; readLen = readLength; initializeElementsByRepresentative(); }
private void initializeElementsByRepresentative() { elementsByRepresentative = new HashMap<ReadSequenceElement, Map<String, ReadSequenceElement>>(); for (ReadSequenceElement element : elements) { elementsByRepresentative.put(element, element.sequenceToElement()); } }