Skip to content
Snippets Groups Projects
Commit bb5a1d7e authored by tjc's avatar tjc
Browse files

add phase in

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@4164 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent edca4267
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@
<result property="type_id" column="type_id"/>
<result property="prop_type_id" column="prop_type_id" nullValue="0"/>
<result property="value" column="value"/>
<result property="phase" column="phase" nullValue="10"/>
</resultMap>
<resultMap id="select-feature-result" class="uk.ac.sanger.ibatis.Feature">
......@@ -62,20 +63,20 @@
resultMap="select-feature-properties-result">
SELECT
timelastmodified,
feature.feature_id AS id,
f.feature_id AS id,
object_id,
strand,
fl.strand,
fmin,
fmax,
uniquename,
$schema$.feature.type_id AS type_id,
$schema$.featureprop.type_id AS prop_type_id,
$schema$.featureprop.value AS value
FROM $schema$.featureloc, $schema$.feature
LEFT JOIN $schema$.feature_relationship
ON $schema$.feature_relationship.subject_id=$schema$.feature.feature_id
LEFT JOIN $schema$.featureprop
ON $schema$.featureprop.feature_id=$schema$.feature.feature_id
f.type_id,
fp.type_id AS prop_type_id,
fp.value,
fl.phase
FROM $schema$.feature f
LEFT JOIN $schema$.feature_relationship fr ON fr.subject_id = f.feature_id
LEFT JOIN $schema$.featureprop fp ON fp.feature_id = f.feature_id
LEFT JOIN $schema$.featureloc fl ON f.feature_id = fl.feature_id
WHERE
<dynamic>
<isGreaterThan property="id" compareValue="0">
......@@ -85,10 +86,8 @@
uniquename=#uniquename# AND
</isNotNull>
</dynamic>
$schema$.featureloc.feature_id=$schema$.feature.feature_id
AND ($schema$.featureloc.rank=$schema$.feature_relationship.rank OR
$schema$.feature_relationship.rank IS NULL)
ORDER BY $schema$.feature.type_id, uniquename
(fl.rank=fr.rank OR fr.rank IS NULL)
ORDER BY f.type_id, uniquename
</select>
<select id="getSequence" parameterClass="uk.ac.sanger.ibatis.Feature"
......
......@@ -386,6 +386,7 @@ public class DatabaseDocument extends Document
long type_id = feat.getType_id();
long prop_type_id = feat.getProp_type_id();
int strand = feat.getStrand();
int phase = feat.getPhase();
String name = feat.getUniquename();
String typeName = getCvtermName(type_id);
String propTypeName = getCvtermName(prop_type_id);
......@@ -419,7 +420,11 @@ public class DatabaseDocument extends Document
else
this_buff.append(".\t");
if(phase > 3)
this_buff.append(".\t"); // phase
else
this_buff.append(phase+"\t");
this_buff.append("ID=" + name + ";");
if(parent_id != null)
......
......@@ -66,6 +66,8 @@ public class Feature
private String abbreviation;
/** hashtable of qualifiers */
private Hashtable qualifiers;
/** phase */
private int phase;
public int getId()
{
......@@ -227,6 +229,16 @@ public class Feature
this.srcfeature_id = srcfeature_id;
}
public int getPhase()
{
return phase;
}
public void setPhase(int phase)
{
this.phase = phase;
}
public void addQualifier(long prop_type_id, String value)
{
if(qualifiers == null)
......
......@@ -110,23 +110,18 @@ public class JdbcDAO
ResultSet.CONCUR_UPDATABLE);
String sql = "SELECT timelastmodified, f.feature_id, object_id, "
+ "strand, fmin, fmax, uniquename, f.type_id, "
+ schema + ".featureprop.type_id AS prop_type_id, featureprop.value"
+ "fl.strand, fmin, fmax, uniquename, f.type_id, "
+ "fp.type_id AS prop_type_id, fp.value, fl.phase"
+ " FROM "
+ schema + ".featureloc fl, "
+ schema + ".feature f"
+ " LEFT JOIN "
+ schema + ".feature_relationship fr ON "
+ "fr.subject_id="
+ "f.feature_id"
+ " LEFT JOIN "
+ schema + ".featureprop ON "
+ schema + ".featureprop.feature_id="
+ "f.feature_id"
+ " LEFT JOIN " + schema + ".feature_relationship fr ON "
+ "fr.subject_id=" + "f.feature_id"
+ " LEFT JOIN " + schema + ".featureprop fp ON "
+ "fp.feature_id=" + "f.feature_id"
+ " LEFT JOIN " + schema + ".featureloc fl ON "
+ "f.feature_id=" + "fl.feature_id"
+ " WHERE srcfeature_id = "
+ parentFeatureID + " AND "
+ "fl.feature_id="
+ "f.feature_id"
+ parentFeatureID
+ " AND ("
+ "fl.rank="
+ "fr.rank OR "
......@@ -146,6 +141,13 @@ public class JdbcDAO
feature.setType_id( rs.getLong("type_id") );
feature.setProp_type_id( rs.getLong("prop_type_id") );
feature.setStrand( rs.getInt("strand") );
int phase = rs.getInt("phase");
if(rs.wasNull())
feature.setPhase(10);
else
feature.setPhase( rs.getInt("phase") );
feature.setUniquename( rs.getString("uniquename") );
feature.setTimelastmodified( rs.getDate("timelastmodified") );
feature.setId( rs.getInt("feature_id") );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment