diff --git a/.travis.yml b/.travis.yml index 6be4786ae3..f9a66a457b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: java jdk: - - oraclejdk8 + - oraclejdk9 sudo: required cache: directories: diff --git a/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/embl/EmblId.java b/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/embl/EmblId.java index 4c93427767..f89c79762c 100644 --- a/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/embl/EmblId.java +++ b/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/embl/EmblId.java @@ -20,8 +20,6 @@ */ package org.biojava.nbio.core.sequence.io.embl; -import jdk.nashorn.internal.ir.annotations.Immutable; - /** * This class contains the processed data of embl file * Primary accession number @@ -35,7 +33,6 @@ * @author Noor Aldeen Al Mbaidin * @since 5.0.0 */ -@Immutable public class EmblId { diff --git a/biojava-protein-disorder/pom.xml b/biojava-protein-disorder/pom.xml index 0981772719..b04aaceee8 100644 --- a/biojava-protein-disorder/pom.xml +++ b/biojava-protein-disorder/pom.xml @@ -84,6 +84,10 @@ org.apache.logging.log4j log4j-core + + javax.xml.bind + jaxb-api + diff --git a/biojava-structure/pom.xml b/biojava-structure/pom.xml index 41d65cf3ab..6db447ae6f 100644 --- a/biojava-structure/pom.xml +++ b/biojava-structure/pom.xml @@ -62,6 +62,25 @@ 1.1.0 + + + javax.xml.bind + jaxb-api + + + com.sun.xml.bind + jaxb-core + + + com.sun.xml.bind + jaxb-impl + + + javax.activation + activation + + diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/cath/CathInstallation.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/cath/CathInstallation.java index c845c76201..9c0815d2e6 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/cath/CathInstallation.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/cath/CathInstallation.java @@ -636,6 +636,7 @@ private void parseCathDomall(BufferedReader bufferedReader) throws IOException{ protected void downloadFileFromRemote(URL remoteURL, File localFile) throws IOException{ // System.out.println("downloading " + remoteURL + " to: " + localFile); + LOGGER.info("Downloaded file {} to local file {}", remoteURL, localFile); long timeS = System.currentTimeMillis(); File tempFile = File.createTempFile(FileDownloadUtils.getFilePrefix(localFile), "."+ FileDownloadUtils.getFileExtension(localFile)); @@ -665,7 +666,7 @@ protected void downloadFileFromRemote(URL remoteURL, File localFile) throws IOEx disp = disp / 1024.0; } long timeE = System.currentTimeMillis(); - LOGGER.info("Downloaded file {} ({}) to local file {} in {} sec.", remoteURL, String.format("%.1f",disp) + unit, localFile, (timeE - timeS)/1000); + LOGGER.info("Downloaded {} in {} sec. to {}", String.format("%.1f",disp) + unit, (timeE - timeS)/1000, localFile); } private boolean domainDescriptionFileAvailable(){ diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java index 66088feafb..eb8762a002 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java @@ -151,7 +151,7 @@ public class PDBFileParser { private Chain currentChain; private Group currentGroup; - private List seqResChains; // contains all the chains for the SEQRES records + private List seqResChains; // contains all the chains for the SEQRES records //we're going to work on the assumption that the files are current - //if the pdb_HEADER_Handler detects a legacy format, this will be changed to true. //if true then lines will be truncated at 72 characters in certain cases @@ -159,7 +159,7 @@ public class PDBFileParser { private boolean isLegacyFormat = false; private boolean blankChainIdsPresent = false; - + // for re-creating the biological assembly private PDBBioAssemblyParser bioAssemblyParser = null; @@ -186,7 +186,7 @@ public class PDBFileParser { private Map> siteToResidueMap = new LinkedHashMap>(); private List ssbonds = new ArrayList<>(); - + // for storing LINK until we have all the atoms parsed private List linkRecords; @@ -253,7 +253,7 @@ public class PDBFileParser { private FileParsingParameters params; - + private boolean startOfMolecule; private boolean startOfModel; @@ -261,7 +261,7 @@ public PDBFileParser() { params = new FileParsingParameters(); allModels = new ArrayList<>(); - structure = null; + structure = null ; currentModel = null; currentChain = null; currentGroup = null; @@ -285,14 +285,14 @@ public PDBFileParser() { atomCount = 0; atomOverflow = false; parseCAonly = false; - + // this SHOULD not be done // DONOT:setFileParsingParameters(params); // set the correct max values for parsing... loadMaxAtoms = params.getMaxAtoms(); atomCAThreshold = params.getAtomCaThreshold(); - - linkRecords = new ArrayList(); + + linkRecords = new ArrayList(); blankChainIdsPresent = false; @@ -675,7 +675,7 @@ private void pdb_REVDAT_Handler(String line) { // keep the first as latest modified date and the last as release date Date modDate = pdbHeader.getModDate(); - if ( modDate == null || modDate.equals(new Date(0)) ) { + if ( modDate==null || modDate.equals(new Date(0)) ) { // modified date is still uninitialized String modificationDate = line.substring (13, 22).trim() ; @@ -698,9 +698,9 @@ private void pdb_REVDAT_Handler(String line) { pdbHeader.setRelDate(dep); } catch (ParseException e){ logger.info("Could not parse revision date string '"+releaseDate+"'. "); - } } } + } /** * Handler for @@ -1027,7 +1027,7 @@ private void compndValueSetter(String field, String value) { current_compound = new EntityInfo(); current_compound.setMolId(i); - + // we will set polymer for all defined compounds in PDB file (non-polymer compounds are not defined in header) - JD 2016-03-25 current_compound.setType(EntityType.POLYMER); @@ -1547,7 +1547,7 @@ private void pdb_CRYST1_Handler(String line) { * * * Note that we ignore operators with iGiven==1 - * + * * @param line */ private void pdb_MTRIXn_Handler(String line) { @@ -1633,16 +1633,16 @@ private void pdb_ATOM_Handler(String line) { // let's first get the chain name which will serve to identify if we are starting a new molecule String chainName = line.substring(21,22); - + if (chainName.equals(" ")) { blankChainIdsPresent = true; } - + if (currentChain!=null && !currentChain.getName().equals(chainName)) { // new chain name: another molecule coming startOfMolecule = true; } - + if (startOfMolecule) { // we add last chain if there was one if (currentChain!=null) { @@ -1657,8 +1657,8 @@ private void pdb_ATOM_Handler(String line) { // note that the chainId (asym id) is set properly later in assignAsymIds currentChain.setId(chainName); currentChain.setName(chainName); - - } + + } if (startOfModel) { // we add last model if there was one @@ -1668,8 +1668,8 @@ private void pdb_ATOM_Handler(String line) { // we initialise the model to come currentModel = new ArrayList<>(); } - - + + // let's get the residue number and see if we need to start a new group String groupCode3 = line.substring(17,20).trim(); @@ -1698,7 +1698,7 @@ private void pdb_ATOM_Handler(String line) { // can be found as HETATOM records if ( aminoCode1 != null && aminoCode1.equals(StructureTools.UNKNOWN_GROUP_LABEL)) aminoCode1 = null; - + isHetAtomInFile = true; } @@ -1711,7 +1711,7 @@ private void pdb_ATOM_Handler(String line) { currentGroup.setHetAtomInFile(isHetAtomInFile); } - + // resetting states startOfModel = false; startOfMolecule = false; @@ -1860,7 +1860,7 @@ private void pdb_ATOM_Handler(String line) { + "from Chemical Component Dictionary information", fullname.trim(), pdbnumber); } else { - try { + try { element = Element.valueOfIgnoreCase(elementSymbol); guessElement = false; } catch (IllegalArgumentException e){ @@ -1886,14 +1886,14 @@ private void pdb_ATOM_Handler(String line) { if (elementSymbol == null) { logger.info("Atom name {} was not found in the Chemical Component Dictionary information of {}. " + "Assigning generic element R to it", fullname.trim(), currentGroup.getPDBName()); - } else { - try { - element = Element.valueOfIgnoreCase(elementSymbol); + } else { + try { + element = Element.valueOfIgnoreCase(elementSymbol); } catch (IllegalArgumentException e) { // this can still happen for cases like UNK logger.info("Element symbol {} found in chemical component dictionary for Atom {} {} could not be recognised as a known element. " + "Assigning generic element R to it", elementSymbol, fullname.trim(), pdbnumber); - } + } } } else { logger.warn("Chemical Component Dictionary information was not found for Atom name {}. " @@ -1922,7 +1922,7 @@ private void pdb_ATOM_Handler(String line) { - } + } private Group getCorrectAltLocGroup( Character altLoc, @@ -2099,13 +2099,13 @@ private void pdb_CONECT_Handler(String line) { private void pdb_MODEL_Handler(String line) { if (params.isHeaderOnly()) return; - + // new model: we start a new molecule startOfMolecule = true; startOfModel = true; - } - + } + /** * Handler for TER record. The record is used in deposited PDB files and many others, * but it's often forgotten by some softwares. In any case it helps identifying the @@ -2113,7 +2113,7 @@ private void pdb_MODEL_Handler(String line) { */ private void pdb_TER_Handler() { startOfMolecule = true; - } + } /** @@ -2568,7 +2568,7 @@ public Structure parsePDBFile(InputStream inStream) */ public Structure parsePDBFile(BufferedReader buf) throws IOException - { + { // set the correct max values for parsing... loadMaxAtoms = params.getMaxAtoms(); atomCAThreshold = params.getAtomCaThreshold(); @@ -2607,7 +2607,7 @@ public Structure parsePDBFile(BufferedReader buf) atomOverflow = false; linkRecords = new ArrayList(); siteToResidueMap.clear(); - + blankChainIdsPresent = false; parseCAonly = params.isParseCAOnly(); @@ -2689,7 +2689,7 @@ else if ( params.isParseSecStruc()) { } } catch (StringIndexOutOfBoundsException | NullPointerException ex) { logger.info("Unable to parse [" + line + "]"); - } + } } makeCompounds(compndLines, sourceLines); @@ -2712,7 +2712,7 @@ else if ( params.isParseSecStruc()) { return structure; - } + } /** @@ -2767,13 +2767,13 @@ private void makeCompounds(List compoundList, private void formBonds() { BondMaker maker = new BondMaker(structure, params); - + // LINK records should be preserved, they are the way that // inter-residue bonds are created for ligands such as trisaccharides, unusual polymers. // The analogy in mmCIF is the _struct_conn record. for (LinkRecord linkRecord : linkRecords) { - maker.formLinkRecordBond(linkRecord); - } + maker.formLinkRecordBond(linkRecord); + } maker.formDisulfideBonds(ssbonds); @@ -2819,7 +2819,7 @@ private void triggerEndFileChecks(){ } } - + structure.setPDBHeader(pdbHeader); structure.setCrystallographicInfo(crystallographicInfo); @@ -2828,7 +2828,7 @@ private void triggerEndFileChecks(){ buildjournalArticle(); pdbHeader.setJournalArticle(journalArticle); } - + structure.setDBRefs(dbrefs); // Only align if requested (default) and not when headerOnly mode with no Atoms. @@ -2844,7 +2844,7 @@ private void triggerEndFileChecks(){ } - + //associate the temporary Groups in the siteMap to the ones if (!params.isHeaderOnly()) { // Only can link SITES if Atom Groups were parsed. @@ -2989,12 +2989,12 @@ private static List> findChains(String chainName, List> private static List> splitNonPolyChain(Chain chain) { List splitNonPolys = new ArrayList<>(); List waterChains = new ArrayList<>(); - + Chain split = null; boolean previousGroupIsWater = false; - + for (Group g:chain.getAtomGroups()){ - + if (!previousGroupIsWater) { // add last one if there's one if (split!=null) { @@ -3009,18 +3009,18 @@ private static List> splitNonPolyChain(Chain chain) { split = new ChainImpl(); split.setName(chain.getName()); } - + if (g.isWater()) { previousGroupIsWater = true; } else { previousGroupIsWater = false; - } + } // this should include alt locs (referenced from the main group) split.addGroup(g); - } + } // adding the last split chain: either to water or non-poly depending on what was the last seen group if (split!=null) { @@ -3036,7 +3036,7 @@ private static List> splitNonPolyChain(Chain chain) { all.add(waterChains); return all; - } + } /** * Assign asym ids following the rules used by the PDB to assign asym ids in mmCIF files @@ -3056,14 +3056,14 @@ private void assignAsymIds(List> polys, List> nonPolys, for (Chain nonPoly:nonPolys.get(i)) { nonPoly.setId(asymId); asymId = getNextAsymId(asymId); - } + } for (Chain water:waters.get(i)) { water.setId(asymId); asymId = getNextAsymId(asymId); } } } - + /** * Gets the next asym id given an asymId, according to the convention followed by * mmCIF files produced by the PDB @@ -3081,13 +3081,13 @@ private String getNextAsymId(String asymId) { } else if (asymId.length()==2) { if (asymId.equals("ZZ")) { return "AAA"; - } + } char[] c = new char[2]; asymId.getChars(0, 2, c, 0); c[0] = getNextChar(c[0]); if (c[0]=='A') { c[1] = getNextChar(c[1]); - } + } return new String(c); } else if (asymId.length()==3) { char[] c = new char[3]; @@ -3097,13 +3097,13 @@ private String getNextAsymId(String asymId) { c[1] = getNextChar(c[1]); if (c[1]=='A') { c[2] = getNextChar(c[2]); - } + } } return new String(c); } return null; } - + private char getNextChar(char c) { if (c!='Z') { return ((char)(c+1)); @@ -3111,7 +3111,7 @@ private char getNextChar(char c) { return 'A'; } } - + /** * Here we assign chains following the mmCIF data model: * one chain per polymer, one chain per non-polymer group and @@ -3122,7 +3122,7 @@ private char getNextChar(char c) { * */ private void assignChainsAndEntities(){ - + List> polyModels = new ArrayList<>(); List> nonPolyModels = new ArrayList<>(); List> waterModels = new ArrayList<>(); @@ -3164,13 +3164,13 @@ private void assignChainsAndEntities(){ List> splits = splitNonPolyChain(nonPoly); splitNonPolys.addAll(splits.get(0)); waterModel.addAll(splits.get(1)); - } + } } - - + + // now we have all chains as in mmcif, let's assign ids following the mmcif rules assignAsymIds(polyModels, splitNonPolyModels, waterModels); - + if (!entities.isEmpty()) { // if the file contained COMPOUND records then we can assign entities to the poly chains @@ -3186,7 +3186,7 @@ private void assignChainsAndEntities(){ for (Chain chain:matchingChains) { comp.addChain(chain); chain.setEntityInfo(comp); - } + } if (matchingChains.isEmpty()) { // usually if this happens something is wrong with the PDB header @@ -3195,11 +3195,11 @@ private void assignChainsAndEntities(){ // but the authors didn't observe in the density so it's completely missing // from the ATOM lines logger.warn("Could not find polymeric chain {} to link to entity {}. The chain will be missing in the entity.", chainId, comp.getMolId()); - } + } } } } - + } else { logger.info("Entity information (COMPOUND record) not found in file. Will assign entities heuristically"); @@ -3643,6 +3643,7 @@ public void setFileParsingParameters(FileParsingParameters params) loadMaxAtoms = params.getMaxAtoms(); atomCAThreshold = params.getAtomCaThreshold(); + } public FileParsingParameters getFileParsingParameters(){ @@ -3650,4 +3651,4 @@ public FileParsingParameters getFileParsingParameters(){ } -} +} \ No newline at end of file diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java index d1dcbb08f7..0a48ffee93 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java @@ -50,13 +50,13 @@ /** * This provider of chemical components can download and cache chemical component definition files from the RCSB PDB web site. - * It is the default way to access these definitions. - * If this provider is called he first time, it will download and install all chemical - * component definitions in a local directory. - * Once the definition files have been installed, it has quick startup time and low memory requirements. + * It is the default way to access these definitions. + * If this provider is called he first time, it will download and install all chemical + * component definitions in a local directory. + * Once the definition files have been installed, it has quick startup time and low memory requirements. * - * An alternative provider, that keeps all definitions in memory is the {@link AllChemCompProvider}. Another provider, that - * does not require any network access, but only can support a limited set of chemical component definitions, is the {@link ReducedChemCompProvider}. + * An alternative provider, that keeps all definitions in memory is the {@link AllChemCompProvider}. Another provider, that + * does not require any network access, but only can support a limited set of chemical component definitions, is the {@link ReducedChemCompProvider}. * * * @author Andreas Prlic @@ -69,9 +69,9 @@ public class DownloadChemCompProvider implements ChemCompProvider { public static final String CHEM_COMP_CACHE_DIRECTORY = "chemcomp"; public static final String DEFAULT_SERVER_URL = "http://files.rcsb.org/ligands/download/"; - + public static String serverBaseUrl = DEFAULT_SERVER_URL; - + /** * Use default RCSB server layout (true) or internal RCSB server layout (false) */ @@ -452,7 +452,7 @@ private void downloadAllDefinitions() { split(); } catch (IOException e) { logger.error("Could not split all chem comp file into individual chemical component files. Error: {}", - e.getMessage()); + e.getMessage()); // no point in reporting time loading.set(false); return; diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java index 3ce4bde692..d3a31a1adc 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java @@ -473,10 +473,10 @@ public void newAtomSite(AtomSite atom) { } // ANTHONY BRADLEY ADDED THIS -> WE ONLY WAN'T TO CHECK FOR ALT LOCS WHEN IT's NOT THE FIRST GROUP IN CHAIN else{ - // check if residue number is the same ... - // insertion code is part of residue number + // check if residue number is the same ... + // insertion code is part of residue number if ( ! residueNumber.equals(currentGroup.getResidueNumber())) { - //System.out.println("end of residue: "+current_group.getPDBCode()+" "+residueNrInt); + //System.out.println("end of residue: "+current_group.getPDBCode()+" "+residueNrInt); currentChain.addGroup(currentGroup); currentGroup.trimToSize(); currentGroup = getNewGroup(recordName,aminoCode1,seq_id,groupCode3); @@ -485,19 +485,19 @@ public void newAtomSite(AtomSite atom) { currentGroup.setHetAtomInFile(isHetAtomInFile); - } else { - // same residueNumber, but altLocs... + } else { + // same residueNumber, but altLocs... // test altLoc - if ( ! altLoc.equals(' ') && ( ! altLoc.equals('.'))) { + if ( ! altLoc.equals(' ') && ( ! altLoc.equals('.'))) { logger.debug("found altLoc! " + altLoc + " " + currentGroup + " " + altGroup); - altGroup = getCorrectAltLocGroup( altLoc,recordName,aminoCode1,groupCode3, seq_id); - if (altGroup.getChain()==null) { + altGroup = getCorrectAltLocGroup( altLoc,recordName,aminoCode1,groupCode3, seq_id); + if (altGroup.getChain()==null) { altGroup.setChain(currentChain); - } } } } + } //atomCount++; //System.out.println("fixing atom name for >" + atom.getLabel_atom_id() + "< >" + fullname + "<"); @@ -527,17 +527,17 @@ public void newAtomSite(AtomSite atom) { String atomName = a.getName(); - // make sure that main group has all atoms + // make sure that main group has all atoms // GitHub issue: #76 if ( ! currentGroup.hasAtom(atomName)) { // Unless it's microheterogenity https://github.com/rcsb/codec-devel/issues/81 if (currentGroup.getPDBName().equals(a.getGroup().getPDBName())) { if(!StructureTools.hasNonDeuteratedEquiv(a,currentGroup)){ currentGroup.addAtom(a); - } + } } - } + } } /** @@ -729,7 +729,7 @@ public void documentEnd() { // we'll only add seqres chains that are polymeric or unknown if (type==null || type==EntityType.POLYMER ) { - seqResChains.add(seqres); + seqResChains.add(seqres); } logger.debug(" seqres: " + asym.getId() + " " + seqres + "<") ; @@ -933,9 +933,9 @@ private void linkEntities() { entityInfo.addChain(chain); if (chain.isWaterOnly()) { entityInfo.setType(EntityType.WATER); - } else { + } else { entityInfo.setType(EntityType.NONPOLYMER); - } + } chain.setEntityInfo(entityInfo); structure.addEntityInfo(entityInfo); } else { @@ -1133,20 +1133,20 @@ private void addEntities(StructAsym asym) { entityInfo = new EntityInfo(); entityInfo.setMolId(eId); // we only add the compound if a polymeric one (to match what the PDB parser does) - if (e!=null) { + if (e!=null) { entityInfo.setDescription(e.getPdbx_description()); EntityType eType = EntityType.entityTypeFromString(e.getType()); if (eType!=null) { entityInfo.setType(eType); - } else { + } else { logger.warn("Type '{}' is not recognised as a valid entity type for entity {}", e.getType(), eId); - } + } addAncilliaryEntityData(asym, eId, e, entityInfo); structure.addEntityInfo(entityInfo); logger.debug("Adding Entity with entity id {} from _entity, with name: {}",eId, entityInfo.getDescription()); + } } - } } @@ -1177,15 +1177,15 @@ private void addAncilliaryEntityData(StructAsym asym, int entityId, Entity entit continue; addInformationFromESN(esn, entityId, entityInfo); - } + } for (EntitySrcSyn ess : entitySrcSyns) { if (! ess.getEntity_id().equals(asym.getEntity_id())) continue; addInfoFromESS(ess, entityId, entityInfo); - } - } + } + } /** * Add the information from an ESG to a compound. @@ -1201,7 +1201,7 @@ private void addInformationFromESG(EntitySrcGen entitySrcInfo, int entityId, Ent c.setOrganismTaxId(entitySrcInfo.getPdbx_gene_src_ncbi_taxonomy_id()); c.setExpressionSystemTaxId(entitySrcInfo.getPdbx_host_org_ncbi_taxonomy_id()); c.setExpressionSystem(entitySrcInfo.getPdbx_host_org_scientific_name()); - } + } /** * Add the information to entity info from ESN. @@ -1254,9 +1254,9 @@ private void initMaps() { List asymIds = new ArrayList<>(); asymIds.add(asym.getId()); entityId2asymId.put(asym.getEntity_id(), asymIds); - } + } } - + if (entityPolys==null || entityPolys.isEmpty()) { logger.info("No _entity_poly category found in file. No asym id to author id mapping will be available for header only parsing"); return; @@ -1415,7 +1415,7 @@ public void newDatabasePDBrev(DatabasePDBrev dbrev) { structure.setPDBHeader(header); } - + @Override public void newPdbxAuditRevisionHistory(PdbxAuditRevisionHistory history) { @@ -1551,7 +1551,7 @@ public void newRefine(Refine r){ if(pdbHeader.getRwork()!=PDBHeader.DEFAULT_RFREE) { logger.warn("More than 1 R work value present, will use last one {} and discard previous {} ", r.getLs_R_factor_R_work(), String.format("%4.2f",pdbHeader.getRwork())); - } + } if(r.getLs_R_factor_R_work()==null){ logger.info("_refine.ls_R_factor_R_work not present, not parsing R-work value"); } @@ -1635,7 +1635,7 @@ public void newCell(Cell cell) { if (!xtalCell.isCellReasonable()) { // If the entry describes a structure determined by a technique other than X-ray crystallography, - // cell is (sometimes!) a = b = c = 1.0, alpha = beta = gamma = 90 degrees + // cell is (sometimes!) a = b = c = 1.0, alpha = beta = gamma = 90 degrees // if so we don't add and CrystalCell will be null logger.debug("The crystal cell read from file does not have reasonable dimensions (at least one dimension is below {}), discarding it.", CrystalCell.MIN_VALID_CELL_SIZE); @@ -1744,7 +1744,7 @@ public void newStructRefSeq(StructRefSeq sref) { r.setDatabase(structRef.getDb_name()); r.setDbIdCode(structRef.getDb_code()); } - + int seqbegin; int seqend; try{ @@ -1756,12 +1756,12 @@ public void newStructRefSeq(StructRefSeq sref) { logger.warn("Couldn't parse pdbx_auth_seq_align_beg/end in _struct_ref_seq. Will not store dbref alignment info for accession {}. Error: {}", r.getDbAccession(), e.getMessage()); return; } - + Character begin_ins_code = ' '; if (sref.getPdbx_seq_align_beg_ins_code() != null ) { begin_ins_code = new Character(sref.getPdbx_seq_align_beg_ins_code().charAt(0)); } - + Character end_ins_code = ' '; if (sref.getPdbx_seq_align_end_ins_code() != null) { end_ins_code = new Character(sref.getPdbx_seq_align_end_ins_code().charAt(0)); @@ -1781,7 +1781,7 @@ public void newStructRefSeq(StructRefSeq sref) { int dbseqbegin = Integer.parseInt(sref.getDb_align_beg()); int dbseqend = Integer.parseInt(sref.getDb_align_end()); - + Character db_begin_in_code = ' '; if (sref.getPdbx_db_align_beg_ins_code() != null) { db_begin_in_code = new Character(sref.getPdbx_db_align_beg_ins_code().charAt(0)); @@ -1954,7 +1954,7 @@ public void newPdbxPolySeqScheme(PdbxPolySeqScheme ppss) { // replaceGroupSeqPos(ppss); // This might be incorrect in some pdb, to use auth_seq_id of the pdbx_poly_seq_scheme. - } + } @Override @@ -1966,7 +1966,7 @@ public void newPdbxNonPolyScheme(PdbxNonPolyScheme ppss) { // merge the EntityPolySeq info and the AtomSite chains into one... //already known ignore: - } + } @Override public void newPdbxEntityNonPoly(PdbxEntityNonPoly pen){ @@ -2099,68 +2099,68 @@ private void addSites() { if (sites == null) sites = new ArrayList(); for (StructSiteGen siteGen : structSiteGens) { - // For each StructSiteGen, find the residues involved, if they exist then - String site_id = siteGen.getSite_id(); // multiple could be in same site. - if (site_id == null) site_id = ""; - String comp_id = siteGen.getLabel_comp_id(); // PDBName + // For each StructSiteGen, find the residues involved, if they exist then + String site_id = siteGen.getSite_id(); // multiple could be in same site. + if (site_id == null) site_id = ""; + String comp_id = siteGen.getLabel_comp_id(); // PDBName - // Assumption: the author chain ID and residue number for the site is consistent with the original - // author chain id and residue numbers. + // Assumption: the author chain ID and residue number for the site is consistent with the original + // author chain id and residue numbers. String asymId = siteGen.getLabel_asym_id(); // chain name String authId = siteGen.getAuth_asym_id(); // chain Id - String auth_seq_id = siteGen.getAuth_seq_id(); // Res num + String auth_seq_id = siteGen.getAuth_seq_id(); // Res num - String insCode = siteGen.getPdbx_auth_ins_code(); - if ( insCode != null && insCode.equals("?")) - insCode = null; + String insCode = siteGen.getPdbx_auth_ins_code(); + if ( insCode != null && insCode.equals("?")) + insCode = null; - // Look for asymID = chainID and seqID = seq_ID. Check that comp_id matches the resname. - Group g = null; - try { + // Look for asymID = chainID and seqID = seq_ID. Check that comp_id matches the resname. + Group g = null; + try { Chain chain = structure.getChain(asymId); - if (null != chain) { - try { - Character insChar = null; - if (null != insCode && insCode.length() > 0) insChar = insCode.charAt(0); + if (null != chain) { + try { + Character insChar = null; + if (null != insCode && insCode.length() > 0) insChar = insCode.charAt(0); g = chain.getGroupByPDB(new ResidueNumber(null, Integer.parseInt(auth_seq_id), insChar)); - } catch (NumberFormatException e) { + } catch (NumberFormatException e) { logger.warn("Could not lookup residue : " + authId + auth_seq_id); + } } + } catch (StructureException e) { + logger.warn("Problem finding residue in site entry " + siteGen.getSite_id() + " - " + e.getMessage(), e.getMessage()); } - } catch (StructureException e) { - logger.warn("Problem finding residue in site entry " + siteGen.getSite_id() + " - " + e.getMessage(), e.getMessage()); - } - if (g != null) { - // 2. find the site_id, if not existing, create anew. - Site site = null; - for (Site asite: sites) { - if (site_id.equals(asite.getSiteID())) site = asite; - } + if (g != null) { + // 2. find the site_id, if not existing, create anew. + Site site = null; + for (Site asite: sites) { + if (site_id.equals(asite.getSiteID())) site = asite; + } - boolean addSite = false; + boolean addSite = false; - // 3. add this residue to the site. - if (site == null) { - addSite = true; - site = new Site(); - site.setSiteID(site_id); - } + // 3. add this residue to the site. + if (site == null) { + addSite = true; + site = new Site(); + site.setSiteID(site_id); + } - List groups = site.getGroups(); - if (groups == null) groups = new ArrayList(); + List groups = site.getGroups(); + if (groups == null) groups = new ArrayList(); - // Check the self-consistency of the residue reference from auth_seq_id and chain_id - if (!comp_id.equals(g.getPDBName())) { + // Check the self-consistency of the residue reference from auth_seq_id and chain_id + if (!comp_id.equals(g.getPDBName())) { logger.warn("comp_id doesn't match the residue at " + authId + " " + auth_seq_id + " - skipping"); - } else { - groups.add(g); - site.setGroups(groups); + } else { + groups.add(g); + site.setGroups(groups); + } + if (addSite) sites.add(site); } - if (addSite) sites.add(site); - } } structure.setSites(sites); } diff --git a/pom.xml b/pom.xml index 1cfcaedd38..83082896ee 100644 --- a/pom.xml +++ b/pom.xml @@ -32,6 +32,7 @@ + 1.8 1.8 UTF-8 @@ -171,7 +172,7 @@ maven-dependency-plugin - 3.0.2 + 3.1.1 maven-jar-plugin @@ -179,11 +180,11 @@ there are some config changes required. see https://github.com/biojava/biojava/issues/531 --> - 3.0.2 + 3.1.0 maven-scm-plugin - 1.9.5 + 1.10.0 maven-source-plugin @@ -191,7 +192,7 @@ maven-failsafe-plugin - 2.21.0 + 2.22.0 net.sf @@ -201,7 +202,7 @@ org.jvnet.jaxb2.maven2 maven-jaxb2-plugin - 0.13.1 + 0.14.0 org.apache.maven.plugins @@ -224,7 +225,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.0.0 + 3.0.1 -Xdoclint:none @@ -242,7 +243,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.1.0 + 3.1.1 maven-assembly-plugin @@ -280,18 +281,18 @@ org.apache.maven.plugins maven-checkstyle-plugin - 2.17 + 3.0.0 org.apache.maven.plugins maven-resources-plugin - 3.0.2 + 3.1.0 maven-enforcer-plugin - 3.0.0-M1 + 3.0.0-M2 enforce-java @@ -316,12 +317,12 @@ org.apache.maven.plugins maven-surefire-plugin - 2.21.0 + 2.22.0 org.apache.maven.plugins maven-site-plugin - 3.7 + 3.7.1 @@ -507,6 +508,26 @@ forester 1.038 + + javax.xml.bind + jaxb-api + 2.3.0 + + + com.sun.xml.bind + jaxb-core + 2.3.0 + + + com.sun.xml.bind + jaxb-impl + 2.3.0 + + + javax.activation + activation + 1.1.1 + @@ -518,7 +539,7 @@ true true true - 1.8 + ${jdk.version} false true