Skip to content
Snippets Groups Projects
Commit ebc524a2 authored by tcarver's avatar tcarver
Browse files

move isSelenocysteine() to GFFUtils

parent e14b74bb
Branches
Tags
No related merge requests found
......@@ -1319,67 +1319,4 @@ public class GFFStreamFeature extends SimpleDocumentFeature
}
return false;
}
/**
* Test if this is feature is marked as having a stop codon
* redefined as selenocysteine
* @param f
* @return
*/
public static boolean isSelenocysteine(Feature f)
{
if(!(f instanceof GFFStreamFeature))
return false;
try
{
ChadoCanonicalGene gffGene = ((GFFStreamFeature)f).getChadoGene();
if(gffGene == null)
return false;
String transcript = gffGene.getTranscriptFromName(
GeneUtils.getUniqueName(f));
if(transcript == null)
return false;
Feature pep = gffGene.getProteinOfTranscript(transcript);
if(pep == null)
return false;
if(pep.getQualifierByName("stop_codon_redefined_as_selenocysteine") != null)
return true;
}
catch (Exception e){}
return false;
}
public static void main(String args[])
{
Key key = new Key("region");
try
{
final EntryInformation entry_information =
SimpleEntryInformation.getDefaultEntryInformation ();
GFFDocumentEntry entry = new GFFDocumentEntry(entry_information);
Location location = new Location("1003..1222");
QualifierVector qualifiers = new QualifierVector();
GFFStreamFeature f = new GFFStreamFeature(key, location, qualifiers);
entry.add(f);
java.io.File aFile = new java.io.File("x");
java.io.FileWriter writer = new java.io.FileWriter(aFile);
f.writeToStream(writer);
writer.close();
}
catch (LocationParseException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
catch (EntryInformationException e)
{
e.printStackTrace();
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment