/* * Constructs a new DNAStrand which contains a given Nucleotide. * This nucleotide should be able to be ANY of the many nucleotides in a strand * (i.e. you will need to calculate the threeEnd and fiveEnd from any Nucleotide.) */ public DNAStrand(Nucleotide any) { if (any == null) { throw new IllegalArgumentException(); } else { threeEnd = any.getThree(); fiveEnd = any.getFive(); } }
public String toStringPlainReversed() { StringBuilder sb = new StringBuilder(); Nucleotide now = fiveEnd; while (now != null) { sb.append(now.toString()); now = now.getPrev(); } return sb.toString(); }
public String toStringPlain() { StringBuilder sb = new StringBuilder(); Nucleotide now = threeEnd; while (now != null) { sb.append(now.toString()); now = now.getNext(); } return sb.toString(); }
private void selectFocus() { Point3D p = new Point3D(0, 0, 0); Nucleotide n = selectionModel .getItems()[ selectionModel .getSelectedIndices() .get(selectionModel.getSelectedIndices().size() - 1)]; p = p.add(utils.fx3d.computeCenter(n.getNucleotideCoordinates())); p = p.add(utils.fx3d.computeCenter(n.getBaseCoordinates())); p = p.multiply(1 / ((double) 2)); // fx3d.transiteFromTOo(tertiaryRoom.getCamera(), p); tertiaryRoom.setCameraCenter(p); }
public String toStringReversed() { StringBuilder sb = new StringBuilder(); sb.append("(5) "); Nucleotide now = fiveEnd; while (true) { sb.append(now.toString()); now = now.getPrev(); if (now != null) { sb.append("="); } else { break; } } sb.append(" (3)"); return sb.toString(); }
/* * Constructs a new DNAStrand from a given sequence (in the three to five ordering) */ public DNAStrand(String sequence) { if (sequence.length() > 0) { fiveEnd = threeEnd = new Nucleotide(sequence.charAt(0)); for (int i = 1; i < sequence.length(); i++) { Nucleotide now = new Nucleotide(sequence.charAt(i)); fiveEnd.append(now); fiveEnd = now; } } else { throw new IllegalArgumentException(); } }