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

change visibility of functions and fix for non coding transcripts in GFF

files  
parent 3f40cfc2
No related branches found
No related tags found
No related merge requests found
...@@ -158,6 +158,14 @@ public class ValidateFeature ...@@ -158,6 +158,14 @@ public class ValidateFeature
new FeatureListFrame (title, sel, gotoSrc, fltrGrp, plotGrp); new FeatureListFrame (title, sel, gotoSrc, fltrGrp, plotGrp);
featureList.setVisible(true); featureList.setVisible(true);
} }
protected static boolean isGFF(final uk.ac.sanger.artemis.io.Feature f, final EntryGroup entryGrp)
{
final boolean isGFF = entryGrp == null || GeneUtils.isGFFEntry( entryGrp );
if(isGFF && f instanceof GFFStreamFeature)
return true;
return false;
}
/** /**
* Check a single feature * Check a single feature
...@@ -183,8 +191,7 @@ public class ValidateFeature ...@@ -183,8 +191,7 @@ public class ValidateFeature
final LinkedHashMap<String, Level> report = new LinkedHashMap<String, Level>(); final LinkedHashMap<String, Level> report = new LinkedHashMap<String, Level>();
final String fTxt = featureTxt(f); final String fTxt = featureTxt(f);
final boolean isGFF = entryGrp == null || GeneUtils.isGFFEntry( entryGrp ); if(isGFF(f, entryGrp))
if(isGFF && f instanceof GFFStreamFeature)
{ {
final GFFStreamFeature gffFeature = (GFFStreamFeature)f; final GFFStreamFeature gffFeature = (GFFStreamFeature)f;
report.put("\n"+GeneUtils.getUniqueName(gffFeature)+" ("+fTxt+"):", Level.INFO); report.put("\n"+GeneUtils.getUniqueName(gffFeature)+" ("+fTxt+"):", Level.INFO);
...@@ -229,7 +236,7 @@ public class ValidateFeature ...@@ -229,7 +236,7 @@ public class ValidateFeature
report.put("Prefix of ID attribute not consistent within gene model", Level.FATAL); report.put("Prefix of ID attribute not consistent within gene model", Level.FATAL);
} }
} }
if( (entryGrp == null || !GeneUtils.isDatabaseEntry(entryGrp)) && !isCDSPhaseOK(gffFeature)) if( (entryGrp == null || !GeneUtils.isDatabaseEntry(entryGrp)) && !isCDSPhaseOK(gffFeature))
{ {
pass = false; pass = false;
...@@ -432,7 +439,7 @@ public class ValidateFeature ...@@ -432,7 +439,7 @@ public class ValidateFeature
* 1 - no gene found * 1 - no gene found
* 2 - missing transcript * 2 - missing transcript
*/ */
private static int isCompleteGeneModelOK(final GFFStreamFeature gffFeature) protected static int isCompleteGeneModelOK(final GFFStreamFeature gffFeature)
{ {
final ChadoCanonicalGene gene = gffFeature.getChadoGene(); final ChadoCanonicalGene gene = gffFeature.getChadoGene();
if(gene == null) if(gene == null)
...@@ -445,7 +452,7 @@ public class ValidateFeature ...@@ -445,7 +452,7 @@ public class ValidateFeature
return 0; return 0;
} }
private static int isBoundaryOK(final GFFStreamFeature gffFeature) protected static int isBoundaryOK(final GFFStreamFeature gffFeature)
{ {
final ChadoCanonicalGene gene = gffFeature.getChadoGene(); final ChadoCanonicalGene gene = gffFeature.getChadoGene();
int gb = 0; int gb = 0;
...@@ -454,7 +461,7 @@ public class ValidateFeature ...@@ -454,7 +461,7 @@ public class ValidateFeature
return gb; return gb;
} }
private static boolean isStrandOK(final GFFStreamFeature gffFeature) protected static boolean isStrandOK(final GFFStreamFeature gffFeature)
{ {
final ChadoCanonicalGene gene = gffFeature.getChadoGene(); final ChadoCanonicalGene gene = gffFeature.getChadoGene();
if(gene != null && isGene(gffFeature) && !GeneUtils.isStrandOK(gene)) if(gene != null && isGene(gffFeature) && !GeneUtils.isStrandOK(gene))
...@@ -468,7 +475,7 @@ public class ValidateFeature ...@@ -468,7 +475,7 @@ public class ValidateFeature
* @param partialKeyStr - either Start_range or End_range qualifier keys * @param partialKeyStr - either Start_range or End_range qualifier keys
* @return * @return
*/ */
private static boolean isPartialConsistent(final GFFStreamFeature gffFeature, protected static boolean isPartialConsistent(final GFFStreamFeature gffFeature,
final String partialKeyStr) final String partialKeyStr)
{ {
final ChadoCanonicalGene gene = gffFeature.getChadoGene(); final ChadoCanonicalGene gene = gffFeature.getChadoGene();
...@@ -562,7 +569,7 @@ public class ValidateFeature ...@@ -562,7 +569,7 @@ public class ValidateFeature
* @param gffFeature * @param gffFeature
* @return true if the prefix is the same within the gene model features * @return true if the prefix is the same within the gene model features
*/ */
private static boolean isIdPrefixConsistent(final GFFStreamFeature gffFeature) protected static boolean isIdPrefixConsistent(final GFFStreamFeature gffFeature)
{ {
final ChadoCanonicalGene gene = gffFeature.getChadoGene(); final ChadoCanonicalGene gene = gffFeature.getChadoGene();
if(gene == null) if(gene == null)
...@@ -613,7 +620,7 @@ public class ValidateFeature ...@@ -613,7 +620,7 @@ public class ValidateFeature
* Check attribute column * Check attribute column
* @param gffFeature * @param gffFeature
*/ */
public static String isAttributesOK(final GFFStreamFeature gffFeature) protected static String isAttributesOK(final GFFStreamFeature gffFeature)
{ {
final StringBuilder str = new StringBuilder(); final StringBuilder str = new StringBuilder();
final QualifierVector qualifiers = gffFeature.getQualifiers(); final QualifierVector qualifiers = gffFeature.getQualifiers();
...@@ -661,7 +668,7 @@ public class ValidateFeature ...@@ -661,7 +668,7 @@ public class ValidateFeature
return str.toString(); return str.toString();
} }
public boolean isInternalStops(final uk.ac.sanger.artemis.io.Feature feature) protected boolean isInternalStops(final uk.ac.sanger.artemis.io.Feature feature)
{ {
if(feature.getUserData() == null) if(feature.getUserData() == null)
return false; return false;
...@@ -691,7 +698,7 @@ public class ValidateFeature ...@@ -691,7 +698,7 @@ public class ValidateFeature
if(cds_predicate != null) if(cds_predicate != null)
return cds_predicate; return cds_predicate;
if(entryGrp != null && GeneUtils.isDatabaseEntry( entryGrp )) if(entryGrp != null && GeneUtils.isGFFEntry( entryGrp ))
{ {
final FeaturePredicate codingPredicate = new FeaturePredicate(){ final FeaturePredicate codingPredicate = new FeaturePredicate(){
...@@ -752,7 +759,7 @@ public class ValidateFeature ...@@ -752,7 +759,7 @@ public class ValidateFeature
return msg; return msg;
} }
private static boolean isPartOfGene(final GFFStreamFeature gffFeature) protected static boolean isPartOfGene(final GFFStreamFeature gffFeature)
{ {
final String keyStr = gffFeature.getKey().getKeyString(); final String keyStr = gffFeature.getKey().getKeyString();
for(String part: getGeneModelParts()) for(String part: getGeneModelParts())
...@@ -1052,10 +1059,10 @@ public class ValidateFeature ...@@ -1052,10 +1059,10 @@ public class ValidateFeature
System.out.println("VALIDATING... "+seq); System.out.println("VALIDATING... "+seq);
uk.ac.sanger.artemis.Entry entry = ReadAndWriteEntry.readEntryFromDatabase(seq, entrySrc); uk.ac.sanger.artemis.Entry entry = ReadAndWriteEntry.readEntryFromDatabase(seq, entrySrc);
entrySrc = ReadAndWriteEntry.getEntrySource(); entrySrc = ReadAndWriteEntry.getEntrySource();
final EntryGroup egroup = new SimpleEntryGroup(); final EntryGroup egrp = new SimpleEntryGroup();
egroup.add(entry); egrp.add(entry);
ValidateFeature validate = new ValidateFeature(egroup); ValidateFeature validate = new ValidateFeature(egrp);
if(outfile == null) if(outfile == null)
validate.showReport(entry.getEMBLEntry(), seq); validate.showReport(entry.getEMBLEntry(), seq);
else else
...@@ -1074,10 +1081,8 @@ public class ValidateFeature ...@@ -1074,10 +1081,8 @@ public class ValidateFeature
{ {
System.out.println("VALIDATING... "+seq); System.out.println("VALIDATING... "+seq);
final Document doc = DocumentFactory.makeDocument(seq); final Document doc = DocumentFactory.makeDocument(seq);
final EntryInformation artemis_entry_information =
Options.getArtemisEntryInformation();
final uk.ac.sanger.artemis.io.Entry entry = EntryFileDialog.getEntryFromFile( final uk.ac.sanger.artemis.io.Entry entry = EntryFileDialog.getEntryFromFile(
null, doc, artemis_entry_information, false); null, doc, Options.getArtemisEntryInformation(), false);
ValidateFeature validate = new ValidateFeature(null); ValidateFeature validate = new ValidateFeature(null);
if(outfile == null) if(outfile == null)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment