@Override public NucSeq generateCompositeSequence( ArrayList<Part> composition, Object additionalRequirements) { StringBuffer sb = new StringBuffer(); for (Part p : composition) { sb.append(p.getSeq().getSeq()); } NucSeq outnuc = new NucSeq(sb.toString()); outnuc.setTransient(); int offset = 0; for (Part p : composition) { String parseq = p.getSeq().getSeq(); for (Annotation ann : p.getSeq().getAnnotations()) { Feature afeature = ann.getFeature(); String name = ann.getName(); Color forColor = ann.getForwardColor(); Color revColor = ann.getReverseColor(); int Start = offset + ann.getStart(); int End = offset + ann.getEnd(); Person user = ann.getAuthor(); boolean plusstrandtrue = ann.isForwardStrand(); String symbol = ann.getSymbol(); Annotation newann; if (afeature == null) { newann = new Annotation( name, outnuc, forColor, forColor, Start, End, user, plusstrandtrue, symbol); newann.setTransient(); } else { newann = new Annotation( afeature, outnuc, forColor, forColor, Start, End, user, plusstrandtrue, symbol); newann.setTransient(); } System.out.println("Generated annotation: " + newann.getName()); } offset += parseq.length(); } return outnuc; }
@Override public NucSeq generatePlasmidSequence(Plasmid p) { String out = ""; out += p.getPart().getSeq().getSeq(); out += p.getVector().getSeq().getSeq(); NucSeq outnuc = new NucSeq(out); outnuc.setTransient(); for (Annotation ann : p.getPart().getSeq().getAnnotations()) { Feature afeature = ann.getFeature(); String name = ann.getName(); Color forColor = ann.getForwardColor(); Color revColor = ann.getReverseColor(); int Start = ann.getStart(); int End = ann.getEnd(); Person user = ann.getAuthor(); boolean plusstrandtrue = ann.isForwardStrand(); String symbol = ann.getSymbol(); Annotation newann; if (afeature == null) { newann = new Annotation( name, outnuc, forColor, forColor, Start, End, user, plusstrandtrue, symbol); newann.setTransient(); } else { newann = new Annotation( afeature, outnuc, forColor, revColor, Start, End, user, plusstrandtrue, symbol); newann.setTransient(); } System.out.println("Generated annotation: " + newann.getName()); } String parseq = p.getPart().getSeq().getSeq(); int offset = parseq.length(); for (Annotation ann : p.getVector().getSeq().getAnnotations()) { Feature afeature = ann.getFeature(); String name = ann.getName(); Color forColor = ann.getForwardColor(); Color revColor = ann.getReverseColor(); int Start = offset + ann.getStart(); int End = offset + ann.getEnd(); Person user = ann.getAuthor(); boolean plusstrandtrue = ann.isForwardStrand(); String symbol = ann.getSymbol(); Annotation newann; if (afeature == null) { newann = new Annotation( name, outnuc, forColor, forColor, Start, End, user, plusstrandtrue, symbol); newann.setTransient(); } else { newann = new Annotation( afeature, outnuc, forColor, revColor, Start, End, user, plusstrandtrue, symbol); newann.setTransient(); } System.out.println("Generated annotation: " + newann.getName()); } return outnuc; }