From: gmungoc Date: Fri, 10 Jul 2015 05:14:08 +0000 (+0100) Subject: JAL-1807 explicit imports (jalview.datamodel) X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ebadc5463ca35daa153cb20c3537db740fb5f707;p=jalview.git JAL-1807 explicit imports (jalview.datamodel) --- diff --git a/src/jalview/datamodel/AlignedCodonFrame.java b/src/jalview/datamodel/AlignedCodonFrame.java index eb977bc..e48e03a 100644 --- a/src/jalview/datamodel/AlignedCodonFrame.java +++ b/src/jalview/datamodel/AlignedCodonFrame.java @@ -20,12 +20,12 @@ */ package jalview.datamodel; -import java.util.ArrayList; -import java.util.List; - import jalview.util.MapList; import jalview.util.MappingUtils; +import java.util.ArrayList; +import java.util.List; + /** * Stores mapping between the columns of a protein alignment and a DNA alignment * and a list of individual codon to amino acid mappings between sequences. diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 81046f1..363ad0d 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -20,6 +20,11 @@ */ package jalview.datamodel; +import jalview.analysis.AlignmentUtils; +import jalview.io.FastaFile; +import jalview.util.Comparison; +import jalview.util.MessageManager; + import java.util.ArrayList; import java.util.Enumeration; import java.util.HashSet; @@ -30,10 +35,6 @@ import java.util.Map; import java.util.Set; import java.util.Vector; -import jalview.analysis.AlignmentUtils; -import jalview.io.FastaFile; -import jalview.util.MessageManager; - /** * Data structure to hold and manipulate a multiple sequence alignment */ @@ -73,7 +74,7 @@ public class Alignment implements AlignmentI { int i = 0; - if (jalview.util.Comparison.isNucleotide(seqs)) + if (Comparison.isNucleotide(seqs)) { type = NUCLEOTIDE; } @@ -339,7 +340,7 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) * - * @see jalview.datamodel.AlignmentI#findGroup(jalview.datamodel.SequenceI) + * @see AlignmentI#findGroup(jalview.datamodel.SequenceI) */ @Override public SequenceGroup findGroup(SequenceI s) @@ -363,7 +364,7 @@ public class Alignment implements AlignmentI * (non-Javadoc) * * @see - * jalview.datamodel.AlignmentI#findAllGroups(jalview.datamodel.SequenceI) + * AlignmentI#findAllGroups(jalview.datamodel.SequenceI) */ @Override public SequenceGroup[] findAllGroups(SequenceI s) @@ -527,7 +528,7 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) * - * @see jalview.datamodel.AlignmentI#findName(java.lang.String, boolean) + * @see AlignmentI#findName(java.lang.String, boolean) */ @Override public SequenceI findName(String token, boolean b) @@ -538,7 +539,7 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) * - * @see jalview.datamodel.AlignmentI#findName(SequenceI, java.lang.String, + * @see AlignmentI#findName(SequenceI, java.lang.String, * boolean) */ @Override @@ -610,7 +611,7 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) * - * @see jalview.datamodel.AlignmentI#findIndex(jalview.datamodel.SequenceI) + * @see AlignmentI#findIndex(jalview.datamodel.SequenceI) */ @Override public int findIndex(SequenceI s) @@ -634,7 +635,7 @@ public class Alignment implements AlignmentI * (non-Javadoc) * * @see - * jalview.datamodel.AlignmentI#findIndex(jalview.datamodel.SearchResults) + * AlignmentI#findIndex(jalview.datamodel.SearchResults) */ @Override public int findIndex(SearchResults results) @@ -718,7 +719,7 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) * - * @see jalview.datamodel.AlignmentI#isAligned() + * @see AlignmentI#isAligned() */ @Override public boolean isAligned() @@ -729,7 +730,7 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) * - * @see jalview.datamodel.AlignmentI#isAligned(boolean) + * @see AlignmentI#isAligned(boolean) */ @Override public boolean isAligned(boolean includeHidden) @@ -778,7 +779,7 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) * - * @seejalview.datamodel.AlignmentI#deleteAnnotation(jalview.datamodel. + * @seeAlignmentI#deleteAnnotation(jalview.datamodel. * AlignmentAnnotation) */ @Override @@ -852,7 +853,7 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) * - * @seejalview.datamodel.AlignmentI#addAnnotation(jalview.datamodel. + * @seeAlignmentI#addAnnotation(jalview.datamodel. * AlignmentAnnotation) */ @Override @@ -864,7 +865,7 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) * - * @seejalview.datamodel.AlignmentI#addAnnotation(jalview.datamodel. + * @seeAlignmentI#addAnnotation(jalview.datamodel. * AlignmentAnnotation, int) */ @Override @@ -1072,7 +1073,7 @@ public class Alignment implements AlignmentI for (int j = current.getLength(); j > maxLength; j--) { if (j > maxLength - && !jalview.util.Comparison.isGap(current.getCharAt(j))) + && !Comparison.isGap(current.getCharAt(j))) { maxLength = j; break; @@ -1128,7 +1129,7 @@ public class Alignment implements AlignmentI boolean hitres = false; for (int j = 0, rs = 0, ssiz = current.getLength(); j < ssiz; j++) { - if (!jalview.util.Comparison.isGap(current.getCharAt(j))) + if (!Comparison.isGap(current.getCharAt(j))) { if (!hitres) { @@ -1264,7 +1265,7 @@ public class Alignment implements AlignmentI * (non-Javadoc) * * @see - * jalview.datamodel.AlignmentI#addCodonFrame(jalview.datamodel.AlignedCodonFrame + * AlignmentI#addCodonFrame(jalview.datamodel.AlignedCodonFrame * ) */ @Override @@ -1280,7 +1281,7 @@ public class Alignment implements AlignmentI * (non-Javadoc) * * @see - * jalview.datamodel.AlignmentI#getCodonFrame(jalview.datamodel.SequenceI) + * AlignmentI#getCodonFrame(jalview.datamodel.SequenceI) */ @Override public List getCodonFrame(SequenceI seq) @@ -1303,7 +1304,7 @@ public class Alignment implements AlignmentI /** * Sets the codon frame mappings (replacing any existing mappings). * - * @see jalview.datamodel.AlignmentI#setCodonFrames() + * @see AlignmentI#setCodonFrames() */ @Override public void setCodonFrames(Set acfs) @@ -1315,7 +1316,7 @@ public class Alignment implements AlignmentI * Returns the set of codon frame mappings. Any changes to the returned set * will affect the alignment. * - * @see jalview.datamodel.AlignmentI#getCodonFrames() + * @see AlignmentI#getCodonFrames() */ @Override public Set getCodonFrames() @@ -1326,7 +1327,7 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) * - * @seejalview.datamodel.AlignmentI#removeCodonFrame(jalview.datamodel. + * @seeAlignmentI#removeCodonFrame(jalview.datamodel. * AlignedCodonFrame) */ @Override diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index 322fd54..f6b633c 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -20,6 +20,11 @@ */ package jalview.datamodel; +import jalview.analysis.Rna; +import jalview.analysis.SecStrConsensus.SimpleBP; +import jalview.analysis.WUSSParseException; +import jalview.schemes.ResidueProperties; + import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -28,10 +33,6 @@ import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; -import jalview.analysis.Rna; -import jalview.analysis.SecStrConsensus.SimpleBP; -import jalview.analysis.WUSSParseException; - /** * DOCUMENT ME! * @@ -417,9 +418,9 @@ public class AlignmentAnnotation && firstChar != 'Y' && firstChar != 'Z' && firstChar != '-' - && firstChar < jalview.schemes.ResidueProperties.aaIndex.length) + && firstChar < ResidueProperties.aaIndex.length) { - if (jalview.schemes.ResidueProperties.aaIndex[firstChar] < 23) // TODO: + if (ResidueProperties.aaIndex[firstChar] < 23) // TODO: // parameterise // to // gap diff --git a/src/jalview/datamodel/AlignmentView.java b/src/jalview/datamodel/AlignmentView.java index b36a0a5..5457fbc 100644 --- a/src/jalview/datamodel/AlignmentView.java +++ b/src/jalview/datamodel/AlignmentView.java @@ -109,7 +109,7 @@ public class AlignmentView boolean recordGroups) { // refactored from AlignViewport.getAlignmentView(selectedOnly); - this(new jalview.datamodel.CigarArray(alignment, + this(new CigarArray(alignment, (hasHiddenColumns ? columnSelection : null), (selectedRegionOnly ? selection : null)), (selectedRegionOnly && selection != null) ? selection diff --git a/src/jalview/datamodel/Mapping.java b/src/jalview/datamodel/Mapping.java index d7b7eb9..5a31d68 100644 --- a/src/jalview/datamodel/Mapping.java +++ b/src/jalview/datamodel/Mapping.java @@ -20,12 +20,12 @@ */ package jalview.datamodel; +import jalview.util.MapList; + import java.util.Iterator; import java.util.NoSuchElementException; import java.util.Vector; -import jalview.util.MapList; - public class Mapping { /** diff --git a/src/jalview/datamodel/SeqCigar.java b/src/jalview/datamodel/SeqCigar.java index 09b2e89..b6c8cdc 100644 --- a/src/jalview/datamodel/SeqCigar.java +++ b/src/jalview/datamodel/SeqCigar.java @@ -20,14 +20,15 @@ */ package jalview.datamodel; -import java.util.Enumeration; -import java.util.Hashtable; - import jalview.analysis.AlignSeq; import jalview.analysis.SeqsetUtils; +import jalview.util.Comparison; import jalview.util.MessageManager; import jalview.util.ShiftList; +import java.util.Enumeration; +import java.util.Hashtable; + public class SeqCigar extends CigarSimple { /** @@ -165,7 +166,7 @@ public class SeqCigar extends CigarSimple { // make a new dataset sequence String ungapped = AlignSeq.extractGaps( - jalview.util.Comparison.GapChars, new String(seq_string)); + Comparison.GapChars, new String(seq_string)); l_ungapped = ungapped.length(); // check that we haven't just duplicated an ungapped sequence. if (l_ungapped == seq.getLength()) @@ -318,7 +319,7 @@ public class SeqCigar extends CigarSimple while (p <= endpos) { - boolean isGap = (p < res) ? jalview.util.Comparison.isGap(seq + boolean isGap = (p < res) ? Comparison.isGap(seq .getCharAt(p)) : true; if ((startpos <= p) && (p <= endpos)) { diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index c78ec22..e1f9d00 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -21,6 +21,8 @@ package jalview.datamodel; import jalview.analysis.AlignSeq; +import jalview.schemes.ResidueProperties; +import jalview.util.Comparison; import jalview.util.StringUtils; import java.util.ArrayList; @@ -28,6 +30,8 @@ import java.util.Enumeration; import java.util.List; import java.util.Vector; +import com.stevesoft.pat.Regex; + import fr.orsay.lri.varna.models.rna.RNA; /** @@ -119,10 +123,9 @@ public class Sequence extends ASequence implements SequenceI checkValidRange(); } - com.stevesoft.pat.Regex limitrx = new com.stevesoft.pat.Regex( - "[/][0-9]{1,}[-][0-9]{1,}$"); + Regex limitrx = new Regex("[/][0-9]{1,}[-][0-9]{1,}$"); - com.stevesoft.pat.Regex endrx = new com.stevesoft.pat.Regex("[0-9]{1,}$"); + Regex endrx = new Regex("[0-9]{1,}$"); void parseId() { @@ -151,7 +154,7 @@ public class Sequence extends ASequence implements SequenceI int endRes = 0; for (int j = 0; j < sequence.length; j++) { - if (!jalview.util.Comparison.isGap(sequence[j])) + if (!Comparison.isGap(sequence[j])) { endRes++; } @@ -643,7 +646,7 @@ public class Sequence extends ASequence implements SequenceI // Rely on end being at least as long as the length of the sequence. while ((i < sequence.length) && (j <= end) && (j <= pos)) { - if (!jalview.util.Comparison.isGap(sequence[i])) + if (!Comparison.isGap(sequence[i])) { j++; } @@ -669,7 +672,7 @@ public class Sequence extends ASequence implements SequenceI int seqlen = sequence.length; while ((j < i) && (j < seqlen)) { - if (!jalview.util.Comparison.isGap(sequence[j])) + if (!Comparison.isGap(sequence[j])) { pos++; } @@ -689,15 +692,15 @@ public class Sequence extends ASequence implements SequenceI */ public int[] gapMap() { - String seq = jalview.analysis.AlignSeq.extractGaps( - jalview.util.Comparison.GapChars, new String(sequence)); + String seq = AlignSeq.extractGaps( + Comparison.GapChars, new String(sequence)); int[] map = new int[seq.length()]; int j = 0; int p = 0; while (j < sequence.length) { - if (!jalview.util.Comparison.isGap(sequence[j])) + if (!Comparison.isGap(sequence[j])) { map[p++] = j; } @@ -718,7 +721,7 @@ public class Sequence extends ASequence implements SequenceI while ((j < seqlen)) { map[j] = pos; - if (!jalview.util.Comparison.isGap(sequence[j])) + if (!Comparison.isGap(sequence[j])) { pos++; } @@ -737,7 +740,7 @@ public class Sequence extends ASequence implements SequenceI int seqlen = sequence.length; while ((j < seqlen)) { - if (jalview.util.Comparison.isGap(sequence[j])) + if (Comparison.isGap(sequence[j])) { if (lastj == -1) { @@ -781,7 +784,7 @@ public class Sequence extends ASequence implements SequenceI boolean ecalc = false, scalc = false; for (int s = i; s < j; s++) { - if (jalview.schemes.ResidueProperties.aaIndex[sequence[s]] != 23) + if (ResidueProperties.aaIndex[sequence[s]] != 23) { if (createNewDs) { @@ -1001,7 +1004,7 @@ public class Sequence extends ASequence implements SequenceI } for (int i = 0; i < sequence.length; i++) { - if (jalview.util.Comparison.isGap(sequence[i])) + if (Comparison.isGap(sequence[i])) { return false; } @@ -1030,7 +1033,7 @@ public class Sequence extends ASequence implements SequenceI // Create a new, valid dataset sequence SequenceI ds = seq; ds.setSequence(AlignSeq.extractGaps( - jalview.util.Comparison.GapChars, new String(sequence))); + Comparison.GapChars, new String(sequence))); setDatasetSequence(ds); ds.setSequenceFeatures(getSequenceFeatures()); seq = this; // and return this sequence as the derived sequence. @@ -1049,7 +1052,7 @@ public class Sequence extends ASequence implements SequenceI if (datasetSequence == null) { datasetSequence = new Sequence(getName(), AlignSeq.extractGaps( - jalview.util.Comparison.GapChars, getSequenceAsString()), + Comparison.GapChars, getSequenceAsString()), getStart(), getEnd()); datasetSequence.setSequenceFeatures(getSequenceFeatures()); datasetSequence.setDescription(getDescription()); diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index 3439248..2fe03e1 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -20,6 +20,12 @@ */ package jalview.datamodel; +import jalview.analysis.AAFrequency; +import jalview.analysis.Conservation; +import jalview.schemes.ColourSchemeI; +import jalview.schemes.ResidueProperties; +import jalview.util.Comparison; + import java.awt.Color; import java.util.ArrayList; import java.util.Hashtable; @@ -27,11 +33,6 @@ import java.util.List; import java.util.Map; import java.util.Vector; -import jalview.analysis.AAFrequency; -import jalview.analysis.Conservation; -import jalview.schemes.ColourSchemeI; -import jalview.schemes.ResidueProperties; - /** * Collects a set contiguous ranges on a set of sequences * @@ -280,7 +281,7 @@ public class SequenceGroup implements AnnotatedCollectionI for (int j = 0; j < endRes + 1 && j < seq.getLength(); j++) { ch = seq.getCharAt(j); - if (!jalview.util.Comparison.isGap((ch))) + if (!Comparison.isGap((ch))) { eres++; } diff --git a/src/jalview/datamodel/xdb/embl/EmblEntry.java b/src/jalview/datamodel/xdb/embl/EmblEntry.java index 9c9447e..4241990 100644 --- a/src/jalview/datamodel/xdb/embl/EmblEntry.java +++ b/src/jalview/datamodel/xdb/embl/EmblEntry.java @@ -27,6 +27,8 @@ import jalview.datamodel.Mapping; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.util.DBRefUtils; +import jalview.util.MapList; import java.util.Hashtable; import java.util.Map.Entry; @@ -392,7 +394,7 @@ public class EmblEntry * 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, + public SequenceI[] getSequences(boolean noNa, boolean noPeptide, String sourceDb) { // TODO: ensure emblEntry.getSequences behaves correctly for returning all // cases of noNa and noPeptide @@ -496,7 +498,7 @@ public class EmblEntry { boolean isEmblCdna = sourceDb.equals(DBRefSource.EMBLCDS); // extract coding region(s) - jalview.datamodel.Mapping map = null; + Mapping map = null; int[] exon = null; if (feature.locations != null) { @@ -601,7 +603,7 @@ public class EmblEntry // marked. exon = new int[] { dna.getStart() + (prstart - 1), dna.getEnd() }; - map = new jalview.datamodel.Mapping(product, exon, new int[] + map = new Mapping(product, exon, new int[] { 1, prseq.length() }, 3, 1); } if ((prseq.length() + 1) * 3 == (1 - prstart + dna.getSequence().length)) @@ -610,7 +612,7 @@ public class EmblEntry .println("Allowing for additional stop codon at end of cDNA fragment... will probably cause an error in VAMSAs!"); exon = new int[] { dna.getStart() + (prstart - 1), dna.getEnd() - 3 }; - map = new jalview.datamodel.Mapping(product, exon, new int[] + map = new Mapping(product, exon, new int[] { 1, prseq.length() }, 3, 1); } } @@ -631,7 +633,7 @@ public class EmblEntry { // final product length trunctation check - map = new jalview.datamodel.Mapping(product, + map = new Mapping(product, adjustForProteinLength(prseq.length(), exon), new int[] { 1, prseq.length() }, 3, 1); // reconstruct the EMBLCDS entry @@ -641,7 +643,7 @@ public class EmblEntry pcdnaref.setAccessionId(prid); pcdnaref.setSource(DBRefSource.EMBLCDS); pcdnaref.setVersion(getVersion()); // same as parent EMBL version. - jalview.util.MapList mp = new jalview.util.MapList(new int[] + MapList mp = new MapList(new int[] { 1, prseq.length() }, new int[] { 1 + (prstart - 1), (prstart - 1) + 3 * prseq.length() }, 1, 3); // { 1 + (prstart - 1) * 3, @@ -686,10 +688,10 @@ public class EmblEntry { for (DBRefEntry ref : feature.dbRefs) { - ref.setSource(jalview.util.DBRefUtils.getCanonicalName(ref + ref.setSource(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(DBRefSource.UNIPROT)) { ref.setMap(map); if (map != null && map.getTo() != null) @@ -700,7 +702,7 @@ public class EmblEntry if (map.getTo().getName().indexOf(prid) == 0) { map.getTo().setName( - jalview.datamodel.DBRefSource.UNIPROT + "|" + DBRefSource.UNIPROT + "|" + ref.getAccessionId()); } } diff --git a/src/jalview/datamodel/xdb/embl/EmblFeatureLocations.java b/src/jalview/datamodel/xdb/embl/EmblFeatureLocations.java index eb0bee7..4f9e5fa 100644 --- a/src/jalview/datamodel/xdb/embl/EmblFeatureLocations.java +++ b/src/jalview/datamodel/xdb/embl/EmblFeatureLocations.java @@ -20,6 +20,8 @@ */ package jalview.datamodel.xdb.embl; +import jalview.bin.Cache; + import java.util.Vector; /** @@ -150,9 +152,9 @@ public class EmblFeatureLocations } else if (locationType != null) { - if (jalview.bin.Cache.log != null) + if (Cache.log != null) { - jalview.bin.Cache.log + Cache.log .error("EmbleFeatureLocations.getElementRanges cannot deal with locationType=='" + locationType + "'"); } diff --git a/src/jalview/datamodel/xdb/embl/EmblFile.java b/src/jalview/datamodel/xdb/embl/EmblFile.java index 2129054..f3475d7 100644 --- a/src/jalview/datamodel/xdb/embl/EmblFile.java +++ b/src/jalview/datamodel/xdb/embl/EmblFile.java @@ -20,6 +20,8 @@ */ package jalview.datamodel.xdb.embl; +import jalview.bin.Cache; + import java.io.File; import java.io.FileReader; import java.io.PrintWriter; @@ -116,11 +118,11 @@ public class EmblFile try { // uncomment to DEBUG EMBLFile reading - if (jalview.bin.Cache.getDefault( - jalview.bin.Cache.CASTORLOGLEVEL, "debug") + if (Cache.getDefault( + Cache.CASTORLOGLEVEL, "debug") .equalsIgnoreCase("DEBUG")) { - unmar.setDebug(jalview.bin.Cache.log.isDebugEnabled()); + unmar.setDebug(Cache.log.isDebugEnabled()); } } catch (Exception e) {