X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2Fxdb%2Fembl%2FEmblEntry.java;h=0cee0b410a2bfc81cd4373ee406d05afc1085fee;hb=2253f31565d4e96edffce2fac596e2ef0578d596;hp=73ffeefecaa92eae801aff1eca7ade7888e1e997;hpb=d1f6cf53b29322601c621da9a6b3cb09dd28235e;p=jalview.git diff --git a/src/jalview/datamodel/xdb/embl/EmblEntry.java b/src/jalview/datamodel/xdb/embl/EmblEntry.java index 73ffeef..0cee0b4 100644 --- a/src/jalview/datamodel/xdb/embl/EmblEntry.java +++ b/src/jalview/datamodel/xdb/embl/EmblEntry.java @@ -67,7 +67,7 @@ public class EmblEntry /** * @param accession - * the accession to set + * the accession to set */ public void setAccession(String accession) { @@ -84,7 +84,7 @@ public class EmblEntry /** * @param dbRefs - * the dbRefs to set + * the dbRefs to set */ public void setDbRefs(Vector dbRefs) { @@ -101,7 +101,7 @@ public class EmblEntry /** * @param desc - * the desc to set + * the desc to set */ public void setDesc(String desc) { @@ -118,7 +118,7 @@ public class EmblEntry /** * @param features - * the features to set + * the features to set */ public void setFeatures(Vector features) { @@ -135,7 +135,7 @@ public class EmblEntry /** * @param keywords - * the keywords to set + * the keywords to set */ public void setKeywords(Vector keywords) { @@ -152,7 +152,7 @@ public class EmblEntry /** * @param lastUpdated - * the lastUpdated to set + * the lastUpdated to set */ public void setLastUpdated(String lastUpdated) { @@ -169,7 +169,7 @@ public class EmblEntry /** * @param refs - * the refs to set + * the refs to set */ public void setRefs(Vector refs) { @@ -186,7 +186,7 @@ public class EmblEntry /** * @param releaseCreated - * the releaseCreated to set + * the releaseCreated to set */ public void setRcreated(String releaseCreated) { @@ -203,7 +203,7 @@ public class EmblEntry /** * @param releaseLastUpdated - * the releaseLastUpdated to set + * the releaseLastUpdated to set */ public void setRLastUpdated(String releaseLastUpdated) { @@ -220,7 +220,7 @@ public class EmblEntry /** * @param sequence - * the sequence to set + * the sequence to set */ public void setSequence(EmblSequence sequence) { @@ -237,7 +237,7 @@ public class EmblEntry /** * @param taxDivision - * the taxDivision to set + * the taxDivision to set */ public void setTaxDivision(String taxDivision) { @@ -254,7 +254,7 @@ public class EmblEntry /** * @param version - * the version to set + * the version to set */ public void setVersion(String version) { @@ -396,21 +396,24 @@ public class EmblEntry * Recover annotated sequences from EMBL file * * @param noNa - * don't return nucleic acid sequences + * don't return nucleic acid sequences * @param sourceDb - * TODO + * TODO * @param noProtein - * don't return any translated protein sequences marked in features + * don't return any translated protein sequences marked in + * features * @return dataset sequences with DBRefs and features - DNA always comes first */ public jalview.datamodel.SequenceI[] getSequences(boolean noNa, boolean noPeptide, String sourceDb) - { //TODO: ensure emblEntry.getSequences behaves correctly for returning all cases of noNa and noPeptide + { // TODO: ensure emblEntry.getSequences behaves correctly for returning all + // cases of noNa and noPeptide Vector seqs = new Vector(); Sequence dna = null; if (!noNa) { - // In theory we still need to create this if noNa is set to avoid a null pointer exception + // In theory we still need to create this if noNa is set to avoid a null + // pointer exception dna = new Sequence(sourceDb + "|" + accession, sequence.getSequence()); dna.setDescription(desc); dna.addDBRef(new DBRefEntry(sourceDb, version, accession)); @@ -418,8 +421,8 @@ public class EmblEntry // TODO: transform EMBL Database refs to canonical form if (dbRefs != null) for (Iterator i = dbRefs.iterator(); i.hasNext(); dna - .addDBRef((DBRefEntry) i.next())) - ; + .addDBRef((DBRefEntry) i.next())) + ; } try { @@ -453,8 +456,7 @@ public class EmblEntry } } } - } - catch (Exception e) + } catch (Exception e) { System.err.println("EMBL Record Features parsing error!"); System.err @@ -477,14 +479,22 @@ public class EmblEntry } /** - * attempt to extract coding region and product from a feature and properly decorate it with annotations. - * @param feature coding feature - * @param sourceDb source database for the EMBLXML - * @param seqs place where sequences go - * @param dna parent dna sequence for this record - * @param noPeptide flag for generation of Peptide sequence objects + * attempt to extract coding region and product from a feature and properly + * decorate it with annotations. + * + * @param feature + * coding feature + * @param sourceDb + * source database for the EMBLXML + * @param seqs + * place where sequences go + * @param dna + * parent dna sequence for this record + * @param noPeptide + * flag for generation of Peptide sequence objects */ - private void parseCodingFeature(EmblFeature feature, String sourceDb, Vector seqs, Sequence dna, boolean noPeptide) + private void parseCodingFeature(EmblFeature feature, String sourceDb, + Vector seqs, Sequence dna, boolean noPeptide) { boolean isEmblCdna = sourceDb.equals(DBRefSource.EMBLCDS); // extract coding region(s) @@ -552,11 +562,11 @@ public class EmblEntry else { // throw anything else into the additional properties hash - String[] s= q.getValues(); + String[] s = q.getValues(); StringBuffer sb = new StringBuffer(); - if (s!=null) + if (s != null) { - for (int i=0; i 0) @@ -667,23 +679,26 @@ public class EmblEntry ref.setSource(jalview.util.DBRefUtils.getCanonicalName(ref .getSource())); // Hard code the kind of protein product accessions that EMBL cite - if (ref.getSource().equals( - jalview.datamodel.DBRefSource.UNIPROT)) + if (ref.getSource().equals(jalview.datamodel.DBRefSource.UNIPROT)) { ref.setMap(map); - if (map!=null && map.getTo()!=null) + if (map != null && map.getTo() != null) { - map.getTo().addDBRef(new DBRefEntry(ref.getSource(), ref.getVersion(), ref.getAccessionId())); // don't copy map over. - if (map.getTo().getName().indexOf(prid)==0) + map.getTo().addDBRef( + new DBRefEntry(ref.getSource(), ref.getVersion(), ref + .getAccessionId())); // don't copy map over. + if (map.getTo().getName().indexOf(prid) == 0) { - map.getTo().setName(jalview.datamodel.DBRefSource.UNIPROT+"|"+ref.getAccessionId()); + map.getTo().setName( + jalview.datamodel.DBRefSource.UNIPROT + "|" + + ref.getAccessionId()); } } } if (product != null) { DBRefEntry pref = new DBRefEntry(ref.getSource(), ref - .getVersion(), ref.getAccessionId()); + .getVersion(), ref.getAccessionId()); pref.setMap(null); // reference is direct product.addDBRef(pref); // Add converse mapping reference @@ -693,7 +708,7 @@ public class EmblEntry pref = new DBRefEntry(sourceDb, getVersion(), this .getAccession()); pref.setMap(pmap); - if (map.getTo()!=null) + if (map.getTo() != null) { map.getTo().addDBRef(pref); }