fr.curie.BiNoM.pathways
Class CellDesignerToCytoscapeConverter

java.lang.Object
  extended by fr.curie.BiNoM.pathways.CellDesignerToCytoscapeConverter

public class CellDesignerToCytoscapeConverter
extends java.lang.Object

Direct converter from CellDesigner to Cytoscape.


Nested Class Summary
static class CellDesignerToCytoscapeConverter.Graph
          Simple container for GraphDocument and SbmlDocument objects
 
Field Summary
static boolean alwaysMentionCompartment
          If checked, the compartment name will appear in all species names, otherwide the compartment name will be omited for that compartment containing majority of the species
 CellDesigner celldesigner
          Auxilary BiNoM wrapper of CellDesigner
 org.sbml.x2001.ns.celldesigner.SbmlDocument sbml
          Java xml-beans mapping of CellDesigner file
static java.util.HashMap takenaliases
          Map from a key in the form reaction_id+"_"+species_alias_id to ReactionDocument.Reaction object
 
Constructor Summary
CellDesignerToCytoscapeConverter()
           
 
Method Summary
static java.lang.String checkAndModifyEntitiesIDs(org.sbml.x2001.ns.celldesigner.SbmlDocument sb, org.sbml.x2001.ns.celldesigner.SbmlDocument sbbase)
           
static java.lang.String checkAndModifySpeciesIDs(org.sbml.x2001.ns.celldesigner.SbmlDocument sb, org.sbml.x2001.ns.celldesigner.SbmlDocument sbbase)
          Utility function.
static CellDesignerToCytoscapeConverter.Graph convert(java.lang.String file)
          Principal conversion function used from outside
static java.lang.String convertSpeciesToName(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml, java.lang.String speciesID, boolean addCompartmentName, boolean addModifications)
          Generates a unique name for a species speciesID
static java.lang.String convertSpeciesToName(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml, java.lang.String speciesID, boolean addCompartmentName, boolean addModifications, boolean uniqueName)
          Generates a name for a species speciesID
static java.lang.String convertSpeciesToName(org.sbml.x2001.ns.celldesigner.SbmlDocument sbmlDoc, java.lang.String speciesID, boolean addCompartmentName, boolean addModifications)
          Generates a unique name for a species speciesID
static java.util.Vector findAllAliasesForSpecies(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml, java.lang.String spid)
          Finds all CellDesigner species aliases
static java.lang.String getCelldesignerSpeciesName(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml, java.lang.String speciesID)
           
static java.lang.String getEntityId(org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesIdentityDocument.CelldesignerSpeciesIdentity spid)
           
static java.lang.String getEntityName(java.lang.String spid, org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesIdentityDocument.CelldesignerSpeciesIdentity ident, org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml)
           
static java.lang.String getEntityName(java.lang.String spid, org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesIdentityDocument.CelldesignerSpeciesIdentity ident, org.sbml.x2001.ns.celldesigner.SbmlDocument sbmlDoc)
           
static java.util.Vector getIncludedSpeciesInComplex(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml, java.lang.String complexid)
           
static java.util.Vector getIncludedSpeciesInComplex(org.sbml.x2001.ns.celldesigner.SbmlDocument sbmlDoc, java.lang.String complexid)
           
static java.lang.String getNameOfIncludedSpecies(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml, org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesDocument.CelldesignerSpecies sp)
           
static java.lang.String getNameOfIncludedSpecies(org.sbml.x2001.ns.celldesigner.SbmlDocument sbmlDoc, org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesDocument.CelldesignerSpecies sp)
           
static java.lang.String getNameOfModificationResidue(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml, org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesIdentityDocument.CelldesignerSpeciesIdentity ident, java.lang.String residueID)
           
static java.lang.String getNameOfModificationResidue(org.sbml.x2001.ns.celldesigner.SbmlDocument sbmlDoc, org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesIdentityDocument.CelldesignerSpeciesIdentity ident, java.lang.String residueID)
           
static java.lang.String getReactionString(org.sbml.x2001.ns.celldesigner.ReactionDocument.Reaction r, org.sbml.x2001.ns.celldesigner.SbmlDocument sbmlDoc, boolean realNames)
          Function for printing the CellDesigner reactions
static java.util.HashMap getSpecies(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml)
          Creates the map from species id to SpeciesDocument.Species
static java.lang.String getSpeciesAliasInReaction(org.sbml.x2001.ns.celldesigner.ReactionDocument.Reaction r, java.lang.String id, java.lang.String role)
          Finds CellDesigner alias of species 'id' in the reation r
static java.lang.String getSpeciesName(org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesIdentityDocument.CelldesignerSpeciesIdentity spi, java.lang.String sp_id, java.lang.String sp_name, java.lang.String compartment, boolean addModifications, boolean addCompartmentName, java.lang.String defcomp_id, org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml)
           
static java.lang.String getSpeciesName(org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesIdentityDocument.CelldesignerSpeciesIdentity spi, java.lang.String sp_id, java.lang.String sp_name, java.lang.String compartment, boolean addModifications, boolean addCompartmentName, java.lang.String defcomp_id, org.sbml.x2001.ns.celldesigner.SbmlDocument sbmlDoc)
           
static java.lang.String getSuffixForMultipleAliases(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml, java.lang.String spid, java.lang.String alias)
          Axillary function, adds ' (prime) to Cytoscape node name to distinguish multiple CellDesigner species aliases
static edu.rpi.cs.xgmml.GraphDocument getXGMMLGraph(java.lang.String name, org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml)
          The converter itself
static java.util.HashMap MapEntitiesId(org.sbml.x2001.ns.celldesigner.SbmlDocument sbb)
           
static java.util.HashMap MapSpeciesAliases(org.sbml.x2001.ns.celldesigner.SbmlDocument sbb)
           
static java.util.HashMap MapSpeciesId(org.sbml.x2001.ns.celldesigner.SbmlDocument sbb)
           
static void mergeCellDesignerFiles(org.sbml.x2001.ns.celldesigner.SbmlDocument sbout, org.sbml.x2001.ns.celldesigner.SbmlDocument sbin)
          Merges two CellDesigner SbmlDocuments, the result of merging is in sbout
static void setAveragePositionForXGMML(edu.rpi.cs.xgmml.GraphicNode nod, java.util.Vector nodes, java.util.HashMap speciesNodes)
          Place node 'nod' into the average of 'nodes' positions
static void setEntityId(org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesIdentityDocument.CelldesignerSpeciesIdentity spid, java.lang.String id)
           
static void setSpeciesPositionForXGMML(java.lang.String spalias, edu.rpi.cs.xgmml.GraphicNode nod, org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml)
          Reads the position information for a node from CellDesigner
static void substituteEntityId(org.sbml.x2001.ns.celldesigner.SbmlDocument sb, java.lang.String idold, java.lang.String idnew)
           
static void substituteSpeciesId(org.sbml.x2001.ns.celldesigner.SbmlDocument sb, java.lang.String idold, java.lang.String idnew)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sbml

public org.sbml.x2001.ns.celldesigner.SbmlDocument sbml
Java xml-beans mapping of CellDesigner file


celldesigner

public CellDesigner celldesigner
Auxilary BiNoM wrapper of CellDesigner


takenaliases

public static java.util.HashMap takenaliases
Map from a key in the form reaction_id+"_"+species_alias_id to ReactionDocument.Reaction object


alwaysMentionCompartment

public static boolean alwaysMentionCompartment
If checked, the compartment name will appear in all species names, otherwide the compartment name will be omited for that compartment containing majority of the species

Constructor Detail

CellDesignerToCytoscapeConverter

public CellDesignerToCytoscapeConverter()
Method Detail

convert

public static CellDesignerToCytoscapeConverter.Graph convert(java.lang.String file)
Principal conversion function used from outside


getXGMMLGraph

public static edu.rpi.cs.xgmml.GraphDocument getXGMMLGraph(java.lang.String name,
                                                           org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml)
The converter itself


setSpeciesPositionForXGMML

public static void setSpeciesPositionForXGMML(java.lang.String spalias,
                                              edu.rpi.cs.xgmml.GraphicNode nod,
                                              org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml)
Reads the position information for a node from CellDesigner

Parameters:
spalias -
nod -
sbml -

setAveragePositionForXGMML

public static void setAveragePositionForXGMML(edu.rpi.cs.xgmml.GraphicNode nod,
                                              java.util.Vector nodes,
                                              java.util.HashMap speciesNodes)
Place node 'nod' into the average of 'nodes' positions


getSpeciesAliasInReaction

public static java.lang.String getSpeciesAliasInReaction(org.sbml.x2001.ns.celldesigner.ReactionDocument.Reaction r,
                                                         java.lang.String id,
                                                         java.lang.String role)
Finds CellDesigner alias of species 'id' in the reation r

Parameters:
r -
id -
role - can be 'reactant' or 'product' or 'modifier'
Returns:

findAllAliasesForSpecies

public static java.util.Vector findAllAliasesForSpecies(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml,
                                                        java.lang.String spid)
Finds all CellDesigner species aliases

Parameters:
sbml -
spid -
Returns:

getSuffixForMultipleAliases

public static java.lang.String getSuffixForMultipleAliases(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml,
                                                           java.lang.String spid,
                                                           java.lang.String alias)
Axillary function, adds ' (prime) to Cytoscape node name to distinguish multiple CellDesigner species aliases

Parameters:
sbml -
spid - species id
alias -
Returns:

getSpecies

public static java.util.HashMap getSpecies(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml)
Creates the map from species id to SpeciesDocument.Species

Parameters:
sbml -
Returns:

convertSpeciesToName

public static java.lang.String convertSpeciesToName(org.sbml.x2001.ns.celldesigner.SbmlDocument sbmlDoc,
                                                    java.lang.String speciesID,
                                                    boolean addCompartmentName,
                                                    boolean addModifications)
Generates a unique name for a species speciesID


convertSpeciesToName

public static java.lang.String convertSpeciesToName(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml,
                                                    java.lang.String speciesID,
                                                    boolean addCompartmentName,
                                                    boolean addModifications)
Generates a unique name for a species speciesID

Parameters:
sbml -
speciesID -
addCompartmentName -
addModifications -
Returns:

getCelldesignerSpeciesName

public static java.lang.String getCelldesignerSpeciesName(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml,
                                                          java.lang.String speciesID)
Parameters:
sbml -
speciesID - species SBML id
Returns:
Species name as it is written in SBML

convertSpeciesToName

public static java.lang.String convertSpeciesToName(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml,
                                                    java.lang.String speciesID,
                                                    boolean addCompartmentName,
                                                    boolean addModifications,
                                                    boolean uniqueName)
Generates a name for a species speciesID


getSpeciesName

public static java.lang.String getSpeciesName(org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesIdentityDocument.CelldesignerSpeciesIdentity spi,
                                              java.lang.String sp_id,
                                              java.lang.String sp_name,
                                              java.lang.String compartment,
                                              boolean addModifications,
                                              boolean addCompartmentName,
                                              java.lang.String defcomp_id,
                                              org.sbml.x2001.ns.celldesigner.SbmlDocument sbmlDoc)

getSpeciesName

public static java.lang.String getSpeciesName(org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesIdentityDocument.CelldesignerSpeciesIdentity spi,
                                              java.lang.String sp_id,
                                              java.lang.String sp_name,
                                              java.lang.String compartment,
                                              boolean addModifications,
                                              boolean addCompartmentName,
                                              java.lang.String defcomp_id,
                                              org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml)

getIncludedSpeciesInComplex

public static java.util.Vector getIncludedSpeciesInComplex(org.sbml.x2001.ns.celldesigner.SbmlDocument sbmlDoc,
                                                           java.lang.String complexid)

getIncludedSpeciesInComplex

public static java.util.Vector getIncludedSpeciesInComplex(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml,
                                                           java.lang.String complexid)

getNameOfIncludedSpecies

public static java.lang.String getNameOfIncludedSpecies(org.sbml.x2001.ns.celldesigner.SbmlDocument sbmlDoc,
                                                        org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesDocument.CelldesignerSpecies sp)

getNameOfIncludedSpecies

public static java.lang.String getNameOfIncludedSpecies(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml,
                                                        org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesDocument.CelldesignerSpecies sp)

getNameOfModificationResidue

public static java.lang.String getNameOfModificationResidue(org.sbml.x2001.ns.celldesigner.SbmlDocument sbmlDoc,
                                                            org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesIdentityDocument.CelldesignerSpeciesIdentity ident,
                                                            java.lang.String residueID)

getNameOfModificationResidue

public static java.lang.String getNameOfModificationResidue(org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml,
                                                            org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesIdentityDocument.CelldesignerSpeciesIdentity ident,
                                                            java.lang.String residueID)

getReactionString

public static java.lang.String getReactionString(org.sbml.x2001.ns.celldesigner.ReactionDocument.Reaction r,
                                                 org.sbml.x2001.ns.celldesigner.SbmlDocument sbmlDoc,
                                                 boolean realNames)
Function for printing the CellDesigner reactions

Parameters:
r -
sbmlDoc -
realNames -
Returns:
Reaction encoded as a string

getEntityName

public static java.lang.String getEntityName(java.lang.String spid,
                                             org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesIdentityDocument.CelldesignerSpeciesIdentity ident,
                                             org.sbml.x2001.ns.celldesigner.SbmlDocument sbmlDoc)

getEntityName

public static java.lang.String getEntityName(java.lang.String spid,
                                             org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesIdentityDocument.CelldesignerSpeciesIdentity ident,
                                             org.sbml.x2001.ns.celldesigner.SbmlDocument.Sbml sbml)

mergeCellDesignerFiles

public static void mergeCellDesignerFiles(org.sbml.x2001.ns.celldesigner.SbmlDocument sbout,
                                          org.sbml.x2001.ns.celldesigner.SbmlDocument sbin)
Merges two CellDesigner SbmlDocuments, the result of merging is in sbout

Parameters:
sbout -
sbin -

checkAndModifySpeciesIDs

public static java.lang.String checkAndModifySpeciesIDs(org.sbml.x2001.ns.celldesigner.SbmlDocument sb,
                                                        org.sbml.x2001.ns.celldesigner.SbmlDocument sbbase)
Utility function. Try to correct problems with species ids, caused by some manipulations in CellDesigner

Parameters:
sb -
sbbase -
Returns:

checkAndModifyEntitiesIDs

public static java.lang.String checkAndModifyEntitiesIDs(org.sbml.x2001.ns.celldesigner.SbmlDocument sb,
                                                         org.sbml.x2001.ns.celldesigner.SbmlDocument sbbase)

MapEntitiesId

public static java.util.HashMap MapEntitiesId(org.sbml.x2001.ns.celldesigner.SbmlDocument sbb)

getEntityId

public static java.lang.String getEntityId(org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesIdentityDocument.CelldesignerSpeciesIdentity spid)

setEntityId

public static void setEntityId(org.sbml.x2001.ns.celldesigner.CelldesignerSpeciesIdentityDocument.CelldesignerSpeciesIdentity spid,
                               java.lang.String id)

MapSpeciesId

public static java.util.HashMap MapSpeciesId(org.sbml.x2001.ns.celldesigner.SbmlDocument sbb)

MapSpeciesAliases

public static java.util.HashMap MapSpeciesAliases(org.sbml.x2001.ns.celldesigner.SbmlDocument sbb)

substituteEntityId

public static void substituteEntityId(org.sbml.x2001.ns.celldesigner.SbmlDocument sb,
                                      java.lang.String idold,
                                      java.lang.String idnew)

substituteSpeciesId

public static void substituteSpeciesId(org.sbml.x2001.ns.celldesigner.SbmlDocument sb,
                                       java.lang.String idold,
                                       java.lang.String idnew)