Example #1
0
 @Override
 public void visit(SequenceAnnotation annotation) {
   super.visit(annotation);
   add(annotation);
   if (duplicates.contains(annotation.getSubComponent())) {
     annotation.setSubComponent(map(annotation.getSubComponent()));
   }
 }
Example #2
0
 @Override
 public void visit(DnaComponent component) {
   Map<URI, SequenceAnnotation> previous = current;
   current = new HashMap<URI, SequenceAnnotation>();
   for (SequenceAnnotation annotation : component.getAnnotations()) {
     current.put(annotation.getURI(), annotation);
   }
   super.visit(component);
   current = previous;
 }
Example #3
0
 /**
  * Add subpart to a SequenceAnnotation
  *
  * @param sub Subpart to create SequenceAnnotation
  * @param place
  * @return
  */
 private SequenceAnnotation createAnnotation(Subpart sub, int place) {
   SequenceAnnotation annotation2 = SBOLFactory.createSequenceAnnotation();
   annotation2.setURI(
       URI.create("http://sbols.org/anot/an_" + this.partId + "_" + sub.id + "_" + place));
   DnaComponent dnaComponent2 = SBOLFactory.createDnaComponent();
   dnaComponent2.setURI(URI.create("http://partsregistry.org/Part/" + sub.getPart_name()));
   dnaComponent2.setDescription(sub.description);
   dnaComponent2.setDisplayId(sub.getPart_name());
   dnaComponent2.setName(sub.nickName);
   dnaComponent2.addType(SequenceOntology.type(sub.getType().toString()));
   annotation2.setSubComponent(dnaComponent2);
   return annotation2;
 }
Example #4
0
 private SequenceAnnotation createAnnotation(feature sub, int place) {
   SequenceAnnotation annotation2 = SBOLFactory.createSequenceAnnotation();
   annotation2.setBioStart(sub.startpos);
   annotation2.setBioEnd(sub.endpos);
   if (sub.direction.equals("forward")) annotation2.setStrand(StrandType.POSITIVE);
   else annotation2.setStrand(StrandType.NEGATIVE);
   annotation2.setURI(URI.create("http://sbols.org/anot/f_" + sub.id));
   DnaComponent dnaComponent2 = SBOLFactory.createDnaComponent();
   dnaComponent2.setURI(URI.create("http://partsregistry.org/feat/f_" + sub.id));
   dnaComponent2.setDisplayId("f_" + sub.id);
   dnaComponent2.setName(sub.type);
   dnaComponent2.addType(SequenceOntology.type(sub.type));
   annotation2.setSubComponent(dnaComponent2);
   return annotation2;
 }