From 9fe76dc8b685a5a48aeff77c7a9eaf862da3340e Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 26 Apr 2007 10:36:42 +0000 Subject: [PATCH] basic methods for adding scores extracted from description --- src/jalview/analysis/ParseProperties.java | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/jalview/analysis/ParseProperties.java b/src/jalview/analysis/ParseProperties.java index 015fcfe..c23cb3a 100644 --- a/src/jalview/analysis/ParseProperties.java +++ b/src/jalview/analysis/ParseProperties.java @@ -8,6 +8,14 @@ public class ParseProperties { /** * Methods for parsing free text properties on alignments and sequences. + * There are a number of ways we might want to do this: + * arbitrary regex. and an associated score name for the number that's extracted. + * Regex that provides both score and name. + * + * We may also want to : + * - modify description to remove parsed numbers (this behaviour is dangerous since exporting the alignment would lose the original form then) + * - + * */ /** * The alignment being operated on @@ -18,7 +26,7 @@ public class ParseProperties * initialise a new property parser * @param al */ - ParseProperties(AlignmentI al) { + public ParseProperties(AlignmentI al) { this.al = al; } @@ -51,10 +59,10 @@ public class ParseProperties System.arraycopy(ScoreNames, 0, tnames, 0, ScoreNames.length); String base = tnames[ScoreNames.length-1]; ScoreNames = tnames; - String descrbase = ScoreDescriptions[ScoreNames.length-1]; + String descrbase = ScoreDescriptions[onamelen-1]; if (descrbase == null) descrbase = "Score parsed from ("+regex+")"; - tnames = new String[pattern.numSubs()]; + tnames = new String[pattern.numSubs()+1]; System.arraycopy(ScoreDescriptions, 0, tnames, 0, ScoreDescriptions.length); ScoreDescriptions = tnames; for (int i=onamelen; i