Newcastle University Drylab/28 May 2008

From 2008.igem.org

(Difference between revisions)
(New page: {{:Team:Newcastle_University/DrylabCalendarHeader}} == 28 May 2008 == ===Mark=== Continued on with coding up the EA. Have completely finished the structure coded section, and am now work...)
 
Line 11: Line 11:
===Megan===
===Megan===
-
Still looking at the JDBC tutorial, taking quite a while but is helping to give me an indiciation of how the problem can be tackled. Here is some of my understanding so far [[general_ideas_on_how_to_go_about_programming.doc]]
+
Still looking at the JDBC tutorial, taking quite a while but is helping to give me an indiciation of how the problem can be tackled. Here is some of my understanding so far.
-
'''Very vague Pseudo code'''
 
-
import driver for JDBC and the database management system for this
+
Outline of the structure of the database and information required
 +
Example of the two types of table that the database would consist of.
-
ResultSet interface will be used to retrieve the information required.
+
'''PART TYPE'''
 +
{|border="1"
 +
|-
 +
|Unique ID
 +
|Name
 +
|Function
 +
|Model
 +
|-
 +
|1
 +
|Promoter
 +
|Initiates transcription of genes
 +
|CellML file
 +
|-
 +
|2
 +
|Repressor
 +
|}
-
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);  this will allow the cursor to scroll along to the ‘next’ row and is read only so that the output cannot be modified
+
'''TYPE e.g. Repressor'''
 +
{|border="1"
 +
|-
 +
|UniqueID
 +
|Uniprot Accession
 +
|Protein name
 +
|Gene Name
 +
|Source organism
 +
|Function
 +
|Amino acid sequence
 +
|Nucleotide sequence
 +
|Model
 +
|-
 +
|1
 +
|U2345343
 +
|
 +
|LacI
 +
|E. coli
 +
|Represses the lac operon
 +
|…
 +
|…
 +
|CellML file
 +
|}
 +
This table would have other columns including nucleotide sequence.
-
ResultSet will be initiated
+
'''It may seem strange only having two types of table however there is no need to break tables down into smaller tables as this would only lead to over complication of the database'''
-
ResultSet srs = stmt.executeQuery (“SELECT model FROM promoter”) or something along these lines that will direct the query to a particular table and select a certain column
+
 
 +
====End user requirements:====
 +
* Nucleotide sequence
 +
* Part ID
 +
* Part name
 +
* Part model
 +
* Function
 +
* Type
 +
 
 +
(Basically all information that is stored within the database needs to be used-otherwise there is no point it being in the database)
 +
 
 +
All of the information stored in the database should be made available to an end user. However not all of this will be provided by this component of the project. For example the sequence is not required (this is part of project 4).  The most important information is the model of the part that can be output to the genetic algorithm.
 +
 
 +
====SQL query and Java outline idea====
 +
 
 +
I am unsure whether the program would have some form of input, such as the type of part that is required, or whether all of the information should just be output in some way.
 +
 
 +
The outline of the SQL would be
 +
 
 +
<pre>
 +
SELECT model
 +
FROM repressor
 +
WHERE ((repressor.uniqueID)=……)        Already this gets confusing as prior knowledge is required, there need to be something predefined otherwise this cannot work.
 +
</pre>
 +
 
 +
Shall try working backwards from what the end user wants, then the java pseudocode for this hopefully the SQL will become clearer.
 +
 
 +
End user may require any of the information that is stored in the database, Basically any of the information that is stored on each individual part.
 +
 
 +
In the case of the iGEM project the end user will be the genetic algorithm (project 3). This algorithm will require the part unique identifier and the model. It will also need the model type, but maybe not to know this but to allow it to select a combination of the different parts.
 +
Also, the constraints database requires a list of all of the parts so that it can provide the relative constraints between them.
 +
 
 +
====Java pseudo code….====
 +
 
 +
A range of get methods will be required.
 +
 
 +
I think that each of these should work in a similar way just using a different SQL query. I think that I would be able to use an SQL query that will iterate around every entry in the table.  For example if there is a table of 5 promoters then each number could have an entry number (e.g. 1-5) then some kind of while loop could be used, if it’s possible to do this in SQL-but haven’t managed to find out whether this is possible yet.
 +
The SQL can be involved in set methods that can then be retrieved by get methods.
 +
 
 +
I think that the code that I will be writing is using JDBC, this allows for java code and SQL to be implemented together.
 +
 
 +
Firstly I will need to install the latest version of java along with Netbeans, JDBC also requires a database management system (DBMS). The DBMS comes with a driver (this can be one of four different types).* think that the driver has something to do with a URL so maybe accessing information online.
 +
 
 +
SQL queries will be written to obtain whatever information is required by the end user.  I am currently (still) unsure as to how the different parts are going to be selected however for the java code this is not important, the point is that there will be a set of queries that will output data from the database.
 +
 
 +
====JAVA====
 +
 
 +
The driver needs to be loaded (the class name of this will be provided by the driver documentation). Then this connects to the DBMS – not sure how this all works yet.
 +
 
 +
ResultSet is an interface that can be used for retrieving the output of SQL queries.
 +
* this seems perhaps slightly too straightforward, there is clearly going to be more to my program than just the generation of the product of the SQL query.
 +
 
 +
There are different types of ResultSet. I think that the type that I would use is:
 +
 
 +
TYPE_SCROLL_SENSITIVE, I think that this enables the ‘cursor’ to move backwards and forwards between the different rows.
 +
 
 +
<pre>
 +
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
 +
                                    ResultSet.CONCUR_READ_ONLY);//the results of the query cannot be altered by the user this can be set as updatable however for my program I do not want the results to be updatable.
 +
ResultSet srs = stmt.executeQuery("SELECT model FROM promoter");???
 +
</pre>
 +
 
 +
The query can direct the ‘cursor’ of the ResultSet method to the correct table.
 +
Using a scrolling object within ResultSet, different rows can be accessed
 +
 
 +
''so iterating through different parts within the same table in the database will be carried out by the java code, not using the SQL query. So the SQL will only direct to the table and column for desired information.''
 +
 
 +
So SQL could be …
 +
 
 +
<pre>
 +
SELECT model
 +
FROM promoter
 +
</pre>
 +
 
 +
The SQL is quite simple, this would select the model form the promoter table. Then the different rows can be chosen by the java code. There are options to make it select the ‘next’ row however I think that I will need to find a way for it to select rows at random.
 +
 
 +
The information required for each part can be retrieved using get methods. For example if the part unique ID was required could use something like this…..
 +
 
 +
<pre>
 +
while (srs.next())
 +
      {
 +
      String ID = srs.getString(“UniqueID”);
 +
      }
 +
</pre>
 +
 
 +
It is possible to select the row in the table using ‘absolute’ or ‘relative’ and declare either positive and negative integers to move around rows. Hopefully there is some way that these can be implemented to allow for random row selection, possibly by using a loop, however this may not really be very random, but then if the GA is creating random combinations my program might need to just select each bit of information on each part individually.
 +
 +
Then declare an instance of ResultsSet to store the results that are given by the SQL query. These can then be accessed or given to the end user.
 +
 
 +
* The parts do not need to be randomly selected, this is the job of the genetic algorithm. So which ever requested part will need to be retrieved. This makes things simpler as each
 +
 
 +
 
 +
====Very vague Pseudo code====
 +
 
 +
* import driver for JDBC and the database management system for this
 +
* ResultSet interface will be used to retrieve the information required.
 +
* <pre>Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);</pre>  this will allow the cursor to scroll along to the ‘next’ row and is read only so that the output cannot be modified
 +
* ResultSet will be initiated
 +
* <pre>ResultSet srs = stmt.executeQuery (“SELECT model FROM promoter”)</pre> or something along these lines that will direct the query to a particular table and select a certain column
This statement can be repeated for each of the parts tables, i.e. activator, repressor, polymerase, output etc… And within these tables set to determine which ever attributes are required, e.g. unique ID, model, function…
This statement can be repeated for each of the parts tables, i.e. activator, repressor, polymerase, output etc… And within these tables set to determine which ever attributes are required, e.g. unique ID, model, function…
Line 31: Line 167:
So, the program will follow the SQL query to the correct table and column, then a method need to be used to tell it which rows and format of information needs to be gained, this can use a while statement to go through each row.
So, the program will follow the SQL query to the correct table and column, then a method need to be used to tell it which rows and format of information needs to be gained, this can use a while statement to go through each row.
-
<code>
+
<pre>
while (srs.next())
while (srs.next())
       {
       {
  String ID = srs.getString(“UniqueID”);
  String ID = srs.getString(“UniqueID”);
       }
       }
-
</code>
+
</pre>
-
Then an object of the ResultSet will need to be created in which to store the results
+
-
 
+
-
 
+
-
 
+
 +
Then an object of the ResultSet will need to be created in which to store the results
===Morgan===
===Morgan===

Latest revision as of 12:00, 13 October 2008

Bugbuster-logo-red.png
Ncl uni logo.jpg


Newcastle University

GOLD MEDAL WINNER 2008

Home Team Original Aims Software Modelling Proof of Concept Brick Wet Lab Conclusions


Home >> Dry Lab >> Dry Lab Journal

May
MTWTFSS
      [http://2008.igem.org/Newcastle_University_Drylab/1_May_2008 1] [http://2008.igem.org/Newcastle_University_Drylab/2_May_2008 2] [http://2008.igem.org/Newcastle_University_Drylab/3_May_2008 3] [http://2008.igem.org/Newcastle_University_Drylab/4_May_2008 4]
[http://2008.igem.org/Newcastle_University_Drylab/5_May_2008 5] [http://2008.igem.org/Newcastle_University_Drylab/6_May_2008 6] [http://2008.igem.org/Newcastle_University_Drylab/7_May_2008 7] [http://2008.igem.org/Newcastle_University_Drylab/8_May_2008 8] [http://2008.igem.org/Newcastle_University_Drylab/9_May_2008 9] [http://2008.igem.org/Newcastle_University_Drylab/10_May_2008 10] [http://2008.igem.org/Newcastle_University_Drylab/11_May_2008 11]
[http://2008.igem.org/Newcastle_University_Drylab/12_May_2008 12] [http://2008.igem.org/Newcastle_University_Drylab/13_May_2008 13] [http://2008.igem.org/Newcastle_University_Drylab/14_May_2008 14] [http://2008.igem.org/Newcastle_University_Drylab/15_May_2008 15] [http://2008.igem.org/Newcastle_University_Drylab/16_May_2008 16] [http://2008.igem.org/Newcastle_University_Drylab/17_May_2008 17] [http://2008.igem.org/Newcastle_University_Drylab/18_May_2008 18]
[http://2008.igem.org/Newcastle_University_Drylab/19_May_2008 19] [http://2008.igem.org/Newcastle_University_Drylab/20_May_2008 20] [http://2008.igem.org/Newcastle_University_Drylab/21_May_2008 21] [http://2008.igem.org/Newcastle_University_Drylab/22_May_2008 22] [http://2008.igem.org/Newcastle_University_Drylab/23_May_2008 23] [http://2008.igem.org/Newcastle_University_Drylab/24_May_2008 24] [http://2008.igem.org/Newcastle_University_Drylab/25_May_2008 25]
[http://2008.igem.org/Newcastle_University_Drylab/26_May_2008 26] [http://2008.igem.org/Newcastle_University_Drylab/27_May_2008 27] [http://2008.igem.org/Newcastle_University_Drylab/28_May_2008 28] [http://2008.igem.org/Newcastle_University_Drylab/29_May_2008 29] [http://2008.igem.org/Newcastle_University_Drylab/30_May_2008 30] [http://2008.igem.org/Newcastle_University_Drylab/31_May_2008 31]
June
MTWTFSS
            [http://2008.igem.org/Newcastle_University_Drylab/1_June_2008 1]
[http://2008.igem.org/Newcastle_University_Drylab/2_June_2008 2] [http://2008.igem.org/Newcastle_University_Drylab/3_June_2008 3] [http://2008.igem.org/Newcastle_University_Drylab/4_June_2008 4] [http://2008.igem.org/Newcastle_University_Drylab/5_June_2008 5] [http://2008.igem.org/Newcastle_University_Drylab/6_June_2008 6] [http://2008.igem.org/Newcastle_University_Drylab/7_June_2008 7] [http://2008.igem.org/Newcastle_University_Drylab/8_June_2008 8]
[http://2008.igem.org/Newcastle_University_Drylab/9_June_2008 9] [http://2008.igem.org/Newcastle_University_Drylab/10_June_2008 10] [http://2008.igem.org/Newcastle_University_Drylab/11_June_2008 11] [http://2008.igem.org/Newcastle_University_Drylab/12_June_2008 12] [http://2008.igem.org/Newcastle_University_Drylab/13_June_2008 13] [http://2008.igem.org/Newcastle_University_Drylab/14_June_2008 14] [http://2008.igem.org/Newcastle_University_Drylab/15_June_2008 15]
[http://2008.igem.org/Newcastle_University_Drylab/16_June_2008 16] [http://2008.igem.org/Newcastle_University_Drylab/17_June_2008 17] [http://2008.igem.org/Newcastle_University_Drylab/18_June_2008 18] [http://2008.igem.org/Newcastle_University_Drylab/19_June_2008 19] [http://2008.igem.org/Newcastle_University_Drylab/20_June_2008 20] [http://2008.igem.org/Newcastle_University_Drylab/21_June_2008 21] [http://2008.igem.org/Newcastle_University_Drylab/22_June_2008 22]
[http://2008.igem.org/Newcastle_University_Drylab/23_June_2008 23] [http://2008.igem.org/Newcastle_University_Drylab/24_June_2008 24] [http://2008.igem.org/Newcastle_University_Drylab/25_June_2008 25] [http://2008.igem.org/Newcastle_University_Drylab/26_June_2008 26] [http://2008.igem.org/Newcastle_University_Drylab/27_June_2008 27] [http://2008.igem.org/Newcastle_University_Drylab/28_June_2008 28] [http://2008.igem.org/Newcastle_University_Drylab/29_June_2008 29]
[http://2008.igem.org/Newcastle_University_Drylab/30_June_2008 30]
July
MTWTFSS
  [http://2008.igem.org/Newcastle_University_Drylab/1_July_2008 1] [http://2008.igem.org/Newcastle_University_Drylab/2_July_2008 2] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/3_July_2008&action=edit 3] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/4_July_2008&action=edit 4] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/5_July_2008&action=edit 5] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/6_July_2008&action=edit 6]
[http://2008.igem.org/Newcastle_University_Drylab/7_July_2008 7] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/8_July_2008&action=edit 8] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/9_July_2008&action=edit 9] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/10_July_2008&action=edit 10] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/11_July_2008&action=edit 11] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/12_July_2008&action=edit 12] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/13_July_2008&action=edit 13]
[http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/14_July_2008&action=edit 14] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/15_July_2008&action=edit 15] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/16_July_2008&action=edit 16] [http://2008.igem.org/Newcastle_University_Drylab/17_July_2008 17] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/18_July_2008&action=edit 18] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/19_July_2008&action=edit 19] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/20_July_2008&action=edit 20]
[http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/21_July_2008&action=edit 21] [http://2008.igem.org/Newcastle_University_Drylab/22_July_2008 22] [http://2008.igem.org/Newcastle_University_Drylab/23_July_2008 23] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/24_July_2008&action=edit 24] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/25_July_2008&action=edit 25] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/26_July_2008&action=edit 26] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/27_July_2008&action=edit 27]
[http://2008.igem.org/Newcastle_University_Drylab/28_July_2008 28] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/29_July_2008&action=edit 29] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/30_July_2008&action=edit 30] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/31_July_2008&action=edit 31]
August
MTWTFSS
        [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/1_August_2008&action=edit 1] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/2_August_2008&action=edit 2] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/3_August_2008&action=edit 3]
[http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/4_August_2008&action=edit 4] [http://2008.igem.org/Newcastle_University_Drylab/5_August_2008 5] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/6_August_2008&action=edit 6] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/7_August_2008&action=edit 7] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/8_August_2008&action=edit 8] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/9_August_2008&action=edit 9] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/10_August_2008&action=edit 10]
[http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/11_August_2008&action=edit 11] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/12_August_2008&action=edit 12] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/13_August_2008&action=edit 13] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/14_August_2008&action=edit 14] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/15_August_2008&action=edit 15] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/16_August_2008&action=edit 16] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/17_August_2008&action=edit 17]
[http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/18_August_2008&action=edit 18] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/19_August_2008&action=edit 19] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/20_August_2008&action=edit 20] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/21_August_2008&action=edit 21] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/22_August_2008&action=edit 22] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/23_August_2008&action=edit 23] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/24_August_2008&action=edit 24]
[http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/25_August_2008&action=edit 25] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/26_August_2008&action=edit 26] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/27_August_2008&action=edit 27] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/28_August_2008&action=edit 28] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/29_August_2008&action=edit 29] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/30_August_2008&action=edit 30] [http://2008.igem.org/wiki/index.php?title=Newcastle_University_Drylab/31_August_2008&action=edit 31]

28 May 2008

Mark

Continued on with coding up the EA. Have completely finished the structure coded section, and am now working on a fitness funtion and mutation method that can be implemented to change the weights on these nodes. Also need to specify the boundaries for the double numbers to be incorporated into the double arrays. Thinking of between 0.1 and 10.

Have also done some biological research today concerning the Listeria monocytogenes organism and come up with a couple of signal transduction systems that have been defined that are not homologous to the agr signalling system. This might well make it easier and cleaner than having two agr signalling systems. The systems are the LisRK and the CesRK two-component systems.

Going to start coding up the next part of the EA tomorrow, the mutating method and adding more functionality.

Megan

Still looking at the JDBC tutorial, taking quite a while but is helping to give me an indiciation of how the problem can be tackled. Here is some of my understanding so far.


Outline of the structure of the database and information required Example of the two types of table that the database would consist of.

PART TYPE

Unique ID Name Function Model
1 Promoter Initiates transcription of genes CellML file
2 Repressor

TYPE e.g. Repressor

UniqueID Uniprot Accession Protein name Gene Name Source organism Function Amino acid sequence Nucleotide sequence Model
1 U2345343 LacI E. coli Represses the lac operon CellML file

This table would have other columns including nucleotide sequence.

It may seem strange only having two types of table however there is no need to break tables down into smaller tables as this would only lead to over complication of the database


End user requirements:

  • Nucleotide sequence
  • Part ID
  • Part name
  • Part model
  • Function
  • Type

(Basically all information that is stored within the database needs to be used-otherwise there is no point it being in the database)

All of the information stored in the database should be made available to an end user. However not all of this will be provided by this component of the project. For example the sequence is not required (this is part of project 4). The most important information is the model of the part that can be output to the genetic algorithm.

SQL query and Java outline idea

I am unsure whether the program would have some form of input, such as the type of part that is required, or whether all of the information should just be output in some way.

The outline of the SQL would be

SELECT model
FROM repressor
WHERE ((repressor.uniqueID)=……)        Already this gets confusing as prior knowledge is required, there need to be something predefined otherwise this cannot work.

Shall try working backwards from what the end user wants, then the java pseudocode for this hopefully the SQL will become clearer.

End user may require any of the information that is stored in the database, Basically any of the information that is stored on each individual part.

In the case of the iGEM project the end user will be the genetic algorithm (project 3). This algorithm will require the part unique identifier and the model. It will also need the model type, but maybe not to know this but to allow it to select a combination of the different parts. Also, the constraints database requires a list of all of the parts so that it can provide the relative constraints between them.

Java pseudo code….

A range of get methods will be required.

I think that each of these should work in a similar way just using a different SQL query. I think that I would be able to use an SQL query that will iterate around every entry in the table. For example if there is a table of 5 promoters then each number could have an entry number (e.g. 1-5) then some kind of while loop could be used, if it’s possible to do this in SQL-but haven’t managed to find out whether this is possible yet. The SQL can be involved in set methods that can then be retrieved by get methods.

I think that the code that I will be writing is using JDBC, this allows for java code and SQL to be implemented together.

Firstly I will need to install the latest version of java along with Netbeans, JDBC also requires a database management system (DBMS). The DBMS comes with a driver (this can be one of four different types).* think that the driver has something to do with a URL so maybe accessing information online.

SQL queries will be written to obtain whatever information is required by the end user. I am currently (still) unsure as to how the different parts are going to be selected however for the java code this is not important, the point is that there will be a set of queries that will output data from the database.

JAVA

The driver needs to be loaded (the class name of this will be provided by the driver documentation). Then this connects to the DBMS – not sure how this all works yet.

ResultSet is an interface that can be used for retrieving the output of SQL queries.

  • this seems perhaps slightly too straightforward, there is clearly going to be more to my program than just the generation of the product of the SQL query.

There are different types of ResultSet. I think that the type that I would use is:

TYPE_SCROLL_SENSITIVE, I think that this enables the ‘cursor’ to move backwards and forwards between the different rows.

Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
                                     ResultSet.CONCUR_READ_ONLY);//the results of the query cannot be altered by the user this can be set as updatable however for my program I do not want the results to be updatable.
ResultSet srs = stmt.executeQuery("SELECT model FROM promoter");???

The query can direct the ‘cursor’ of the ResultSet method to the correct table. Using a scrolling object within ResultSet, different rows can be accessed

so iterating through different parts within the same table in the database will be carried out by the java code, not using the SQL query. So the SQL will only direct to the table and column for desired information.

So SQL could be …

SELECT model
FROM promoter

The SQL is quite simple, this would select the model form the promoter table. Then the different rows can be chosen by the java code. There are options to make it select the ‘next’ row however I think that I will need to find a way for it to select rows at random.

The information required for each part can be retrieved using get methods. For example if the part unique ID was required could use something like this…..

while (srs.next())
      {
       String ID = srs.getString(“UniqueID”);
      }	

It is possible to select the row in the table using ‘absolute’ or ‘relative’ and declare either positive and negative integers to move around rows. Hopefully there is some way that these can be implemented to allow for random row selection, possibly by using a loop, however this may not really be very random, but then if the GA is creating random combinations my program might need to just select each bit of information on each part individually.

Then declare an instance of ResultsSet to store the results that are given by the SQL query. These can then be accessed or given to the end user.

  • The parts do not need to be randomly selected, this is the job of the genetic algorithm. So which ever requested part will need to be retrieved. This makes things simpler as each


Very vague Pseudo code

  • import driver for JDBC and the database management system for this
  • ResultSet interface will be used to retrieve the information required.
  • Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
    this will allow the cursor to scroll along to the ‘next’ row and is read only so that the output cannot be modified
  • ResultSet will be initiated
  • ResultSet srs = stmt.executeQuery (“SELECT model FROM promoter”)
    or something along these lines that will direct the query to a particular table and select a certain column

This statement can be repeated for each of the parts tables, i.e. activator, repressor, polymerase, output etc… And within these tables set to determine which ever attributes are required, e.g. unique ID, model, function…

Within this class the getMethods can be implemented.

So, the program will follow the SQL query to the correct table and column, then a method need to be used to tell it which rows and format of information needs to be gained, this can use a while statement to go through each row.

while (srs.next())
      {
	  String ID = srs.getString(“UniqueID”);
      }

Then an object of the ResultSet will need to be created in which to store the results

Morgan

Caught myself yesterday trying to streamline hardcoding. I don't think I was quite awake.

Found stupid new bug with legend. Argh.

I HAS VERY SUBTLE DIRECTED EDGES JA.

File:Directed.jpg

Uh yes. Pickled brains.

Meanwhile, I can now draw dotted edges, edges with arrows (one way or two ways) or ordinary lines. But those are boring. I took code from prefuse to rotate the arrow heads appropriately to the line direction.

I can also rename the elements in the drawing panel.

And now I have informative status bar messages, in the build panel at least.

Aha, now I can populate the drawing panel with stuff from a Circuit. I think that's enough for the day.


Nina