From: <gk...@us...> - 2011-04-06 19:16:37
|
Revision: 24784 http://gmod.svn.sourceforge.net/gmod/?rev=24784&view=rev Author: gk_fan Date: 2011-04-06 19:16:27 +0000 (Wed, 06 Apr 2011) Log Message: ----------- Added phase to CDS features in GFF3 (as required). Modified Paths: -------------- apollo/trunk/src/java/apollo/dataadapter/gff3/GFF3Adapter.java apollo/trunk/src/java/apollo/dataadapter/gff3/GFF3Entry.java Modified: apollo/trunk/src/java/apollo/dataadapter/gff3/GFF3Adapter.java =================================================================== --- apollo/trunk/src/java/apollo/dataadapter/gff3/GFF3Adapter.java 2011-04-06 16:00:48 UTC (rev 24783) +++ apollo/trunk/src/java/apollo/dataadapter/gff3/GFF3Adapter.java 2011-04-06 19:16:27 UTC (rev 24784) @@ -299,6 +299,7 @@ tStart = tEnd; tEnd = tmp; } + int currentLength = 0; for (Object o : feat.getFeatures()) { SeqFeatureI child = (SeqFeatureI)o; SeqFeatureI cds = null; @@ -322,6 +323,8 @@ cds.setFeatureType("CDS"); cds.setId(cds.getId() + "-cds"); cds.setName(cds.getName() + "-cds"); + cds.setPhase(currentLength % 3); + currentLength += cds.length(); children.add(cds); } } Modified: apollo/trunk/src/java/apollo/dataadapter/gff3/GFF3Entry.java =================================================================== --- apollo/trunk/src/java/apollo/dataadapter/gff3/GFF3Entry.java 2011-04-06 16:00:48 UTC (rev 24783) +++ apollo/trunk/src/java/apollo/dataadapter/gff3/GFF3Entry.java 2011-04-06 19:16:27 UTC (rev 24784) @@ -568,7 +568,10 @@ end = feat.getHigh(); score = feat.getScore(); strand = feat.getStrand(); - phase = feat.getPhase(); + // phase only applies to CDS + if (type.equals("CDS")) { + setPhase(feat.getPhase()); + } id = feat.getId(); name = feat.getName(); //populate dbxrefs This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |