data.petrinets
Class PetriNetCreator

java.lang.Object
  extended by data.petrinets.PetriNetCreator

public class PetriNetCreator
extends Object

Generates a Petri net which integrates data from an arbitrary number of networks, complex sets and purification data sets. To get a detailed description about the topology of these Petri nets please consult the manual of this library.

Note: This implementation does not explicitly build the full Petri net in-memory but just outputs it to a given output stream or file. The Petri nets classes Place, Transition and Arc are currently only used as helping data objects for reading a Petri net from a file. See also: parsePlace(String) and parseTransition(String)

Author:
Jan Krumsiek

Constructor Summary
PetriNetCreator(File file)
          Creates a new Petri net creator which writes its output to a given file.
PetriNetCreator(OutputStream out)
          Creates a new Petri net creator which writes its output to a given output stream.
PetriNetCreator(String file)
          Creates a new Petri net creator which writes its output to a given file.
 
Method Summary
 void addComplexSet(ComplexSet set, String name)
          Adds a ComplexSet which will be integrated into the Petri net.
 void addInteractionNetwork(ProteinNetwork net, String name, boolean insertScores)
          Adds a ProteinNetwork which will be integrated into the Petri net.
 void addPurificationData(PurificationData data, String name)
          Adds a purification data set which will be integrated into the Petri net.
 void close()
          Closes the output stream this creator is writing to.
 void createPetriNet()
          Creates the Petri net and writes it to the output specified in the constructor.
static void main(String[] args)
           
static Place parsePlace(String line)
          Parses a place from a given Petri net input line
static Transition parseTransition(String line)
          Parses a transition from a given Petri net input line
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PetriNetCreator

public PetriNetCreator(String file)
                throws FileNotFoundException
Creates a new Petri net creator which writes its output to a given file.

Parameters:
file - output file for the Petri net
Throws:
FileNotFoundException - if the output file could not be opened

PetriNetCreator

public PetriNetCreator(File file)
                throws FileNotFoundException
Creates a new Petri net creator which writes its output to a given file.

Parameters:
file - output file for the Petri net
Throws:
FileNotFoundException - if the output file could not be opened

PetriNetCreator

public PetriNetCreator(OutputStream out)
Creates a new Petri net creator which writes its output to a given output stream.

Parameters:
out - output stream the Petri net will be written to
Method Detail

addInteractionNetwork

public void addInteractionNetwork(ProteinNetwork net,
                                  String name,
                                  boolean insertScores)
Adds a ProteinNetwork which will be integrated into the Petri net.

Parameters:
net - network to be integrated
name - the name this network will be referenced by in the Petri net
insertScores - insert weights of edges into the Petri net?

addComplexSet

public void addComplexSet(ComplexSet set,
                          String name)
Adds a ComplexSet which will be integrated into the Petri net.

Parameters:
set - complex set to be integrated
name - the name this complex set will be referenced by in the Petri net

addPurificationData

public void addPurificationData(PurificationData data,
                                String name)
Adds a purification data set which will be integrated into the Petri net.

Parameters:
data - purification data set to be integrated
name - the name this dataset set will be referenced by in the Petri net

createPetriNet

public void createPetriNet()
                    throws IOException
Creates the Petri net and writes it to the output specified in the constructor.

Throws:
IOException - if an input/output error occured

parsePlace

public static Place parsePlace(String line)
                        throws ProCopeException
Parses a place from a given Petri net input line

Parameters:
line - line from the input data
Returns:
Place object
Throws:
ProCopeException - if the line could not be parsed

parseTransition

public static Transition parseTransition(String line)
Parses a transition from a given Petri net input line

Parameters:
line - line from the input data
Returns:
Transition object
Throws:
ProCopeException - if the line could not be parsed

main

public static void main(String[] args)
                 throws FileNotFoundException,
                        IOException
Throws:
FileNotFoundException
IOException

close

public void close()
Closes the output stream this creator is writing to. Does not generate any errors if the stream is already closed.