X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fsifts%2FSiftsClient.java;fp=src%2Fjalview%2Fws%2Fsifts%2FSiftsClient.java;h=bf4d970def731329e70879d0a156f5c1db2862fd;hb=a83adb45bdf9554e270921b4baad94defd314b36;hp=d0656667f7891beaf88d1c2be107384235e58ebb;hpb=d4ec118f86b5c9dee801e743c46aaacc7bb521d1;p=jalview.git diff --git a/src/jalview/ws/sifts/SiftsClient.java b/src/jalview/ws/sifts/SiftsClient.java index d065666..bf4d970 100644 --- a/src/jalview/ws/sifts/SiftsClient.java +++ b/src/jalview/ws/sifts/SiftsClient.java @@ -82,6 +82,22 @@ public class SiftsClient implements SiftsClientI */ private static File mockSiftsFile; + private static final int BUFFER_SIZE = 4096; + + public static final int UNASSIGNED = Integer.MIN_VALUE; + + private static final int PDB_RES_POS = 0; + + private static final int PDB_ATOM_POS = 1; + + private static final int PDBE_POS = 2; + + private static final String NOT_OBSERVED = "Not_Observed"; + + protected static final String SIFTS_FTP_BASE_URL = "http://ftp.ebi.ac.uk/pub/databases/msd/sifts/xml/"; + + protected final static String NEWLINE = System.lineSeparator(); + private Entry siftsEntry; private StructureFile pdb; @@ -100,22 +116,6 @@ public class SiftsClient implements SiftsClientI */ private jalview.datamodel.Mapping seqFromPdbMapping; - private static final int BUFFER_SIZE = 4096; - - public static final int UNASSIGNED = Integer.MIN_VALUE; - - private static final int PDB_RES_POS = 0; - - private static final int PDB_ATOM_POS = 1; - - private static final int PDBE_POS = 2; - - private static final String NOT_OBSERVED = "Not_Observed"; - - private static final String SIFTS_FTP_BASE_URL = "http://ftp.ebi.ac.uk/pub/databases/msd/sifts/xml/"; - - private final static String NEWLINE = System.lineSeparator(); - private String curSourceDBRef; private HashSet curDBRefAccessionIdsString; @@ -400,7 +400,7 @@ public class SiftsClient implements SiftsClientI @Override public HashSet getAllMappingAccession() { - HashSet accessions = new HashSet(); + HashSet accessions = new HashSet<>(); List entities = siftsEntry.getEntity(); for (Entity entity : entities) { @@ -467,7 +467,7 @@ public class SiftsClient implements SiftsClientI entity = getEntityById(entityId); String originalSeq = AlignSeq.extractGaps( jalview.util.Comparison.GapChars, seq.getSequenceAsString()); - HashMap mapping = new HashMap(); + HashMap mapping = new HashMap<>(); DBRefEntryI sourceDBRef; sourceDBRef = getValidSourceDBRef(seq); // TODO ensure sequence start/end is in the same coordinate system and @@ -479,7 +479,7 @@ public class SiftsClient implements SiftsClientI seqCoordSys = CoordinateSys.PDB; } - HashSet dbRefAccessionIdsString = new HashSet(); + HashSet dbRefAccessionIdsString = new HashSet<>(); for (DBRefEntry dbref : seq.getDBRefs()) { dbRefAccessionIdsString.add(dbref.getAccessionId().toLowerCase()); @@ -489,7 +489,7 @@ public class SiftsClient implements SiftsClientI curDBRefAccessionIdsString = dbRefAccessionIdsString; curSourceDBRef = sourceDBRef.getAccessionId(); - TreeMap resNumMap = new TreeMap(); + TreeMap resNumMap = new TreeMap<>(); List segments = entity.getSegment(); SegmentHelperPojo shp = new SegmentHelperPojo(seq, mapping, resNumMap, omitNonObserved, nonObservedShiftIndex,pdbeNonObserved); @@ -668,9 +668,9 @@ public class SiftsClient implements SiftsClientI } if (!isObserved) { - ++pdbeNonObservedCount; + ++pdbeNonObservedCount; // TODO this value is never used } - if (seqCoordSys == seqCoordSys.PDB) // FIXME: is seqCoordSys ever PDBe + if (seqCoordSys == CoordinateSys.PDB) // FIXME: is seqCoordSys ever PDBe // ??? { // if the sequence has a primary reference to the PDB, then we are @@ -850,7 +850,7 @@ public class SiftsClient implements SiftsClientI private Set getResidueAnnotaitons(Residue residue, ResidueDetailType type) { - HashSet foundAnnotations = new HashSet(); + HashSet foundAnnotations = new HashSet<>(); List resDetails = residue.getResidueDetail(); for (ResidueDetail resDetail : resDetails) { @@ -995,6 +995,10 @@ public class SiftsClient implements SiftsClientI public int resCount; + protected SiftsEntitySortPojo() + { + } + @Override public int compareTo(SiftsEntitySortPojo o) { @@ -1044,6 +1048,7 @@ public class SiftsClient implements SiftsClientI { return pdbeNonObserved; } + public SequenceI getSeq() { return seq;