X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FParseProperties.java;h=c580c77e645b145b1c2fe16dbd861c39a1e5a6ce;hb=838e4f91d4a53dd315640dbc9ff6ef7a815ee576;hp=38d83715cbc65538e04c74ac66e6893f0504fdd1;hpb=d07fe6a0891b57a9d707e356f7769395ce94b0da;p=jalview.git diff --git a/src/jalview/analysis/ParseProperties.java b/src/jalview/analysis/ParseProperties.java index 38d8371..c580c77 100644 --- a/src/jalview/analysis/ParseProperties.java +++ b/src/jalview/analysis/ParseProperties.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1) + * Copyright (C) 2015 The Jalview Authors * * This file is part of Jalview. * @@ -20,9 +20,11 @@ */ package jalview.analysis; -import com.stevesoft.pat.Regex; +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.SequenceI; -import jalview.datamodel.*; +import com.stevesoft.pat.Regex; public class ParseProperties { @@ -55,9 +57,8 @@ public class ParseProperties public int getScoresFromDescription(String ScoreName, String ScoreDescriptions, String regex, boolean repeat) { - return getScoresFromDescription(new String[] - { ScoreName }, new String[] - { ScoreDescriptions }, regex, repeat); + return getScoresFromDescription(new String[] { ScoreName }, + new String[] { ScoreDescriptions }, regex, repeat); } public int getScoresFromDescription(String[] ScoreNames, @@ -101,7 +102,9 @@ public class ParseProperties ScoreNames = tnames; String descrbase = ScoreDescriptions[onamelen - 1]; if (descrbase == null) + { descrbase = "Score parsed from (" + regex + ")"; + } tnames = new String[pattern.numSubs() + 1]; System.arraycopy(ScoreDescriptions, 0, tnames, 0, ScoreDescriptions.length); @@ -116,7 +119,9 @@ public class ParseProperties { String descr = seqs[i].getDescription(); if (descr == null) + { continue; + } int pos = 0; boolean added = false; int reps = 0; @@ -140,7 +145,8 @@ public class ParseProperties + ((reps > 0) ? "_" + reps : ""), ScoreDescriptions[cols], null); an.setScore(score); - System.out.println("Score: " + ScoreNames[cols] + "=" + score); // DEBUG + System.out.println(seqs[i].getName() + " score: '" + + ScoreNames[cols] + "' = " + score); // DEBUG an.setSequenceRef(seqs[i]); seqs[i].addAlignmentAnnotation(an); al.addAnnotation(an);