Class ChangeObjects

java.lang.Object
org.helm.notation2.tools.ChangeObjects

public final class ChangeObjects
extends Object
ChangeObjects, class to provide simple methods to change the HELM2Notation objects
Author:
hecht
  • Constructor Summary

    Constructors 
    Constructor Description
    ChangeObjects()  
  • Method Summary

    Modifier and Type Method Description
    static void addAnnotation​(org.helm.notation2.parser.notation.annotation.AnnotationNotation notation, int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    method to add an annotation at a specific position of the HELM2Notation
    static void addAnnotationToConnection​(int position, String annotation, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    method to add an annotation to a connection of the HELM2Notation
    static void addAnnotationToMonomerNotation​(org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, int position, String annotation)
    method to add an annotation to a MonomerNotation
    static org.helm.notation2.parser.notation.polymer.PolymerNotation addAnnotationToPolymer​(org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, String annotation)
    method to add an annotation to a PolymerNotation
    static void addConnection​(org.helm.notation2.parser.notation.connection.ConnectionNotation notation, int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    method to add a new connection at the position of the HELM2Notation
    static void addCountToMonomerNotation​(org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, int position, String count)
    method to set the count of a MonomerNotation
    static void addGroup​(org.helm.notation2.parser.notation.grouping.GroupingNotation notation, int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    method to add a group to the grouping section of the HELM2Notation
    static org.helm.notation2.parser.notation.polymer.PolymerNotation addMonomerNotation​(int position, org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, org.helm.notation2.parser.notation.polymer.MonomerNotation monomerNotation)
    method to add a new MonomerNotation to a PolymerNotation
    static void addPolymerNotation​(int position, org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    method to add a PolymerNotation at a specific position of the HELM2Notation
    static void changeAnnotation​(org.helm.notation2.parser.notation.annotation.AnnotationNotation notation, int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    method to change an annotation at the position of the HELM2Notation
    static void changeConnection​(int position, org.helm.notation2.parser.notation.connection.ConnectionNotation notation, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    method to change a connection at the position of the HELM2Notation
    static void changeGroup​(org.helm.notation2.parser.notation.grouping.GroupingNotation notation, int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    method to change a group of the HELM2Notation
    static void changeMonomerNotation​(int position, org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, org.helm.notation2.parser.notation.polymer.MonomerNotation not)
    method to change the MonomerNotation on the specific position
    static void changePolymerNotation​(int position, org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    method to change the PolymerNotation at a specific position of the HELM2Notation
    static void deleteAllAnnotations​(org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    method to delete all annotations of the HELM2Notation
    static void deleteAllConnections​(org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    method to delete all connections of the HELM2Notation
    static void deleteAllGroups​(org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    method to delete all groups of the HELM2Notation
    static void deleteAnnotation​(int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    method to delete the annotation at the specific position of the HELM2Notation
    static void deleteAnnotationFromMonomerNotation​(org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, int position)
    method to delete the annotation of a MonomerNotation
    static void deleteConnection​(int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    method to delete the connection at the specific position of the HELM2Notation
    static void deleteGroup​(int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    method to delete a group at a specific position of the HELM2Notation
    static void deleteMonomerNotation​(int position, org.helm.notation2.parser.notation.polymer.PolymerNotation polymer)
    method to delete a MonomerNotation at a specific position of the PolymerNotation
    static void deletePolymerNotation​(int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    method to delete the PolymerNotation at a specific position of the HELM2Notation
    static void hybridize​(org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    this method will automatically add base pair info into notation only if it contains two RNA polymer notations and there is no base pairing info
    static org.helm.notation2.parser.notation.polymer.MonomerNotationUnit produceMonomerNotationUnitWithOtherID​(org.helm.notation2.parser.notation.polymer.MonomerNotation monomerNotation, String newID)
    method to replace the MonomerNotationUnit having the MonomerID with the new MonomerID
    static org.helm.notation2.parser.notation.polymer.PolymerNotation removeAnnotationOfPolmyer​(org.helm.notation2.parser.notation.polymer.PolymerNotation polymer)
    method to remove a current annotation of a PolymerNotation
    static void replaceMonomer​(org.helm.notation2.parser.notation.HELM2Notation helm2notation, String polymerType, String existingMonomerID, String newMonomerID)
    method to replace the MonomerID with the new MonomerID for a given polymer type
    static org.helm.notation2.parser.notation.polymer.MonomerNotation replaceMonomerNotation​(org.helm.notation2.parser.notation.polymer.MonomerNotation monomerNotation, String existingMonomerID, String newMonomerID)
    method to replace the MonomerNotation having the MonomerID with the new MonomerID
    static org.helm.notation2.parser.notation.polymer.MonomerNotationGroup replaceMonomerNotationGroup​(org.helm.notation2.parser.notation.polymer.MonomerNotationGroup monomerNotation, String existingMonomerID, String newMonomerID)
    method to replace the MonomerNotationGroup having the MonomerID with the new MonomerID
    static org.helm.notation2.parser.notation.polymer.MonomerNotationList replaceMonomerNotationList​(org.helm.notation2.parser.notation.polymer.MonomerNotationList object, String existingMonomerID, String newMonomerID)
    method to replace the MonomerNotationList having the MonomerID with the new MonomerID
    static void replaceSMILESWithTemporaryIds​(org.helm.notation2.parser.notation.HELM2Notation helm2notation)
    This function replaces smiles in complex notation with temporary ids
    static void setCountToDefault​(org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, int position)
    method to set the count of a MonomerNotation to default (=1)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • addAnnotation

      public static final void addAnnotation​(org.helm.notation2.parser.notation.annotation.AnnotationNotation notation, int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
      method to add an annotation at a specific position of the HELM2Notation
      Parameters:
      notation - new annotation
      position - position of the new annotation
      helm2notation - input HELM2Notation
    • changeAnnotation

      public static final void changeAnnotation​(org.helm.notation2.parser.notation.annotation.AnnotationNotation notation, int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
      method to change an annotation at the position of the HELM2Notation
      Parameters:
      notation - new changed annotation
      position - position of the changed annotation
      helm2notation - input HELM2Notation
    • deleteAnnotation

      public static final void deleteAnnotation​(int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
      method to delete the annotation at the specific position of the HELM2Notation
      Parameters:
      position - position of the to be deleted annotation
      helm2notation - input HELM2Notation
    • deleteAllAnnotations

      public static final void deleteAllAnnotations​(org.helm.notation2.parser.notation.HELM2Notation helm2notation)
      method to delete all annotations of the HELM2Notation
      Parameters:
      helm2notation - input HELM2Notation
    • addConnection

      public static final void addConnection​(org.helm.notation2.parser.notation.connection.ConnectionNotation notation, int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
      method to add a new connection at the position of the HELM2Notation
      Parameters:
      notation - new ConnectionNotation
      position - position of the new ConnectionNotation
      helm2notation - input HELM2Notation
    • changeConnection

      public static final void changeConnection​(int position, org.helm.notation2.parser.notation.connection.ConnectionNotation notation, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
      method to change a connection at the position of the HELM2Notation
      Parameters:
      position - position of the changed Connection
      notation - to be changed ConnectionNotation
      helm2notation - input HELM2Notation
    • deleteConnection

      public static final void deleteConnection​(int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
      method to delete the connection at the specific position of the HELM2Notation
      Parameters:
      position - of the to deleted connection
      helm2notation - input HELM2Notation
    • addAnnotationToConnection

      public static final void addAnnotationToConnection​(int position, String annotation, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
      method to add an annotation to a connection of the HELM2Notation
      Parameters:
      position - position of the connection
      annotation - new annotation
      helm2notation - input HELM2Notation
    • deleteAllConnections

      public static final void deleteAllConnections​(org.helm.notation2.parser.notation.HELM2Notation helm2notation)
      method to delete all connections of the HELM2Notation
      Parameters:
      helm2notation - input HELM2Notation
    • addGroup

      public static final void addGroup​(org.helm.notation2.parser.notation.grouping.GroupingNotation notation, int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
      method to add a group to the grouping section of the HELM2Notation
      Parameters:
      notation - new group
      position - position of the new group
      helm2notation - input HELM2Notation
    • changeGroup

      public static final void changeGroup​(org.helm.notation2.parser.notation.grouping.GroupingNotation notation, int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
      method to change a group of the HELM2Notation
      Parameters:
      notation - new group
      position - position of the to be changed group
      helm2notation - input HELM2Notation
    • deleteGroup

      public static final void deleteGroup​(int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
      method to delete a group at a specific position of the HELM2Notation
      Parameters:
      position - position of the to be deleted group
      helm2notation - input HELM2Notation
    • deleteAllGroups

      public static final void deleteAllGroups​(org.helm.notation2.parser.notation.HELM2Notation helm2notation)
      method to delete all groups of the HELM2Notation
      Parameters:
      helm2notation - input HELM2Notation
    • addAnnotationToPolymer

      public static final org.helm.notation2.parser.notation.polymer.PolymerNotation addAnnotationToPolymer​(org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, String annotation)
      method to add an annotation to a PolymerNotation
      Parameters:
      polymer - PolymerNotation
      annotation - new annotation
      Returns:
      PolymerNotation with the annotation
    • removeAnnotationOfPolmyer

      public static final org.helm.notation2.parser.notation.polymer.PolymerNotation removeAnnotationOfPolmyer​(org.helm.notation2.parser.notation.polymer.PolymerNotation polymer)
      method to remove a current annotation of a PolymerNotation
      Parameters:
      polymer - PolymerNotation
      Returns:
      PolymerNotation with no annotation
    • addMonomerNotation

      public static final org.helm.notation2.parser.notation.polymer.PolymerNotation addMonomerNotation​(int position, org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, org.helm.notation2.parser.notation.polymer.MonomerNotation monomerNotation)
      method to add a new MonomerNotation to a PolymerNotation
      Parameters:
      position - position of the new MonomerNotation
      polymer - PolymerNotation
      monomerNotation - new MonomerNotation
      Returns:
      PolymerNotation with the new MonomerNotation
    • changeMonomerNotation

      public static final void changeMonomerNotation​(int position, org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, org.helm.notation2.parser.notation.polymer.MonomerNotation not)
      method to change the MonomerNotation on the specific position
      Parameters:
      position - position of the changed MonomerNotation
      polymer - PolymerNotation
      not - changed MonomerNotation
    • deleteMonomerNotation

      public static final void deleteMonomerNotation​(int position, org.helm.notation2.parser.notation.polymer.PolymerNotation polymer) throws org.helm.notation2.parser.exceptionparser.NotationException
      method to delete a MonomerNotation at a specific position of the PolymerNotation
      Parameters:
      position - position of the to be deleted MonomerNotation
      polymer - PolymerNotation
      Throws:
      org.helm.notation2.parser.exceptionparser.NotationException - if the generated PolymerNotation has no elements after deleting the MonomerNotation
    • addAnnotationToMonomerNotation

      public static final void addAnnotationToMonomerNotation​(org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, int position, String annotation)
      method to add an annotation to a MonomerNotation
      Parameters:
      polymer - PolymerNotation
      position - position of the monomerNotation
      annotation - new annotation
    • addCountToMonomerNotation

      public static final void addCountToMonomerNotation​(org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, int position, String count)
      method to set the count of a MonomerNotation
      Parameters:
      polymer - PolymerNotation
      position - position of the MonomerNotation
      count - new count of the MonomerNotation
    • deleteAnnotationFromMonomerNotation

      public static final void deleteAnnotationFromMonomerNotation​(org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, int position)
      method to delete the annotation of a MonomerNotation
      Parameters:
      polymer - PolymerNotation
      position - position of the MonomerNotation
    • setCountToDefault

      public static final void setCountToDefault​(org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, int position)
      method to set the count of a MonomerNotation to default (=1)
      Parameters:
      polymer - PolymerNotation
      position - position of the MonomerNotation
    • changePolymerNotation

      public static final void changePolymerNotation​(int position, org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
      method to change the PolymerNotation at a specific position of the HELM2Notation
      Parameters:
      position - position of the PolymerNotation
      polymer - new PolymerNotation
      helm2notation - input HELM2Notation
    • deletePolymerNotation

      public static final void deletePolymerNotation​(int position, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
      method to delete the PolymerNotation at a specific position of the HELM2Notation
      Parameters:
      position - position of the PolymerNotation
      helm2notation - input HELM2Notation
    • addPolymerNotation

      public static final void addPolymerNotation​(int position, org.helm.notation2.parser.notation.polymer.PolymerNotation polymer, org.helm.notation2.parser.notation.HELM2Notation helm2notation)
      method to add a PolymerNotation at a specific position of the HELM2Notation
      Parameters:
      position - position of the PolymerNotation
      polymer - new PolymerNotation
      helm2notation - input HELM2Notation
    • replaceMonomer

      public static final void replaceMonomer​(org.helm.notation2.parser.notation.HELM2Notation helm2notation, String polymerType, String existingMonomerID, String newMonomerID) throws org.helm.notation2.parser.exceptionparser.NotationException, MonomerException, ChemistryException, org.helm.chemtoolkit.CTKException, IOException, org.jdom2.JDOMException
      method to replace the MonomerID with the new MonomerID for a given polymer type
      Parameters:
      helm2notation - HELM2Notation
      polymerType - String of the polymer type
      existingMonomerID - old MonomerID
      newMonomerID - new MonomerID
      Throws:
      org.helm.notation2.parser.exceptionparser.NotationException - if notation was not valid
      MonomerException - if monomer is not valid
      ChemistryException - if chemistry engine could not be initialized
      org.helm.chemtoolkit.CTKException - general ChemToolKit exception passed to HELMToolKit
      IOException - IO error
      org.jdom2.JDOMException - jdome error
    • replaceMonomerNotation

      public static final org.helm.notation2.parser.notation.polymer.MonomerNotation replaceMonomerNotation​(org.helm.notation2.parser.notation.polymer.MonomerNotation monomerNotation, String existingMonomerID, String newMonomerID) throws org.helm.notation2.parser.exceptionparser.NotationException, ChemistryException, org.helm.chemtoolkit.CTKException, MonomerLoadingException
      method to replace the MonomerNotation having the MonomerID with the new MonomerID
      Parameters:
      monomerNotation - given monomer notation
      existingMonomerID - existing monomer id
      newMonomerID - new monomer id
      Returns:
      MonomerNotation, if it had the old MonomerID, null otherwise
      Throws:
      org.helm.notation2.parser.exceptionparser.NotationException - if new monomer id is not valid
      ChemistryException - if chemistry engine can not be initialized
      org.helm.chemtoolkit.CTKException - if it contains an invalid smiles
      MonomerLoadingException - if monomers can not be loaded
    • replaceMonomerNotationGroup

      public static final org.helm.notation2.parser.notation.polymer.MonomerNotationGroup replaceMonomerNotationGroup​(org.helm.notation2.parser.notation.polymer.MonomerNotationGroup monomerNotation, String existingMonomerID, String newMonomerID) throws org.helm.notation2.parser.exceptionparser.NotationException
      method to replace the MonomerNotationGroup having the MonomerID with the new MonomerID
      Parameters:
      monomerNotation - the to replace monomernotationgroup
      existingMonomerID - the to replace existing monomer id of the monomernotationgroup
      newMonomerID - the new monomerid
      Returns:
      MonomerNotationGroup, if it had the old MonomerID, null otherwise
      Throws:
      org.helm.notation2.parser.exceptionparser.NotationException - if the new monomer id is not valid
    • produceMonomerNotationUnitWithOtherID

      public static final org.helm.notation2.parser.notation.polymer.MonomerNotationUnit produceMonomerNotationUnitWithOtherID​(org.helm.notation2.parser.notation.polymer.MonomerNotation monomerNotation, String newID) throws org.helm.notation2.parser.exceptionparser.NotationException
      method to replace the MonomerNotationUnit having the MonomerID with the new MonomerID
      Parameters:
      monomerNotation - given monomer notation
      newID - new monomer id
      Returns:
      MonomerNotationUnit
      Throws:
      org.helm.notation2.parser.exceptionparser.NotationException - if new id is not valid
    • replaceMonomerNotationList

      public static final org.helm.notation2.parser.notation.polymer.MonomerNotationList replaceMonomerNotationList​(org.helm.notation2.parser.notation.polymer.MonomerNotationList object, String existingMonomerID, String newMonomerID) throws org.helm.notation2.parser.exceptionparser.NotationException, ChemistryException, org.helm.chemtoolkit.CTKException, MonomerLoadingException
      method to replace the MonomerNotationList having the MonomerID with the new MonomerID
      Parameters:
      object - MonomerNotationList to change
      existingMonomerID - monomer to change
      newMonomerID - new monomer
      Returns:
      MonomerNotationList, if it had the old MonomerID, null otherwise
      Throws:
      org.helm.notation2.parser.exceptionparser.NotationException - if notation is not valid
      ChemistryException - if chemistry could not be initialized
      org.helm.chemtoolkit.CTKException - general ChemToolKit exception passed to HELMToolKit
      MonomerLoadingException - could not load monomers from source
    • replaceSMILESWithTemporaryIds

      public static final void replaceSMILESWithTemporaryIds​(org.helm.notation2.parser.notation.HELM2Notation helm2notation) throws org.helm.notation2.parser.exceptionparser.NotationException, HELM2HandledException, ChemistryException, org.helm.chemtoolkit.CTKException, MonomerLoadingException, org.jdom2.JDOMException
      This function replaces smiles in complex notation with temporary ids
      Parameters:
      helm2notation - given helm2 notation
      Throws:
      org.helm.notation2.parser.exceptionparser.NotationException - if notation is not valid
      ChemistryException - if chemistry engine can not be initialized
      HELM2HandledException - if it contains HELM2 specific features, so that it can not be casted to HELM1 Format
      org.helm.chemtoolkit.CTKException - general ChemToolKit exception passed to HELMToolKit
      MonomerLoadingException - if monomers can not be loaded
      org.jdom2.JDOMException - if smiles can not be replace with the temporary ids
    • hybridize

      public static void hybridize​(org.helm.notation2.parser.notation.HELM2Notation helm2notation) throws org.helm.notation2.parser.exceptionparser.NotationException, RNAUtilsException, HELM2HandledException, NotationException, ChemistryException
      this method will automatically add base pair info into notation only if it contains two RNA polymer notations and there is no base pairing info
      Parameters:
      helm2notation - HELM2Notation object
      Throws:
      org.helm.notation2.parser.exceptionparser.NotationException - if notation is not valid
      RNAUtilsException - if the polymer is not a RNA/DNA
      HELM2HandledException - if it contains HELM2 specific features, so that it can not be casted to HELM1 Format
      NotationException - if notation is not valid
      ChemistryException - if chemistry engine can not be initialized