Package com.molecular_java
Class SimSpace
java.lang.Object
com.molecular_java.SimSpace
A class for containment of important parameters,
constants and I/O files to process the simulation.
It has only one constructor, which is called from
the main method and uses a name of simulation to
get the input file (with the same name as the name
of a simulation) and to create the output files.
In postprocessing of the data got from the simulation
it also has the data file and avg file readers to
count the errors and to make a log file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionavg file writer.Avgs for postprocessing.An array which contains balls in the simulation space.Cosinus of angle of bond.Constant for bending potential.Double[][]Table with potential values (index 1) for given angle values (index 0).Constant used in formula to count dihedral angle potential by "atan2" method.Constant used in formula to count dihedral angle potential by "sin" method.Data file writer.A header for the data file.Name of the data file.intNumber of columns of the data file.Data file reader.intSpecifies how often the DATA will be noted.Double[][]Table with potential values (index 1) for given angle values (index 0).FASTA sequence of the simulated peptide.Reader for the input file.Name of the input file.Input folder path.org.json.JSONObjectInput file reader.Specifies how long are the bonds between the balls.Dog file writer.intSpecifies how often the XYZ positions will be noted.intNumber of balls in the simulation space.intNumber of cycles of the simulation.Meassured "optimal" dihedral angle.Meassured "optimal" dihedral angle.Output folder path.double[][]A matrix of pairwise potentials between AAs.ARandomobject used in the simulations.Parameter of the simulation which specifies how much the chain of balls can be rotated in one step.intHow many active cycles do we haveSimulation name.intSpecifies how many cycles are not count to averages and are not also used for the error estimation.Parameter of the spring bond potential count.Contains variables important for each step.Contains new variables for each step.tclscript for the simulation.Parameter of the simulation which specifies how easily the unprobable stays will be accepted.Parameter of the simulation which specifies how easily the unprobable stays will be accepted.Defines which type of potential we want to use.Defines which type of simulation we are going to make.Contains variables which are changed, but also important during the simulation and in postprocessing.Object used for time meassurement.xyz file writer. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDouble[][]loadPotentialFromCSV(String inPotFileName) Method which takes a filename of potential csv matrix as an argument and gives a table with the values as the output.voidvoidrestorePozitionsFromXYZ(String restoreFileName) This method is called if option "--restore" is given as an argument.
-
Field Details
-
simulationName
Simulation name. -
inputFolder
Input folder path. -
outputFolder
Output folder path. -
inputFileName
Name of the input file. -
dataFileName
Name of the data file. -
JSONInput
public org.json.JSONObject JSONInputInput file reader. -
dataFileReader
Data file reader. In csv format. -
avgFileReader
Avgs for postprocessing. A reader. -
dataFile
Data file writer. -
xyzFile
xyz file writer. Inxyzformat. -
avgFile
avg file writer. -
logFile
Dog file writer. It has information from the input file stored in, Dvg file content and errors -
tclScript
tclscript for the simulation. -
dataFileHeader
A header for the data file. -
dataFileNrOfColumns
public int dataFileNrOfColumnsNumber of columns of the data file. -
random
ARandomobject used in the simulations. -
watches
Object used for time meassurement. See theMyWatchesclass for further information. -
typeOfSimulation
Defines which type of simulation we are going to make. OnlyPivot-ChainMovesis implemented now! -
typeOfPotential
Defines which type of potential we want to use. However, only "Lennard-Jones" potential is realistic and useable now. -
potentialMatrix
public double[][] potentialMatrixA matrix of pairwise potentials between AAs. -
fSequence
FASTA sequence of the simulated peptide. -
balls
An array which contains balls in the simulation space. -
nrOfBalls
public int nrOfBallsNumber of balls in the simulation space. -
numberOfCycles
public int numberOfCyclesNumber of cycles of the simulation. -
skippedCycles
public int skippedCyclesSpecifies how many cycles are not count to averages and are not also used for the error estimation. -
temperatureInit
Parameter of the simulation which specifies how easily the unprobable stays will be accepted. In physics it is used for count of beta factor: 1/(Temperature*Boltzmann's constant). This is used for Boltzmann's factor for the MC decision step. Gives initial state for "simulated annealing technique". -
temperatureFinal
Parameter of the simulation which specifies how easily the unprobable stays will be accepted. In physics it is used for count of beta factor: 1/(Temperature*Boltzmann's constant). This is used for Boltzmann's factor for the MC decision step. Gives final state for "simulated annealing technique". -
springConst
Parameter of the spring bond potential count. -
rangeOfAngleForRotation
Parameter of the simulation which specifies how much the chain of balls can be rotated in one step. -
lengthOfBond
Specifies how long are the bonds between the balls. -
bendingConst
Constant for bending potential. -
bendingAngleOffsetCos
Cosinus of angle of bond. Used in bending potential count. -
bendingPotentialTable
Table with potential values (index 1) for given angle values (index 0). -
optimalDihedralAngle
Meassured "optimal" dihedral angle. Used in dihedral angle count by "atan2" method. -
optimalSinDihedralAngle
Meassured "optimal" dihedral angle. Used in dihedral angle count by "sin" method. -
constantDihedralAngle
Constant used in formula to count dihedral angle potential by "atan2" method. -
constantSinDihedralAngle
Constant used in formula to count dihedral angle potential by "sin" method. -
dihedralPotentialTable
Table with potential values (index 1) for given angle values (index 0). -
noteFreq
public int noteFreqSpecifies how often the XYZ positions will be noted. -
DATAFreq
public int DATAFreqSpecifies how often the DATA will be noted. -
resNumberOfCycles
public int resNumberOfCyclesHow many active cycles do we have- See Also:
-
v
Contains variables which are changed, but also important during the simulation and in postprocessing. -
st
Contains variables important for each step. -
st_new
Contains new variables for each step. -
inputFile
Reader for the input file. See input file specification in user docs!
-
-
Constructor Details
-
SimSpace
public SimSpace(String InputFolderName, String OutputFolderName, String SimulationName) throws IOException, NumberFormatException, OperationNotSupportedException The constructor gets a name of the simulation, opens input files and output files and loads parameters from the input file. It also initializes objects needed for the simulation as theRandomobject orMyWatches, which are very important for the simulation run.- Parameters:
InputFolderName- the name of the input folderOutputFolderName- the name of the output folderSimulationName- the name of simulation- Throws:
IOException- if the input file is missing or is loaded incorrectlyNumberFormatException- if the numbers in the input file are not formatted correctlyOperationNotSupportedException- if the simulation box got wrong parameters
-
SimSpace
public SimSpace()Only for testing. Vars to be initialized later.
-
-
Method Details
-
makeTclScript
- Throws:
IOException- occurs if there is some error with I/O
-
restorePozitionsFromXYZ
This method is called if option "--restore" is given as an argument. It takes [input folder name][simulation name].restore.xyz file with pozitions of the balls given in xyz format (the number of balls in xyz and in the input fasta file must match) and sets their positions. Made for purpose of very long simulation, in which unwanted break is probable.- Parameters:
restoreFileName- name of the file which contains the XYZ values for the structure to be restored.- Throws:
IOException- if it is not worked with the file system properly.
-
loadPotentialFromCSV
Method which takes a filename of potential csv matrix as an argument and gives a table with the values as the output. For specification on the input file see please the user docs / README.md- Parameters:
inPotFileName- is the filepath to a csv file- Returns:
- 2 dimensional array, [0] are the values of angle in rads and [1] the concord values of potential in the simulation units.
- Throws:
IOException- if it is not worked with the file properly.
-