X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FStockholmFile.java;h=a9124d9325173203481ecd58129d230cd9b5d5f0;hb=b57a02c25e335d033c97f8a6bacd6b54f62bd2b6;hp=6b60cd528e264978d6970521fea9b525e93a2695;hpb=c24d7fddcbce270e9d766872238e3f14b6bf6719;p=jalview.git diff --git a/src/jalview/io/StockholmFile.java b/src/jalview/io/StockholmFile.java index 6b60cd5..a9124d9 100644 --- a/src/jalview/io/StockholmFile.java +++ b/src/jalview/io/StockholmFile.java @@ -150,15 +150,15 @@ public class StockholmFile extends AlignFile int end = -1; String sid = acc; /* - * Retrieve hash of annotations for this accession - * Associate Annotation with accession + * Retrieve hash of annotations for this accession Associate + * Annotation with accession */ Hashtable accAnnotations = null; if (seqAnn != null && seqAnn.containsKey(acc)) { accAnnotations = (Hashtable) seqAnn.remove(acc); - //TODO: add structures to sequence + // TODO: add structures to sequence } // Split accession in id and from/to @@ -188,19 +188,19 @@ public class StockholmFile extends AlignFile jalview.util.DBRefUtils.parseToDbRef(seqO, src, "0", acn); // seqO.addDBRef(dbref); } - } + } if (accAnnotations != null && accAnnotations.containsKey("SS")) { - Vector v = (Vector) accAnnotations.get("SS"); - - for (int i = 0; i < v.size(); i++) - { - AlignmentAnnotation an = (AlignmentAnnotation) v.elementAt(i); - seqO.addAlignmentAnnotation(an); - //annotations.add(an); - } + Vector v = (Vector) accAnnotations.get("SS"); + + for (int i = 0; i < v.size(); i++) + { + AlignmentAnnotation an = (AlignmentAnnotation) v.elementAt(i); + seqO.addAlignmentAnnotation(an); + // annotations.add(an); + } } - + Hashtable features = null; // We need to adjust the positions of all features to account for gaps try @@ -442,7 +442,8 @@ public class StockholmFile extends AlignFile ann = new Hashtable(); seqAnn.put(acc, ann); } - //TODO test structure, call parseAnnotationRow with vector from hashtable for specific sequence + // TODO test structure, call parseAnnotationRow with vector from + // hashtable for specific sequence Hashtable features; // Get an object with all the content for an annotation if (ann.containsKey("features")) @@ -477,24 +478,25 @@ public class StockholmFile extends AlignFile } ns += seq; content.put(description, ns); - - if(type.equals("SS")){ - Hashtable strucAnn; - if (seqAnn.containsKey(acc)) - { - strucAnn = (Hashtable) seqAnn.get(acc); - } - else - { - strucAnn = new Hashtable(); - } - - Vector newStruc=new Vector(); - parseAnnotationRow(newStruc, type,ns); - - strucAnn.put(type, newStruc); - seqAnn.put(acc, strucAnn); - } + + if (type.equals("SS")) + { + Hashtable strucAnn; + if (seqAnn.containsKey(acc)) + { + strucAnn = (Hashtable) seqAnn.get(acc); + } + else + { + strucAnn = new Hashtable(); + } + + Vector newStruc = new Vector(); + parseAnnotationRow(newStruc, type, ns); + + strucAnn.put(type, newStruc); + seqAnn.put(acc, strucAnn); + } } else { @@ -521,8 +523,8 @@ public class StockholmFile extends AlignFile } } - protected static AlignmentAnnotation parseAnnotationRow(Vector annotation, - String label, String annots) + protected static AlignmentAnnotation parseAnnotationRow( + Vector annotation, String label, String annots) { String convert1, convert2 = null; @@ -600,7 +602,7 @@ public class StockholmFile extends AlignFile annot.annotations.length); System.arraycopy(els, 0, anns, annot.annotations.length, els.length); annot.annotations = anns; - //System.out.println("else: "); + // System.out.println("else: "); } return annot; }