import jalview.datamodel.AlignmentView;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
+import jalview.gui.OOMWarning;
import jalview.gui.WebserviceInfo;
import jalview.util.MessageManager;
import jalview.viewmodel.seqfeatures.FeatureRendererSettings;
throw (new Exception(
"Timed out when communicating with server\nTry again later.\n"));
}
- jalview.bin.Cache.log.debug("Job " + j + " Result state "
+ Cache.log.debug("Job " + j + " Result state "
+ jobs[j].getState() + "(ServerError="
+ jobs[j].isServerError() + ")");
} catch (Exception ex)
WebserviceInfo.STATE_STOPPED_ERROR);
Cache.log.error("Out of memory when retrieving Job " + j
+ " id:" + WsUrl + "/" + jobs[j].jobId, er);
- new jalview.gui.OOMWarning("retrieving result for "
- + WebServiceName, er);
+ new OOMWarning("retrieving result for " + WebServiceName, er);
System.gc();
}
}
Cache.log
.debug("WebServiceJob poll loop finished with no jobs created.");
wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR);
- wsInfo.appendProgressText(MessageManager.getString("info.no_jobs_ran"));
+ wsInfo.appendProgressText(MessageManager
+ .getString("info.no_jobs_ran"));
wsInfo.setFinishedNoResults();
}
}
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
import jalview.gui.CutAndPasteTransfer;
+import jalview.gui.DasSourceBrowser;
import jalview.gui.Desktop;
import jalview.gui.IProgressIndicator;
import jalview.gui.OOMWarning;
+import jalview.util.DBRefUtils;
import jalview.util.MessageManager;
import jalview.ws.dbsources.das.api.jalviewSourceI;
+import jalview.ws.dbsources.das.datamodel.DasSequenceSource;
import jalview.ws.seqfetcher.DbSourceProxy;
import java.util.ArrayList;
import java.util.Vector;
import uk.ac.ebi.picr.model.UPEntry;
+import uk.ac.ebi.www.picr.AccessionMappingService.AccessionMapperInterface;
+import uk.ac.ebi.www.picr.AccessionMappingService.AccessionMapperServiceLocator;
/**
* Implements a runnable for validating a sequence against external databases
/**
* picr client instance
*/
- uk.ac.ebi.www.picr.AccessionMappingService.AccessionMapperInterface picrClient = null;
+ AccessionMapperInterface picrClient = null;
// /This will be a collection of Vectors of sequenceI refs.
// The key will be the seq name or accession id of the seq
{
alseqs[i] = seqs[i];
if (seqs[i].getDatasetSequence() != null)
+ {
ds[i] = seqs[i].getDatasetSequence();
+ }
else
+ {
ds[i] = seqs[i];
+ }
}
this.dataset = ds;
// TODO Jalview 2.5 lots of this code should be in the gui package!
{
// af.featureSettings_actionPerformed(null);
String[] defdb = null, otherdb = sfetcher
- .getDbInstances(jalview.ws.dbsources.das.datamodel.DasSequenceSource.class);
+ .getDbInstances(DasSequenceSource.class);
List<DbSourceProxy> selsources = new ArrayList<DbSourceProxy>();
Vector dasselsrc = (af.featureSettings != null) ? af.featureSettings
- .getSelectedSources() : new jalview.gui.DasSourceBrowser()
+ .getSelectedSources() : new DasSourceBrowser()
.getSelectedSources();
Enumeration<jalviewSourceI> en = dasselsrc.elements();
while (en.hasMoreElements())
}
// append additional sources
DbSourceProxy[] otherdb = sfetcher
- .getDbSourceProxyInstances(jalview.ws.dbsources.das.datamodel.DasSequenceSource.class);
+ .getDbSourceProxyInstances(DasSequenceSource.class);
if (otherdb != null && otherdb.length > 0)
{
DbSourceProxy[] newsrc = new DbSourceProxy[dbSources.length
{
if (Cache.getDefault("DBREFFETCH_USEPICR", false))
{
- picrClient = new uk.ac.ebi.www.picr.AccessionMappingService.AccessionMapperServiceLocator()
+ picrClient = new AccessionMapperServiceLocator()
.getAccessionMapperPort();
}
} catch (Exception e)
int seqIndex = 0;
- jalview.ws.seqfetcher.DbSourceProxy dbsource = dbSources[db];
+ DbSourceProxy dbsource = dbSources[db];
{
// for moment, we dumbly iterate over all retrieval sources for a
// particular database
AlignmentI retrieved = null;
try
{
- if (jalview.bin.Cache.log.isDebugEnabled())
+ if (Cache.log.isDebugEnabled())
{
- jalview.bin.Cache.log.debug("Querying "
+ Cache.log.debug("Querying "
+ dbsource.getDbName() + " with : '"
+ queryString.toString() + "'");
}
for (int i = 0; (seqIndex < dataset.length) && (i < 50); seqIndex++, i++)
{
SequenceI sequence = dataset[seqIndex];
- DBRefEntry[] uprefs = jalview.util.DBRefUtils.selectRefs(
+ DBRefEntry[] uprefs = DBRefUtils.selectRefs(
sequence.getDBRef(), new String[]
{ dbsource.getDbSource() }); // jalview.datamodel.DBRefSource.UNIPROT
// });
// taking into account all accessionIds and names in the file
Vector sequenceMatches = new Vector();
// look for corresponding accession ids
- DBRefEntry[] entryRefs = jalview.util.DBRefUtils.selectRefs(
+ DBRefEntry[] entryRefs = DBRefUtils.selectRefs(
entry.getDBRef(), new String[]
{ dbSource });
if (entryRefs == null)
int absStart = entrySeq.indexOf(nonGapped);
int mapStart = entry.getStart();
- jalview.datamodel.Mapping mp;
+ Mapping mp;
if (absStart == -1)
{
{
nseq.addElement(sequencesArray[i]);
DBRefEntry dbr[] = sequencesArray[i].getDBRef();
- jalview.datamodel.Mapping map = null;
+ Mapping map = null;
for (int r = 0; (dbr != null) && r < dbr.length; r++)
{
if ((map = dbr[r].getMap()) != null)
import jalview.bin.Cache;
import jalview.datamodel.DBRefEntry;
+import jalview.datamodel.DBRefSource;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
import jalview.gui.Desktop;
import jalview.gui.FeatureSettings;
+import jalview.util.DBRefUtils;
import jalview.util.MessageManager;
import jalview.util.UrlLink;
import jalview.ws.dbsources.das.api.DasSourceRegistryI;
{
for (int j = 0; j < dbref.length; j++)
{
- if (dbref[j].getSource().equals(
- jalview.datamodel.DBRefSource.UNIPROT))
+ if (dbref[j].getSource().equals(DBRefSource.UNIPROT))
{
refCount++;
break;
{
jalviewSourceI[] sources = sourceRegistry.getSources().toArray(
new jalviewSourceI[0]);
- String active = jalview.bin.Cache.getDefault("DAS_ACTIVE_SOURCE",
+ String active = Cache.getDefault("DAS_ACTIVE_SOURCE",
"uniprot");
StringTokenizer st = new StringTokenizer(active, "\t");
selectedSources = new Vector();
{
return null;
}
- DBRefEntry[] uprefs = jalview.util.DBRefUtils.selectRefs(
+ DBRefEntry[] uprefs = DBRefUtils.selectRefs(
seq.getDBRef(), new String[]
{
// jalview.datamodel.DBRefSource.PDB,
- jalview.datamodel.DBRefSource.UNIPROT,
+ DBRefSource.UNIPROT,
// jalview.datamodel.DBRefSource.EMBL - not tested on any EMBL coord
// sys sources
});
for (COORDINATES csys : dasSource.getVersion().getCOORDINATES())
{
- if (jalview.util.DBRefUtils.isDasCoordinateSystem(
+ if (DBRefUtils.isDasCoordinateSystem(
csys.getAuthority(), uprefs[j]))
{
debug("Launched fetcher for coordinate system "
*/
package jalview.ws;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Vector;
-
+import jalview.analysis.CrossRef;
+import jalview.bin.Cache;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefSource;
import jalview.datamodel.SequenceI;
+import jalview.util.QuickSort;
+import jalview.ws.dbsources.EmblCdsSouce;
+import jalview.ws.dbsources.EmblSource;
+import jalview.ws.dbsources.Pdb;
+import jalview.ws.dbsources.PfamFull;
+import jalview.ws.dbsources.PfamSeed;
+import jalview.ws.dbsources.RfamFull;
+import jalview.ws.dbsources.RfamSeed;
+import jalview.ws.dbsources.Uniprot;
+import jalview.ws.dbsources.UnprotName;
import jalview.ws.dbsources.das.api.jalviewSourceI;
+import jalview.ws.dbsources.das.datamodel.DasSequenceSource;
import jalview.ws.seqfetcher.ASequenceFetcher;
import jalview.ws.seqfetcher.DbSourceProxy;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Vector;
+
/**
* This is the the concrete implementation of the sequence retrieval interface
* and abstract class in jalview.ws.seqfetcher. This implements the run-time
public SequenceFetcher(boolean addDas)
{
- addDBRefSourceImpl(jalview.ws.dbsources.EmblSource.class);
- addDBRefSourceImpl(jalview.ws.dbsources.EmblCdsSouce.class);
- addDBRefSourceImpl(jalview.ws.dbsources.Uniprot.class);
- addDBRefSourceImpl(jalview.ws.dbsources.UnprotName.class);
- addDBRefSourceImpl(jalview.ws.dbsources.Pdb.class);
- addDBRefSourceImpl(jalview.ws.dbsources.PfamFull.class);
- addDBRefSourceImpl(jalview.ws.dbsources.PfamSeed.class);
+ addDBRefSourceImpl(EmblSource.class);
+ addDBRefSourceImpl(EmblCdsSouce.class);
+ addDBRefSourceImpl(Uniprot.class);
+ addDBRefSourceImpl(UnprotName.class);
+ addDBRefSourceImpl(Pdb.class);
+ addDBRefSourceImpl(PfamFull.class);
+ addDBRefSourceImpl(PfamSeed.class);
// ensures Seed alignment is 'default' for PFAM
- addDBRefSourceImpl(jalview.ws.dbsources.RfamFull.class);
- addDBRefSourceImpl(jalview.ws.dbsources.RfamSeed.class);
+ addDBRefSourceImpl(RfamFull.class);
+ addDBRefSourceImpl(RfamSeed.class);
if (addDas)
{
registerDasSequenceSources();
else
{
nm = dbs.getDbName();
- if (getSourceProxy(srcs[i]) instanceof jalview.ws.dbsources.das.datamodel.DasSequenceSource)
+ if (getSourceProxy(srcs[i]) instanceof DasSequenceSource)
{
if (nm.startsWith("das:"))
{
{
tosort[j] = tosort[j].toLowerCase();
}
- jalview.util.QuickSort.sort(tosort, sorted);
+ QuickSort.sort(tosort, sorted);
// construct array with all sources listed
srcs = new String[sorted.length + dassrc.size()];
{
tosort[j] = tosort[j].toLowerCase();
}
- jalview.util.QuickSort.sort(tosort, sorted);
+ QuickSort.sort(tosort, sorted);
for (int j = sorted.length - 1; j >= 0; j--, i++)
{
srcs[i] = sorted[j];
for (DbSourceProxy dbs : getSourceProxy(srcs[i]))
{
String nm = dbs.getDbName();
- if (getSourceProxy(srcs[i]) instanceof jalview.ws.dbsources.das.datamodel.DasSequenceSource)
+ if (getSourceProxy(srcs[i]) instanceof DasSequenceSource)
{
if (nm.startsWith("das:"))
{
{
tosort[j] = ((String[]) sorted[j])[1];
}
- jalview.util.QuickSort.sort(tosort, sorted);
+ QuickSort.sort(tosort, sorted);
int i = 0;
// construct array with all sources listed
srcs = new String[sorted.length + dassrc.size()];
{
tosort[j] = ((String[]) sorted[j])[1];
}
- jalview.util.QuickSort.sort(tosort, sorted);
+ QuickSort.sort(tosort, sorted);
for (int j = sorted.length - 1; j >= 0; j--, i++)
{
srcs[i] = ((String[]) sorted[j])[0];
|| sp.getDbSourceProperties().containsKey(
DBRefSource.CODINGSEQDB);
// try and find products
- String types[] = jalview.analysis.CrossRef
- .findSequenceXrefTypes(dna, al.getSequencesArray());
+ String types[] = CrossRef.findSequenceXrefTypes(dna,
+ al.getSequencesArray());
if (types != null)
{
System.out.println("Xref Types for: "
for (int t = 0; t < types.length; t++)
{
System.out.println("Type: " + types[t]);
- SequenceI[] prod = jalview.analysis.CrossRef
+ SequenceI[] prod = CrossRef
.findXrefSequences(al.getSequencesArray(), dna,
types[t]).getSequencesArray();
System.out.println("Found "
// have a bash at finding the products amongst all the retrieved
// sequences.
SequenceI[] seqs = al.getSequencesArray();
- Alignment prodal = jalview.analysis.CrossRef.findXrefSequences(
+ Alignment prodal = CrossRef
+ .findXrefSequences(
seqs, dna, null, ds);
System.out.println("Found "
+ ((prodal == null) ? "no" : "" + prodal.getHeight())
public void registerDasSequenceSources()
{
// TODO: define a context as a registry provider (either desktop,
- // jalview.bin.cache, or something else).
- for (jalviewSourceI source : jalview.bin.Cache.getDasSourceRegistry()
+ // Cache, or something else).
+ for (jalviewSourceI source : Cache.getDasSourceRegistry()
.getSources())
{
if (source.isSequenceSource())
*/
package jalview.ws.dbsources;
-import com.stevesoft.pat.Regex;
-
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefSource;
import jalview.ws.seqfetcher.DbSourceProxy;
+import com.stevesoft.pat.Regex;
+
public class EmblCdsSouce extends EmblXmlSource implements DbSourceProxy
{
public Regex getAccessionValidator()
{
- return new com.stevesoft.pat.Regex("^[A-Z]+[0-9]+");
+ return new Regex("^[A-Z]+[0-9]+");
}
public String getDbSource()
*/
package jalview.ws.dbsources;
-import com.stevesoft.pat.Regex;
-
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefSource;
import jalview.ws.seqfetcher.DbSourceProxy;
+import com.stevesoft.pat.Regex;
+
/**
* @author JimP
*
*/
public Regex getAccessionValidator()
{
- return new com.stevesoft.pat.Regex("^[A-Z]+[0-9]+");
+ return new Regex("^[A-Z]+[0-9]+");
}
/*
import jalview.datamodel.DBRefSource;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
+import jalview.io.AppletFormatAdapter;
import jalview.io.FormatAdapter;
import jalview.util.MessageManager;
import jalview.ws.ebi.EBIFetchClient;
{
pdbfile = new FormatAdapter().readFile(file,
- jalview.io.AppletFormatAdapter.FILE, "PDB");
+ AppletFormatAdapter.FILE, "PDB");
if (pdbfile != null)
{
List<SequenceI> toremove = new ArrayList<SequenceI>();
|| chid.trim().equals(chain.trim()) || (chain
.trim().length() == 0 && chid.equals("_")))))
{
- pdbcs.setName(jalview.datamodel.DBRefSource.PDB + "|" + id
+ pdbcs.setName(DBRefSource.PDB + "|" + id
+ "|" + pdbcs.getName());
// Might need to add more metadata to the PDBEntry object
// like below
*/
package jalview.ws.dbsources;
-import com.stevesoft.pat.Regex;
-
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
+import jalview.datamodel.DBRefSource;
+import jalview.io.FormatAdapter;
import jalview.ws.seqfetcher.DbSourceProxy;
+import com.stevesoft.pat.Regex;
+
/**
* TODO: later PFAM is a complex datasource - it could return a tree in addition
* to an alignment TODO: create interface to pass alignment properties and tree
{
super();
// all extensions of this PFAM source base class are DOMAINDB sources
- addDbSourceProperty(jalview.datamodel.DBRefSource.DOMAINDB);
- addDbSourceProperty(jalview.datamodel.DBRefSource.ALIGNMENTDB);
+ addDbSourceProperty(DBRefSource.DOMAINDB);
+ addDbSourceProperty(DBRefSource.ALIGNMENTDB);
}
/*
* this doesn't work - DbSource is key for the hash of DbSourceProxy instances
* - 1:many mapping for DbSource to proxy will be lost. * suggest : PFAM is an
* 'alignment' source - means proxy is higher level than a sequence source.
- * return jalview.datamodel.DBRefSource.PFAM; }
+ * return DBRefSource.PFAM; }
*/
/*
// individual references to each sequence in each family alignment that's
// retrieved.
startQuery();
- AlignmentI rcds = new jalview.io.FormatAdapter().readFile(getXFAMURL()
- + queries.trim().toUpperCase(), jalview.io.FormatAdapter.URL,
+ AlignmentI rcds = new FormatAdapter().readFile(getXFAMURL()
+ + queries.trim().toUpperCase(), FormatAdapter.URL,
"STH");
for (int s = 0, sNum = rcds.getHeight(); s < sNum; s++)
{
rcds.getSequenceAt(s).addDBRef(
- new DBRefEntry(jalview.datamodel.DBRefSource.PFAM,
+new DBRefEntry(DBRefSource.PFAM,
// getDbSource(),
getDbVersion(), queries.trim().toUpperCase()));
- if (!getDbSource().equals(jalview.datamodel.DBRefSource.PFAM))
+ if (!getDbSource().equals(DBRefSource.PFAM))
{ // add the specific ref too
rcds.getSequenceAt(s).addDBRef(
new DBRefEntry(getDbSource(), getDbVersion(), queries
public String getXfamSource()
{
- return jalview.datamodel.DBRefSource.PFAM;
+ return DBRefSource.PFAM;
}
}
*/
package jalview.ws.dbsources;
+import jalview.datamodel.DBRefSource;
import jalview.ws.seqfetcher.DbSourceProxy;
/**
public String getDbSource()
{
- return jalview.datamodel.DBRefSource.PFAM; // archetype source
+ return DBRefSource.PFAM; // archetype source
}
public String getTestQuery()
*/
package jalview.ws.dbsources;
-import com.stevesoft.pat.Regex;
-
+import jalview.datamodel.DBRefSource;
import jalview.ws.seqfetcher.DbSourceProxy;
+import com.stevesoft.pat.Regex;
+
/**
* Contains methods for fetching sequences from Rfam database
*
{
super();
// all extensions of this RFAM source base class are DOMAINDB sources
- addDbSourceProperty(jalview.datamodel.DBRefSource.DOMAINDB);
- addDbSourceProperty(jalview.datamodel.DBRefSource.ALIGNMENTDB);
+ addDbSourceProperty(DBRefSource.DOMAINDB);
+ addDbSourceProperty(DBRefSource.ALIGNMENTDB);
}
/*
* this doesn't work - DbSource is key for the hash of DbSourceProxy instances
* - 1:many mapping for DbSource to proxy will be lost. * suggest : RFAM is an
* 'alignment' source - means proxy is higher level than a sequence source.
- * return jalview.datamodel.DBRefSource.RFAM; }
+ * return DBRefSource.RFAM; }
*/
/*
*/
public String getXfamSource()
{
- return jalview.datamodel.DBRefSource.RFAM;
+ return DBRefSource.RFAM;
}
}
*/
package jalview.ws.dbsources;
+import jalview.datamodel.DBRefSource;
+import jalview.ws.seqfetcher.DbSourceProxy;
+
/**
* Canonical Uniprot fetcher instance specifically retrieving UP_NAME
* references.
* @author JimP
*
*/
-public class UnprotName extends Uniprot implements
- jalview.ws.seqfetcher.DbSourceProxy
+public class UnprotName extends Uniprot implements DbSourceProxy
{
/*
*/
public String getDbSource()
{
- return jalview.datamodel.DBRefSource.UP_NAME;
+ return DBRefSource.UP_NAME;
}
}
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
+import jalview.io.FormatAdapter;
import jalview.ws.seqfetcher.DbSourceProxyImpl;
/**
// retrieved.
startQuery();
// TODO: trap HTTP 404 exceptions and return null
- AlignmentI rcds = new jalview.io.FormatAdapter().readFile(getXFAMURL()
- + queries.trim().toUpperCase(), jalview.io.FormatAdapter.URL,
+ AlignmentI rcds = new FormatAdapter().readFile(getXFAMURL()
+ + queries.trim().toUpperCase(), FormatAdapter.URL,
"STH");
for (int s = 0, sNum = rcds.getHeight(); s < sNum; s++)
{
*/
package jalview.ws.dbsources.das.datamodel;
+import jalview.bin.Cache;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.DBRefEntry;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceI;
+import jalview.util.MessageManager;
+import jalview.ws.DasSequenceFeatureFetcher;
+import jalview.ws.dbsources.das.api.jalviewSourceI;
+import jalview.ws.seqfetcher.DbSourceProxy;
+import jalview.ws.seqfetcher.DbSourceProxyImpl;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import com.stevesoft.pat.Regex;
-import jalview.util.MessageManager;
-import jalview.ws.dbsources.das.api.jalviewSourceI;
-import jalview.ws.seqfetcher.*;
-import jalview.bin.Cache;
-import jalview.datamodel.Alignment;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.DBRefEntry;
-import jalview.datamodel.Sequence;
-import jalview.datamodel.SequenceI;
-
/**
* an instance of this class is created for each unique DAS Sequence source (ie
* one capable of handling the 'sequence' for a particular MapMaster)
}
if (seqs == null || seqs.size() == 0)
+ {
return null;
+ }
SequenceI[] sqs = new SequenceI[seqs.size()];
for (int i = 0, iSize = seqs.size(); i < iSize; i++)
{
- sqs[i] = (SequenceI) seqs.elementAt(i);
+ sqs[i] = seqs.elementAt(i);
}
Alignment al = new Alignment(sqs);
if (jsrc.isFeatureSource())
srcs.addElement(jsrc);
try
{
- jalview.ws.DasSequenceFeatureFetcher dssf = new jalview.ws.DasSequenceFeatureFetcher(
+ DasSequenceFeatureFetcher dssf = new DasSequenceFeatureFetcher(
sqs, null, srcs, false, false, multiple);
while (dssf.isRunning())
{
public String getDasRegistryURL()
{
- String registry = jalview.bin.Cache.getDefault("DAS_REGISTRY_URL",
+ String registry = Cache.getDefault("DAS_REGISTRY_URL",
DEFAULT_REGISTRY);
if (registry.indexOf("/registry/das1/sources/") > -1)
{
- jalview.bin.Cache.setProperty(jalview.bin.Cache.DAS_REGISTRY_URL,
+ Cache.setProperty(Cache.DAS_REGISTRY_URL,
DEFAULT_REGISTRY);
registry = DEFAULT_REGISTRY;
}
if (registry.lastIndexOf("sources.xml") == registry.length() - 11)
{
// no trailing sources.xml document for registry in JDAS
- jalview.bin.Cache.setProperty(
- jalview.bin.Cache.DAS_REGISTRY_URL,
+ Cache.setProperty(
+ Cache.DAS_REGISTRY_URL,
registry = registry.substring(0,
registry.lastIndexOf("sources.xml")));
}
if (localSources == null)
{
// get local sources from properties and initialise the local source list
- String local = jalview.bin.Cache.getProperty("DAS_LOCAL_SOURCE");
+ String local = Cache.getProperty("DAS_LOCAL_SOURCE");
if (local != null)
{
localSources.remove(source.getTitle());
sourceNames.remove(source.getTitle());
dasSources.remove(source);
- jalview.bin.Cache.setProperty("DAS_LOCAL_SOURCE",
+ Cache.setProperty("DAS_LOCAL_SOURCE",
getLocalSourceString());
return true;
*/
package jalview.ws.dbsources.das.datamodel;
+import jalview.util.MessageManager;
+import jalview.util.QuickSort;
+import jalview.ws.dbsources.das.api.jalviewSourceI;
+import jalview.ws.seqfetcher.DbSourceProxy;
+
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import org.biodas.jdas.schema.sources.SOURCE;
import org.biodas.jdas.schema.sources.VERSION;
-import jalview.util.MessageManager;
-import jalview.ws.dbsources.das.api.jalviewSourceI;
-import jalview.ws.seqfetcher.DbSourceProxy;
-
public class JalviewSource implements jalviewSourceI
{
SOURCE source;
{
nm[i] = tsort[i].getDbName().toLowerCase();
}
- jalview.util.QuickSort.sort(nm, tsort);
+ QuickSort.sort(nm, tsort);
seqsources.clear();
for (DbSourceProxy ssrc : tsort)
{
*/
package jalview.ws.jws1;
+import jalview.bin.Cache;
+import jalview.gui.Desktop;
import jalview.util.MessageManager;
import java.util.Hashtable;
// timeout
} catch (Exception ex)
{
- jalview.bin.Cache.log
+ Cache.log
.error("Serious! Service location failed\nfor URL :" + WsURL
+ "\n", ex);
static private Vector getDiscoveryURLS()
{
Vector urls = new Vector();
- String RootServiceURLs = jalview.bin.Cache
+ String RootServiceURLs = Cache
.getDefault("DISCOVERY_URLS",
"http://www.compbio.dundee.ac.uk/JalviewWS/services/ServiceRegistry");
}
else
{
- jalview.bin.Cache.log
+ Cache.log
.info("Ignoring duplicate url in DISCOVERY_URLS list");
}
} catch (Exception ex)
{
- jalview.bin.Cache.log
+ Cache.log
.warn("Problem whilst trying to make a URL from '"
+ ((url != null) ? url : "<null>") + "'");
- jalview.bin.Cache.log
+ Cache.log
.warn("This was probably due to a malformed comma separated list"
+ " in the DISCOVERY_URLS entry of $(HOME)/.jalview_properties)");
- jalview.bin.Cache.log.debug("Exception was ", ex);
+ Cache.log.debug("Exception was ", ex);
}
}
} catch (Exception ex)
{
- jalview.bin.Cache.log
+ Cache.log
.warn("Error parsing comma separated list of urls in DISCOVERY_URLS.",
ex);
}
*/
static public void doDiscovery()
{
- jalview.bin.Cache.log
+ Cache.log
.debug("(Re)-Initialising the discovery URL list.");
try
{
- reallyDiscoverServices = jalview.bin.Cache.getDefault(
+ reallyDiscoverServices = Cache.getDefault(
"DISCOVERY_START", false);
if (reallyDiscoverServices)
{
}
else
{
- jalview.bin.Cache.log.debug("Setting default services");
+ Cache.log.debug("Setting default services");
services = new Hashtable();
// Muscle, Clustal and JPred.
ServiceHandle[] defServices =
ServiceHandles shs = null;
try
{
- jalview.bin.Cache.log.debug("Discovering services using " + location);
+ Cache.log.debug("Discovering services using " + location);
shs = locateWebService(location).getServices();
} catch (org.apache.axis.AxisFault f)
{
// JBPNote - should do this a better way!
if (f.getFaultReason().indexOf("(407)") > -1)
{
- if (jalview.gui.Desktop.desktop != null)
+ if (Desktop.desktop != null)
{
- JOptionPane
- .showMessageDialog(
- jalview.gui.Desktop.desktop,
- MessageManager.getString("label.set_proxy_settings"),
- MessageManager.getString("label.proxy_authorization_failed"),
- JOptionPane.WARNING_MESSAGE);
+ JOptionPane.showMessageDialog(Desktop.desktop, MessageManager
+ .getString("label.set_proxy_settings"), MessageManager
+ .getString("label.proxy_authorization_failed"),
+ JOptionPane.WARNING_MESSAGE);
}
}
else
{
- jalview.bin.Cache.log.warn("No Discovery service at " + location);
- jalview.bin.Cache.log.debug("Axis Fault", f);
+ Cache.log.warn("No Discovery service at " + location);
+ Cache.log.debug("Axis Fault", f);
}
} catch (Exception e)
{
- jalview.bin.Cache.log.warn("No Discovery service at " + location);
- jalview.bin.Cache.log.debug("Discovery Service General Exception", e);
+ Cache.log.warn("No Discovery service at " + location);
+ Cache.log.debug("Discovery Service General Exception", e);
}
if ((shs != null) && shs.getServices().length > 0)
{
{
if (!cat.contains(sh[i]))
{
- jalview.bin.Cache.log.debug("A " + sh[i].getAbstractName()
+ Cache.log.debug("A " + sh[i].getAbstractName()
+ " service called " + sh[i].getName() + " exists at "
+ sh[i].getEndpointURL() + "\n");
if (!sscat.containsKey(sh[i].getAbstractName()))
disc_serv = new java.net.URL(sh[i].getEndpointURL());
if (!ServiceURLList.contains(disc_serv))
{
- jalview.bin.Cache.log
+ Cache.log
.debug("Adding new discovery service at "
+ disc_serv);
ServiceURLList.add(disc_serv);
}
} catch (Exception e)
{
- jalview.bin.Cache.log.debug(
+ Cache.log.debug(
"Ignoring bad discovery service URL "
+ sh[i].getEndpointURL(), e);
}
int s_url = 0;
if (ServiceURLList == null)
{
- jalview.bin.Cache.log
+ Cache.log
.debug("No service endpoints to use for service discovery.");
return;
}
}
else
{
- jalview.bin.Cache.log
+ Cache.log
.warn("No services at "
+ (ServiceURLList.get(s_url))
+ " - check DISCOVERY_URLS property in .jalview_properties");
package jalview.ws.jws1;
import jalview.analysis.AlignSeq;
+import jalview.analysis.SeqsetUtils;
import jalview.bin.Cache;
import jalview.datamodel.AlignmentView;
import jalview.datamodel.SeqCigar;
* visible regions
*/
private void startJPredClient(String title, boolean msa,
- jalview.datamodel.AlignmentView alview, AlignFrame parentFrame,
+ AlignmentView alview, AlignFrame parentFrame,
boolean viewonly)
{
AlignmentView input = alview;
aln[i] = msf[i].getSeq('-');
}
- Hashtable SequenceInfo = jalview.analysis.SeqsetUtils.uniquify(aln,
- true);
+ Hashtable SequenceInfo = SeqsetUtils.uniquify(aln, true);
if (viewonly)
{
// Remove hidden regions from sequence objects.
+ (viewonly ? "visible " : "") + "sequence " + seq.getName()
+ " from " + title;
String seqname = seq.getName();
- Hashtable SequenceInfo = jalview.analysis.SeqsetUtils
- .SeqCharacterHash(seq);
+ Hashtable SequenceInfo = SeqsetUtils.SeqCharacterHash(seq);
if (viewonly)
{
// Remove hidden regions from input sequence
aln[i] = new jalview.datamodel.Sequence(msf[i]);
}
- Hashtable SequenceInfo = jalview.analysis.SeqsetUtils.uniquify(aln,
+ Hashtable SequenceInfo = SeqsetUtils.uniquify(aln,
true);
Jpred server = locateWebService();
String altitle = "JNet prediction for sequence " + seq.getName()
+ " from " + title;
- Hashtable SequenceInfo = jalview.analysis.SeqsetUtils
- .SeqCharacterHash(seq);
+ Hashtable SequenceInfo = SeqsetUtils.SeqCharacterHash(seq);
Jpred server = locateWebService();
if (server == null)
package jalview.ws.jws1;
import jalview.analysis.AlignSeq;
+import jalview.analysis.SeqsetUtils;
import jalview.bin.Cache;
+import jalview.commands.RemoveGapsCommand;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.gui.Desktop;
import jalview.gui.WebserviceInfo;
import jalview.io.FormatAdapter;
+import jalview.io.IdentifyFile;
+import jalview.io.JPredFile;
+import jalview.io.JnetAnnotationMaker;
+import jalview.io.PileUpfile;
import jalview.util.Comparison;
import jalview.util.MessageManager;
import jalview.ws.AWsJob;
import java.util.List;
import vamsas.objects.simple.JpredResult;
+import vamsas.objects.simple.Msfalignment;
class JPredThread extends JWS1Thread implements WSClientI
{
JpredResult result = (JpredResult) this.result;
- jalview.bin.Cache.log.debug("Parsing output from JNet job.");
+ Cache.log.debug("Parsing output from JNet job.");
// JPredFile prediction = new JPredFile("C:/JalviewX/files/jpred.txt",
// "File");
- jalview.io.JPredFile prediction = new jalview.io.JPredFile(
- result.getPredfile(), "Paste");
+ JPredFile prediction = new JPredFile(result.getPredfile(), "Paste");
SequenceI[] preds = prediction.getSeqsAsArray();
- jalview.bin.Cache.log.debug("Got prediction profile.");
+ Cache.log.debug("Got prediction profile.");
if ((this.msa != null) && (result.getAligfile() != null))
{
- jalview.bin.Cache.log.debug("Getting associated alignment.");
+ Cache.log.debug("Getting associated alignment.");
// we ignore the returned alignment if we only predicted on a single
// sequence
- String format = new jalview.io.IdentifyFile().Identify(
- result.getAligfile(), "Paste");
+ String format = new IdentifyFile().Identify(result.getAligfile(),
+ "Paste");
- if (jalview.io.FormatAdapter.isValidFormat(format))
+ if (FormatAdapter.isValidFormat(format))
{
SequenceI sqs[];
if (predMap != null)
{
sqs[i] = al.getSequenceAt(i);
}
- if (!jalview.analysis.SeqsetUtils.deuniquify(
- SequenceInfo, sqs))
+ if (!SeqsetUtils.deuniquify(SequenceInfo, sqs))
{
throw (new Exception(MessageManager.getString("exception.couldnt_recover_sequence_properties_for_alignment")));
}
{
al.setDataset(null);
}
- jalview.io.JnetAnnotationMaker.add_annotation(prediction, al,
- FirstSeq, false, predMap);
+ JnetAnnotationMaker.add_annotation(prediction, al, FirstSeq,
+ false, predMap);
}
else
// ///
// Uses RemoveGapsCommand
// ///
- new jalview.commands.RemoveGapsCommand(MessageManager.getString("label.remove_gaps"),
+ new RemoveGapsCommand(
+ MessageManager.getString("label.remove_gaps"),
new SequenceI[]
{ sqs[msaIndex] }, currentView);
profileseq.setSequence(sqs[msaIndex].getSequenceAsString());
}
- if (!jalview.analysis.SeqsetUtils.SeqCharacterUnhash(
+ if (!SeqsetUtils.SeqCharacterUnhash(
al.getSequenceAt(FirstSeq), SequenceInfo))
{
throw (new Exception(MessageManager.getString("exception.couldnt_recover_sequence_props_for_jnet_query")));
{
al.setDataset(null);
}
- jalview.io.JnetAnnotationMaker.add_annotation(prediction, al,
+ JnetAnnotationMaker.add_annotation(prediction, al,
FirstSeq, true, predMap);
SequenceI profileseq = al.getSequenceAt(0); // this includes any gaps.
alignToProfileSeq(al, profileseq);
{
if (msf.length > 1)
{
- msa = new vamsas.objects.simple.Msfalignment();
- jalview.io.PileUpfile pileup = new jalview.io.PileUpfile();
+ msa = new Msfalignment();
+ PileUpfile pileup = new PileUpfile();
msa.setMsf(pileup.print(msf));
}
}
.println("JPredWS Client: Failed to submit the prediction. Quite possibly because of a server error - see below)\n"
+ e.getMessage() + "\n");
- jalview.bin.Cache.log.warn("Server Exception", e);
+ Cache.log.warn("Server Exception", e);
}
else
{
// JBPNote - this could be a popup informing the user of the problem.
wsInfo.appendProgressText(j.getJobnum(), MessageManager.formatMessage("info.failed_to_submit_prediction", new String[]{e.getMessage(),wsInfo.getProgressText()}));
- jalview.bin.Cache.log.debug(
+ Cache.log.debug(
"Failed Submission of job " + j.getJobnum(), e);
}
msa = (j.msa != null) ? true : msa;
try
{
- jalview.bin.Cache.log.debug("Parsing output of job " + jn);
+ Cache.log.debug("Parsing output of job " + jn);
jobres = j.getResultSet();
- jalview.bin.Cache.log.debug("Finished parsing output.");
+ Cache.log.debug("Finished parsing output.");
if (jobs.length == 1)
{
res = jobres;
}
} catch (Exception e)
{
- jalview.bin.Cache.log.error(
+ Cache.log.error(
"JNet Client: JPred Annotation Parse Error", e);
wsInfo.setStatus(j.getJobnum(),
WebserviceInfo.STATE_STOPPED_ERROR);
*/
package jalview.ws.jws1;
-import java.util.*;
-
-import jalview.analysis.*;
-import jalview.bin.*;
-import jalview.datamodel.*;
-import jalview.gui.*;
+import jalview.analysis.AlignSeq;
+import jalview.analysis.AlignmentSorter;
+import jalview.analysis.SeqsetUtils;
+import jalview.bin.Cache;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentOrder;
+import jalview.datamodel.AlignmentView;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceI;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.gui.WebserviceInfo;
+import jalview.util.Comparison;
import jalview.util.MessageManager;
import jalview.ws.AWsJob;
import jalview.ws.JobStateSummary;
import jalview.ws.WSClientI;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
import vamsas.objects.simple.MsaResult;
class MsaWSThread extends JWS1Thread implements WSClientI
for (int i = 0, n = 0; i < seqs.length; i++)
{
- String newname = jalview.analysis.SeqsetUtils.unique_name(i); // same
+ String newname = SeqsetUtils.unique_name(i); // same
// for
// any
// subjob
- SeqNames.put(newname,
- jalview.analysis.SeqsetUtils.SeqCharacterHash(seqs[i]));
+ SeqNames.put(newname, SeqsetUtils.SeqCharacterHash(seqs[i]));
if (valid && seqs[i].getEnd() - seqs[i].getStart() > minlen - 1)
{
seqarray[n] = new vamsas.objects.simple.Sequence();
seqarray[n].setId(newname);
seqarray[n++].setSeq((submitGaps) ? seqs[i].getSequenceAsString()
- : AlignSeq.extractGaps(jalview.util.Comparison.GapChars,
+ : AlignSeq.extractGaps(Comparison.GapChars,
seqs[i].getSequenceAsString()));
}
else
if (seqs[i].getEnd() >= seqs[i].getStart())
{
empty = (submitGaps) ? seqs[i].getSequenceAsString() : AlignSeq
- .extractGaps(jalview.util.Comparison.GapChars,
+ .extractGaps(Comparison.GapChars,
seqs[i].getSequenceAsString());
}
emptySeqs.add(new String[]
String[] es = (String[]) emptySeqs.get(i);
if (es[1] == null)
{
- t_alseqs[i + alseq_l] = new jalview.datamodel.Sequence(es[0],
+ t_alseqs[i + alseq_l] = new Sequence(es[0],
insbuff.toString(), 1, 0);
}
else
{
if (es[1].length() < nw)
{
- t_alseqs[i + alseq_l] = new jalview.datamodel.Sequence(
+ t_alseqs[i + alseq_l] = new Sequence(
es[0],
es[1] + insbuff.substring(0, nw - es[1].length()),
1, 1 + es[1].length());
}
else
{
- t_alseqs[i + alseq_l] = new jalview.datamodel.Sequence(
+ t_alseqs[i + alseq_l] = new Sequence(
es[0], es[1]);
}
}
}
AlignmentOrder msaorder = new AlignmentOrder(alseqs);
// always recover the order - makes parseResult()'s life easier.
- jalview.analysis.AlignmentSorter.recoverOrder(alseqs);
+ AlignmentSorter.recoverOrder(alseqs);
// account for any missing sequences
- jalview.analysis.SeqsetUtils.deuniquify(SeqNames, alseqs);
+ SeqsetUtils.deuniquify(SeqNames, alseqs);
return new Object[]
{ alseqs, msaorder };
}
* boolean
*/
MsaWSThread(ext.vamsas.MuscleWS server, String wsUrl,
- WebserviceInfo wsinfo, jalview.gui.AlignFrame alFrame,
+ WebserviceInfo wsinfo, AlignFrame alFrame,
AlignmentView alview, String wsname, boolean subgaps,
boolean presorder)
{
* Alignment
*/
MsaWSThread(ext.vamsas.MuscleWS server, String wsUrl,
- WebserviceInfo wsinfo, jalview.gui.AlignFrame alFrame,
+ WebserviceInfo wsinfo, AlignFrame alFrame,
String wsname, String title, AlignmentView _msa, boolean subgaps,
boolean presorder, Alignment seqset)
{
}
}
- private jalview.datamodel.Sequence[] getVamsasAlignment(
+ private Sequence[] getVamsasAlignment(
vamsas.objects.simple.Alignment valign)
{
// TODO: refactor to helper class for vamsas.objects.simple objects
vamsas.objects.simple.Sequence[] seqs = valign.getSeqs().getSeqs();
- jalview.datamodel.Sequence[] msa = new jalview.datamodel.Sequence[seqs.length];
+ Sequence[] msa = new Sequence[seqs.length];
for (int i = 0, j = seqs.length; i < j; i++)
{
- msa[i] = new jalview.datamodel.Sequence(seqs[i].getId(),
+ msa[i] = new Sequence(seqs[i].getId(),
seqs[i].getSeq());
}
while (j < l)
{
if (((AlignmentOrder) alorders.get(i))
- .equals(((AlignmentOrder) alorders.get(j))))
+ .equals((alorders.get(j))))
{
alorders.remove(j);
l--;
*/
package jalview.ws.jws1;
+import jalview.bin.Cache;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentView;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.gui.WebserviceInfo;
+import jalview.util.MessageManager;
+
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.StringTokenizer;
import java.util.Vector;
-import javax.swing.*;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
-import ext.vamsas.*;
-import jalview.datamodel.*;
-import jalview.gui.*;
-import jalview.util.MessageManager;
+import ext.vamsas.SeqSearchServiceLocator;
+import ext.vamsas.SeqSearchServiceSoapBindingStub;
+import ext.vamsas.ServiceHandle;
/**
* DOCUMENT ME!
*/
public SeqSearchWSClient(ext.vamsas.ServiceHandle sh, String altitle,
- jalview.datamodel.AlignmentView msa, String db,
- Alignment seqdataset, AlignFrame _alignFrame)
+ AlignmentView msa, String db, Alignment seqdataset,
+ AlignFrame _alignFrame)
{
super();
alignFrame = _alignFrame;
try
{
- this.server = (SeqSearchI) loc.getSeqSearchService(new java.net.URL(
+ this.server = loc.getSeqSearchService(new java.net.URL(
WsURL));
((SeqSearchServiceSoapBindingStub) this.server).setTimeout(60000); // One
// minute
String dbs[] = null;
try
{
- dbs = new jalview.ws.jws1.SeqSearchWSClient(sh)
- .getSupportedDatabases();
+ dbs = new SeqSearchWSClient(sh).getSupportedDatabases();
} catch (Exception e)
{
- jalview.bin.Cache.log.warn(
+ Cache.log.warn(
"Database list request failed, so disabling SeqSearch Service client "
+ sh.getName() + " at " + sh.getEndpointURL(), e);
return;
// use same input gatherer as for secondary structure prediction
// we could actually parameterise the gatherer method here...
AlignmentView msa = af.gatherSeqOrMsaForSecStrPrediction();
- new jalview.ws.jws1.SeqSearchWSClient(sh, af.getTitle(), msa, null,
- af.getViewport().getAlignment().getDataset(), af);
+ new SeqSearchWSClient(sh, af.getTitle(), msa, null, af
+ .getViewport().getAlignment().getDataset(), af);
}
});
// add entry for each database the service supports
public void actionPerformed(ActionEvent e)
{
AlignmentView msa = af.gatherSeqOrMsaForSecStrPrediction();
- new jalview.ws.jws1.SeqSearchWSClient(sh, af.getTitle(), msa,
+ new SeqSearchWSClient(sh, af.getTitle(), msa,
searchdb, af.getViewport().getAlignment().getDataset(),
af);
}
*/
package jalview.ws.jws1;
-import java.util.*;
-
-import jalview.analysis.*;
-import jalview.bin.*;
-import jalview.datamodel.*;
-import jalview.gui.*;
+import jalview.analysis.AlignSeq;
+import jalview.analysis.SeqsetUtils;
+import jalview.bin.Cache;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentView;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceI;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.gui.WebserviceInfo;
+import jalview.io.AnnotationFile;
+import jalview.io.AppletFormatAdapter;
+import jalview.io.FeaturesFile;
import jalview.io.NewickFile;
+import jalview.util.Comparison;
import jalview.util.MessageManager;
import jalview.ws.AWsJob;
import jalview.ws.JobStateSummary;
import jalview.ws.WSClientI;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
import vamsas.objects.simple.MsaResult;
import vamsas.objects.simple.SeqSearchResult;
for (int i = 0, n = 0; i < seqs.length; i++)
{
- String newname = jalview.analysis.SeqsetUtils.unique_name(i); // same
+ String newname = SeqsetUtils.unique_name(i); // same
// for
// any
// subjob
- SeqNames.put(newname,
- jalview.analysis.SeqsetUtils.SeqCharacterHash(seqs[i]));
+ SeqNames.put(newname, SeqsetUtils.SeqCharacterHash(seqs[i]));
if (valid && seqs[i].getEnd() - seqs[i].getStart() > minlen - 1)
{
seqarray[n] = new vamsas.objects.simple.Sequence();
seqarray[n].setId(newname);
seqarray[n++].setSeq((submitGaps) ? seqs[i].getSequenceAsString()
- : AlignSeq.extractGaps(jalview.util.Comparison.GapChars,
+ : AlignSeq.extractGaps(Comparison.GapChars,
seqs[i].getSequenceAsString()));
}
else
if (seqs[i].getEnd() >= seqs[i].getStart())
{
empty = (submitGaps) ? seqs[i].getSequenceAsString() : AlignSeq
- .extractGaps(jalview.util.Comparison.GapChars,
+ .extractGaps(Comparison.GapChars,
seqs[i].getSequenceAsString());
}
emptySeqs.add(new String[]
*/
// construct annotated alignment as it would be done by the jalview
// applet
- jalview.datamodel.Alignment al = new Alignment(alseqs);
+ Alignment al = new Alignment(alseqs);
// al.setDataset(dataset);
// make dataset
String inFile = null;
inFile = ((SeqSearchResult) result).getAnnotation();
if (inFile != null && inFile.length() > 0)
{
- new jalview.io.AnnotationFile().readAnnotationFile(al, inFile,
- jalview.io.AppletFormatAdapter.PASTE);
+ new AnnotationFile().readAnnotationFile(al, inFile,
+ AppletFormatAdapter.PASTE);
}
} catch (Exception e)
{
inFile = ((SeqSearchResult) result).getFeatures();
if (inFile != null && inFile.length() > 0)
{
- jalview.io.FeaturesFile ff = new jalview.io.FeaturesFile(
- inFile, jalview.io.AppletFormatAdapter.PASTE);
+ FeaturesFile ff = new FeaturesFile(inFile,
+ AppletFormatAdapter.PASTE);
ff.parse(al, featureColours, false);
}
} catch (Exception e)
System.err.println(">>>EOF" + inFile + "\n<<<EOF\n");
e.printStackTrace(System.err);
}
- jalview.io.NewickFile nf = null;
+ NewickFile nf = null;
try
{
inFile = ((SeqSearchResult) result).getNewickTree();
if (inFile != null && inFile.length() > 0)
{
- nf = new jalview.io.NewickFile(inFile,
- jalview.io.AppletFormatAdapter.PASTE);
+ nf = new NewickFile(inFile, AppletFormatAdapter.PASTE);
if (!nf.isValid())
{
nf.close();
* boolean
*/
SeqSearchWSThread(ext.vamsas.SeqSearchI server, String wsUrl,
- WebserviceInfo wsinfo, jalview.gui.AlignFrame alFrame,
+ WebserviceInfo wsinfo, AlignFrame alFrame,
AlignmentView alview, String wsname, String db)
{
super(alFrame, wsinfo, alview, wsname, wsUrl);
* Alignment
*/
SeqSearchWSThread(ext.vamsas.SeqSearchI server, String wsUrl,
- WebserviceInfo wsinfo, jalview.gui.AlignFrame alFrame,
+ WebserviceInfo wsinfo, AlignFrame alFrame,
String wsname, String title, AlignmentView _msa, String db,
Alignment seqset)
{
}
}
- private jalview.datamodel.Sequence[] getVamsasAlignment(
+ private Sequence[] getVamsasAlignment(
vamsas.objects.simple.Alignment valign)
{
vamsas.objects.simple.Sequence[] seqs = valign.getSeqs().getSeqs();
- jalview.datamodel.Sequence[] msa = new jalview.datamodel.Sequence[seqs.length];
+ Sequence[] msa = new Sequence[seqs.length];
for (int i = 0, j = seqs.length; i < j; i++)
{
- msa[i] = new jalview.datamodel.Sequence(seqs[i].getId(),
+ msa[i] = new Sequence(seqs[i].getId(),
seqs[i].getSeq());
}
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
+import jalview.gui.AlignmentPanel;
import jalview.schemes.GraduatedColor;
import jalview.schemes.UserColourScheme;
import jalview.ws.jws2.jabaws2.Jws2Instance;
}
// TODO: JAL-1150 - create sequence feature settings API for defining
// styles and enabling/disabling feature overlay on alignment panel
- ((jalview.gui.AlignmentPanel) ap).updateFeatureRendererFrom(fr);
+ ((AlignmentPanel) ap).updateFeatureRendererFrom(fr);
if (af.alignPanel == ap)
{
// only do this if the alignFrame is currently showing this view.
import jalview.datamodel.AlignmentView;
import jalview.gui.AlignFrame;
import jalview.gui.WebserviceInfo;
+import jalview.ws.AWSThread;
-abstract public class AWS2Thread extends jalview.ws.AWSThread
+abstract public class AWS2Thread extends AWSThread
{
public AWS2Thread(AlignFrame alFrame, WebserviceInfo wsinfo,
import jalview.analysis.SeqsetUtils;
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
+import jalview.bin.Cache;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AnnotatedCollectionI;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
+import jalview.gui.AlignViewport;
import jalview.gui.IProgressIndicator;
+import jalview.util.Comparison;
import jalview.workers.AlignCalcWorker;
import jalview.ws.jws2.dm.AAConSettings;
import jalview.ws.jws2.dm.JabaWsParamSet;
{
if (getCalcId() != null)
{
- ((jalview.gui.AlignViewport) alignViewport).setCalcIdSettingsFor(
+ ((AlignViewport) alignViewport).setCalcIdSettingsFor(
getCalcId(),
new AAConSettings(true, service, this.preset,
(arguments != null) ? JabaParamStore
}
if (collectAnnotationResultsFor(rslt))
{
- jalview.bin.Cache.log
+ Cache.log
.debug("Updating result annotation from Job " + rslt
+ " at " + service.getUri());
updateResultAnnotation(true);
start = inputSeqs.getStartRes();
end = inputSeqs.getEndRes();
- for (SequenceI sq : ((List<SequenceI>) inputSeqs.getSequences()))
+ for (SequenceI sq : (inputSeqs.getSequences()))
{
if (bySequence ? sq.findPosition(end + 1)
- sq.findPosition(start + 1) > minlen - 1 : sq.getEnd()
else
{
seqs.add(seq = new compbio.data.sequence.FastaSequence(newname,
- AlignSeq.extractGaps(jalview.util.Comparison.GapChars,
+ AlignSeq.extractGaps(Comparison.GapChars,
sq.getSequenceAsString(start, end + 1))));
}
if (seq.getSequence().length() > ln)
{
return new AlignAnalysisUIText(
compbio.ws.client.Services.JpredWS.toString(),
- jalview.ws.jws2.JPred301Client.class, CALC_ID, false, true,
+ JPred301Client.class, CALC_ID, false, true,
true, "JPred Consensus",
"When checked, JPred consensus is updated automatically.",
"Change JPred Settings...",
*/
package jalview.ws.jws2;
+import jalview.util.MessageManager;
+import jalview.util.QuickSort;
+import jalview.ws.jws2.dm.JabaOption;
+import jalview.ws.jws2.dm.JabaParameter;
+import jalview.ws.jws2.dm.JabaWsParamSet;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.ArgumentI;
+import jalview.ws.params.ParamDatastoreI;
+import jalview.ws.params.ParamManager;
+import jalview.ws.params.WsParamSetI;
+
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import compbio.metadata.PresetManager;
import compbio.metadata.RunnerConfig;
-import jalview.util.MessageManager;
-import jalview.ws.jws2.dm.JabaOption;
-import jalview.ws.jws2.dm.JabaParameter;
-import jalview.ws.jws2.dm.JabaWsParamSet;
-import jalview.ws.jws2.jabaws2.Jws2Instance;
-import jalview.ws.params.ArgumentI;
-import jalview.ws.params.ParamDatastoreI;
-import jalview.ws.params.ParamManager;
-import jalview.ws.params.WsParamSetI;
-
public class JabaParamStore implements ParamDatastoreI
{
}
ArgumentI[] rgssort = rgs.toArray(new ArgumentI[rgs.size()]);
String[] rgssorton = rgnames.toArray(new String[rgs.size()]);
- jalview.util.QuickSort.sort(rgssorton, rgssort);
+ QuickSort.sort(rgssorton, rgssort);
ArgumentI tmp1;
int i = 0;
while (rgssort.length - i > i)
import jalview.gui.WebserviceInfo;
import jalview.gui.WsJobParameters;
import jalview.util.MessageManager;
+import jalview.ws.WSClient;
import jalview.ws.jws2.dm.AAConSettings;
import jalview.ws.jws2.dm.JabaWsParamSet;
import jalview.ws.jws2.jabaws2.Jws2Instance;
* @author JimP
*
*/
-public abstract class Jws2Client extends jalview.ws.WSClient
+public abstract class Jws2Client extends WSClient
{
protected AlignFrame alignFrame;
import jalview.gui.Desktop;
import jalview.gui.JvSwingUtils;
import jalview.util.MessageManager;
+import jalview.util.QuickSort;
import jalview.ws.WSMenuEntryProviderI;
import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.params.ParamDatastoreI;
spos[ipos++] = 1000 * svcUrls.indexOf(svc.getHost()) + 1
+ svctypes.indexOf(svc.serviceType);
}
- jalview.util.QuickSort.sortInt(spos, svcs);
+ QuickSort.sortInt(spos, svcs);
services = new Vector<Jws2Instance>();
for (Jws2Instance svc : svcs)
{
{
sortbytype[i] = orderedsvcs[i].serviceType;
}
- jalview.util.QuickSort.sort(sortbytype, orderedsvcs);
+ QuickSort.sort(sortbytype, orderedsvcs);
for (final Jws2Instance service : orderedsvcs)
{
atpoint = JvSwingUtils.findOrCreateMenu(jws2al, service.action);
MsaWS server;
public MsaWSClient(Jws2Instance sh, String altitle,
- jalview.datamodel.AlignmentView msa, boolean submitGaps,
+ AlignmentView msa,
+ boolean submitGaps,
boolean preserveOrder, Alignment seqdataset,
AlignFrame _alignFrame)
{
}
public MsaWSClient(Jws2Instance sh, WsParamSetI preset, String altitle,
- jalview.datamodel.AlignmentView msa, boolean submitGaps,
+ AlignmentView msa, boolean submitGaps,
boolean preserveOrder, Alignment seqdataset,
AlignFrame _alignFrame)
{
public MsaWSClient(Jws2Instance sh, WsParamSetI preset,
List<Argument> arguments, boolean editParams, String altitle,
- jalview.datamodel.AlignmentView msa, boolean submitGaps,
+ AlignmentView msa, boolean submitGaps,
boolean preserveOrder, Alignment seqdataset,
AlignFrame _alignFrame)
{
package jalview.ws.jws2;
import jalview.analysis.AlignSeq;
+import jalview.analysis.AlignmentSorter;
+import jalview.analysis.SeqsetUtils;
import jalview.bin.Cache;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.gui.Desktop;
import jalview.gui.SplitFrame;
import jalview.gui.WebserviceInfo;
+import jalview.util.Comparison;
import jalview.util.MessageManager;
import jalview.ws.AWsJob;
import jalview.ws.JobStateSummary;
for (int i = 0, n = 0; i < seqs.length; i++)
{
- String newname = jalview.analysis.SeqsetUtils.unique_name(i); // same
+ String newname = SeqsetUtils.unique_name(i); // same
// for
// any
// subjob
- SeqNames.put(newname,
- jalview.analysis.SeqsetUtils.SeqCharacterHash(seqs[i]));
+ SeqNames.put(newname, SeqsetUtils.SeqCharacterHash(seqs[i]));
if (valid && seqs[i].getEnd() - seqs[i].getStart() > minlen - 1)
{
// make new input sequence with or without gaps
seq = new compbio.data.sequence.FastaSequence(newname,
(submitGaps) ? seqs[i].getSequenceAsString()
: AlignSeq.extractGaps(
- jalview.util.Comparison.GapChars,
+ Comparison.GapChars,
seqs[i].getSequenceAsString()));
this.seqs.add(seq);
}
if (seqs[i].getEnd() >= seqs[i].getStart())
{
empty = (submitGaps) ? seqs[i].getSequenceAsString() : AlignSeq
- .extractGaps(jalview.util.Comparison.GapChars,
+ .extractGaps(Comparison.GapChars,
seqs[i].getSequenceAsString());
}
emptySeqs.add(new String[]
}
AlignmentOrder msaorder = new AlignmentOrder(alseqs);
// always recover the order - makes parseResult()'s life easier.
- jalview.analysis.AlignmentSorter.recoverOrder(alseqs);
+ AlignmentSorter.recoverOrder(alseqs);
// account for any missing sequences
- jalview.analysis.SeqsetUtils.deuniquify(SeqNames, alseqs);
+ SeqsetUtils.deuniquify(SeqNames, alseqs);
return new Object[]
{ alseqs, msaorder };
}
* boolean
*/
private MsaWSThread(MsaWS server, String wsUrl, WebserviceInfo wsinfo,
- jalview.gui.AlignFrame alFrame, AlignmentView alview,
+ AlignFrame alFrame, AlignmentView alview,
String wsname, boolean subgaps, boolean presorder)
{
super(alFrame, wsinfo, alview, wsname, wsUrl);
*/
MsaWSThread(MsaWS server2, WsParamSetI preset, List<Argument> paramset,
String wsUrl, WebserviceInfo wsinfo,
- jalview.gui.AlignFrame alFrame, String wsname, String title,
+ AlignFrame alFrame,
+ String wsname, String title,
AlignmentView _msa, boolean subgaps, boolean presorder,
Alignment seqset)
{
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Annotation;
import jalview.gui.AlignFrame;
-import jalview.ws.jws2.dm.AAConSettings;
import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.params.WsParamSetI;
import jalview.ws.uimodel.AlignAnalysisUIText;
import java.util.TreeSet;
import java.util.regex.Pattern;
-import compbio.data.sequence.RNAStructReader.AlifoldResult;
import compbio.data.sequence.FastaSequence;
+import compbio.data.sequence.RNAStructReader.AlifoldResult;
import compbio.data.sequence.RNAStructScoreManager;
import compbio.data.sequence.Range;
import compbio.data.sequence.Score;
import compbio.metadata.Argument;
+import compbio.ws.client.Services;
/**
* Client for the JABA RNA Alifold Service
public static AlignAnalysisUIText getAlignAnalysisUITest()
{
return new AlignAnalysisUIText(
- compbio.ws.client.Services.RNAalifoldWS.toString(),
- jalview.ws.jws2.RNAalifoldClient.class,
+ Services.RNAalifoldWS.toString(),
+ RNAalifoldClient.class,
CALC_ID,
true,
false,
* same data object as was overwritten with the contact probabilites data.
*/
if (data == null)
+ {
data = compbio.data.sequence.RNAStructReader
.newEmptyScore(AlifoldResult.consensusAlignment);
+ }
if (descriptionData == null)
+ {
descriptionData = data;
+ }
String[] typenameAndDescription = constructTypenameAndDescription(descriptionData
.first());
{
float t = contacts.get(contact);
if (t > prob)
+ {
prob = t;
+ }
description += Integer.toString(contact.from) + "->"
+ Integer.toString(contact.to) + ": "
+ Float.toString(t) + "% | ";
score.getScores().get(0), score.getScores().get(1));
}
else
+ {
description = "Stochastic Backtrack Structure";
+ }
}
else if (datatype.equals(AlifoldResult.MEAStucture.toString()))
{
// ordering of the Scores TreeSet in ScoreManager which is, descending
// probability
if (contact.from == i || contact.to == i)
+ {
contacts.put(contact, basePairs.get(contact));
+ }
}
return contacts;
*/
package jalview.ws.jws2.dm;
-import java.util.ArrayList;
-import java.util.List;
-
-import compbio.metadata.Argument;
-import compbio.metadata.Option;
-
import jalview.util.MessageManager;
import jalview.ws.jws2.JabaParamStore;
import jalview.ws.jws2.JabaPreset;
import jalview.ws.jws2.ParameterUtils;
import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.params.ArgumentI;
+import jalview.ws.params.AutoCalcSetting;
import jalview.ws.params.WsParamSetI;
+import java.util.ArrayList;
+import java.util.List;
+
+import compbio.metadata.Argument;
+import compbio.metadata.Option;
+
/**
* preferences for running AACon service
*
* @author jprocter TODO: refactor to a generic 'last job and service run'
* container ?
*/
-public class AAConSettings extends jalview.ws.params.AutoCalcSetting
+public class AAConSettings extends AutoCalcSetting
{
Jws2Instance service;
import compbio.metadata.Option;
-public class JabaOption implements jalview.ws.params.OptionI
+public class JabaOption implements OptionI
{
public JabaOption(Option rg)
{
import jalview.ws.jws2.MsaWSClient;
import jalview.ws.jws2.SequenceAnnotationWSClient;
import jalview.ws.params.ParamDatastoreI;
+import jalview.ws.uimodel.AlignAnalysisUIText;
import java.io.Closeable;
return "java:" + serviceType;
}
- jalview.ws.uimodel.AlignAnalysisUIText aaui;
+ AlignAnalysisUIText aaui;
- public jalview.ws.uimodel.AlignAnalysisUIText getAlignAnalysisUI()
+ public AlignAnalysisUIText getAlignAnalysisUI()
{
return aaui;
}
import jalview.bin.Cache;
import jalview.io.FileParse;
import jalview.io.packed.DataProvider;
+import jalview.io.packed.DataProvider.JvDataType;
+import jalview.io.packed.JalviewDataset;
import jalview.io.packed.ParsePackedSet;
import jalview.io.packed.SimpleDataProvider;
-import jalview.io.packed.DataProvider.JvDataType;
import jalview.util.MessageManager;
import jalview.ws.io.mime.JalviewMimeContentHandler;
{
throw new Error(MessageManager.getString("error.implementation_error_need_to_have_httpresponse"));
}
- jalview.io.packed.JalviewDataset ds = restJob.newJalviewDataset();
+ JalviewDataset ds = restJob.newJalviewDataset();
// Decide how we deal with content.
if (en instanceof MultipartEntity)
{
*/
package jalview.ws.rest;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import javax.swing.JMenu;
-import javax.swing.JMenuItem;
-import javax.swing.JOptionPane;
-import javax.swing.event.MenuEvent;
-import javax.swing.event.MenuListener;
-
import jalview.bin.Cache;
import jalview.datamodel.AlignmentView;
import jalview.gui.AlignFrame;
import jalview.gui.Desktop;
import jalview.gui.WebserviceInfo;
import jalview.io.packed.DataProvider.JvDataType;
+import jalview.io.packed.JalviewDataset;
import jalview.util.MessageManager;
import jalview.ws.WSClient;
import jalview.ws.WSClientI;
import jalview.ws.WSMenuEntryProviderI;
+import jalview.ws.rest.params.Alignment;
+import jalview.ws.rest.params.JobConstant;
+import jalview.ws.rest.params.SeqGroupIndexVector;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Hashtable;
+import java.util.Vector;
+
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.event.MenuEvent;
+import javax.swing.event.MenuListener;
/**
* @author JimP
*/
protected AlignFrame recoverAlignFrameForView()
{
- return jalview.gui.Desktop.getAlignFrameFor(av);
+ return Desktop.getAlignFrameFor(av);
}
public RestClient(RestServiceDescription service2, AlignFrame alignFrame)
/**
* input data context
*/
- jalview.io.packed.JalviewDataset jds;
+ JalviewDataset jds;
/**
* informative name for results
{
String action = "Analysis", description = "Sequence Harmony and Multi-Relief (Brandt et al. 2010)", name = MessageManager.getString("label.multiharmony");
Hashtable<String, InputType> iparams = new Hashtable<String, InputType>();
- jalview.ws.rest.params.JobConstant toolp;
+ JobConstant toolp;
// toolp = new jalview.ws.rest.JobConstant("tool","jalview");
// iparams.put(toolp.token, toolp);
// toolp = new jalview.ws.rest.params.JobConstant("mbjob[method]","shmr");
// toolp = new jalview.ws.rest.params.JobConstant("blast","0");
// iparams.put(toolp.token, toolp);
- jalview.ws.rest.params.Alignment aliinput = new jalview.ws.rest.params.Alignment();
+ Alignment aliinput = new Alignment();
// SHMR server has a 65K limit for content pasted into the 'ali' parameter,
// so we always upload our files.
aliinput.token = "ali_file";
aliinput.writeAsFile = true;
iparams.put(aliinput.token, aliinput);
- jalview.ws.rest.params.SeqGroupIndexVector sgroups = new jalview.ws.rest.params.SeqGroupIndexVector();
+ SeqGroupIndexVector sgroups = new SeqGroupIndexVector();
sgroups.setMinsize(2);
sgroups.min = 2;// need at least two group defined to make a partition
iparams.put("groups", sgroups);
try
{
for (RestServiceDescription descr : RestServiceDescription
- .parseDescriptions(jalview.bin.Cache.getDefault(
+ .parseDescriptions(Cache.getDefault(
RSBS_SERVICES,
makeShmmrRestClient().service.toString())))
{
*/
package jalview.ws.rest;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.Set;
-import java.util.Vector;
-
+import jalview.analysis.SeqsetUtils;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentOrder;
import jalview.ws.rest.params.Alignment;
import jalview.ws.rest.params.SeqGroupIndexVector;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Set;
+import java.util.Vector;
+
public class RestJob extends AWsJob
{
// get sequences for the alignmentI
// get groups trimmed to alignment columns
// get any annotation trimmed to start/end columns, too.
- squniq = jalview.analysis.SeqsetUtils.uniquify(
- _input.getSequencesArray(), true);
+ squniq = SeqsetUtils.uniquify(_input.getSequencesArray(), true);
// prepare input
// form alignment+groups+annotation,preprocess and then record references
// for formatters
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
+import jalview.gui.AlignmentPanel;
import jalview.gui.Desktop;
import jalview.gui.PaintRefresher;
import jalview.gui.WebserviceInfo;
private String getStage(Stage stg)
{
if (stg == Stage.SUBMIT)
+ {
return "submitting ";
+ }
if (stg == Stage.POLL)
+ {
return "checking status of ";
+ }
return (" being confused about ");
}
/**
* alignment panels derived from each alignment set returned by service.
*/
- ArrayList<jalview.gui.AlignmentPanel> destPanels = new ArrayList<jalview.gui.AlignmentPanel>();
+ ArrayList<AlignmentPanel> destPanels = new ArrayList<AlignmentPanel>();
/**
* list of instructions for how to process each distinct alignment set
* returned by the job set
// total number of distinct alignment sets generated by job set.
int numAlSets = 0, als = 0;
List<AlignmentI> destAls = new ArrayList<AlignmentI>();
- List<jalview.datamodel.ColumnSelection> destColsel = new ArrayList<jalview.datamodel.ColumnSelection>();
+ List<ColumnSelection> destColsel = new ArrayList<ColumnSelection>();
List<List<NewickFile>> trees = new ArrayList<List<NewickFile>>();
do
RestJob rj = (RestJob) jobs[nrj];
int contigs[] = input.getVisibleContigs();
AlignmentI destAl = null;
- jalview.datamodel.ColumnSelection destCs = null;
+ ColumnSelection destCs = null;
// Resolve destAl for this data.
if (als == 0 && rj.isInputContextModified())
{
/**
* current pane being worked with
*/
- jalview.gui.AlignmentPanel destPanel = restClient
- .recoverAlignPanelForView();
+ AlignmentPanel destPanel = restClient.recoverAlignPanelForView();
als = 0;
for (AddDataTo action : resultDest)
{
*/
package jalview.ws.rest;
+import jalview.datamodel.SequenceI;
+import jalview.io.packed.DataProvider.JvDataType;
+import jalview.util.StringUtils;
+import jalview.ws.rest.params.Alignment;
+import jalview.ws.rest.params.AnnotationFile;
+import jalview.ws.rest.params.SeqGroupIndexVector;
+import jalview.ws.rest.params.SeqIdVector;
+import jalview.ws.rest.params.SeqVector;
+import jalview.ws.rest.params.Tree;
+
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import jalview.datamodel.SequenceI;
-import jalview.io.packed.DataProvider.JvDataType;
-import jalview.util.StringUtils;
-import jalview.ws.rest.params.Alignment;
-import jalview.ws.rest.params.AnnotationFile;
-import jalview.ws.rest.params.SeqGroupIndexVector;
-
public class RestServiceDescription
{
private static final Pattern PARAM_ENCODED_URL_PATTERN = Pattern.compile("([?&])([A-Za-z0-9_]+)=\\$([^$]+)\\$");
{
// TODO - find a better way of maintaining this classlist
return new Class[]
- { jalview.ws.rest.params.Alignment.class,
- jalview.ws.rest.params.AnnotationFile.class,
+ { Alignment.class, AnnotationFile.class,
SeqGroupIndexVector.class,
- jalview.ws.rest.params.SeqIdVector.class,
- jalview.ws.rest.params.SeqVector.class,
- jalview.ws.rest.params.Tree.class };
+ SeqIdVector.class, SeqVector.class, Tree.class };
}
public static boolean parseTypeString(String fullstring, String tok,
package jalview.ws.rest.params;
import jalview.datamodel.AlignmentI;
+import jalview.io.FormatAdapter;
import jalview.ws.params.OptionI;
import jalview.ws.params.simple.BooleanOption;
import jalview.ws.params.simple.Option;
PrintWriter pw = new PrintWriter(
new OutputStreamWriter(new BufferedOutputStream(
new FileOutputStream(fa)), "UTF-8"));
- pw.append(new jalview.io.FormatAdapter().formatSequences(format,
+ pw.append(new FormatAdapter().formatSequences(format,
alignment, jvsuffix));
pw.close();
return new FileBody(fa, "text/plain");
}
else
{
- jalview.io.FormatAdapter fa = new jalview.io.FormatAdapter();
+ FormatAdapter fa = new FormatAdapter();
fa.setNewlineString("\r\n");
return new StringBody(
(fa.formatSequences(format, alignment, jvsuffix)));
if (tok.startsWith("format"))
{
- for (String fmt : jalview.io.FormatAdapter.WRITEABLE_FORMATS)
+ for (String fmt : FormatAdapter.WRITEABLE_FORMATS)
{
if (val.equalsIgnoreCase(fmt))
{
}
warnings.append("Invalid alignment format '" + val
+ "'. Must be one of (");
- for (String fmt : jalview.io.FormatAdapter.WRITEABLE_FORMATS)
+ for (String fmt : FormatAdapter.WRITEABLE_FORMATS)
{
warnings.append(" " + fmt);
}
lst.add(new Option("format", "Alignment upload format", true, "FASTA",
format, Arrays
- .asList(jalview.io.FormatAdapter.WRITEABLE_FORMATS),
+ .asList(FormatAdapter.WRITEABLE_FORMATS),
null));
lst.add(createMolTypeOption("type", "Sequence type", false, type, null));
*/
package jalview.ws.rest.params;
+import jalview.analysis.AlignmentSorter;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.util.MessageManager;
+import jalview.util.QuickSort;
import jalview.ws.params.OptionI;
import jalview.ws.params.simple.IntegerParameter;
import jalview.ws.params.simple.Option;
*/
public AlignmentI prepareAlignment(AlignmentI al)
{
- jalview.analysis.AlignmentSorter.sortByGroup(al);
+ AlignmentSorter.sortByGroup(al);
return al;
}
else
{
if (p < se[0])
+ {
se[0] = p;
+ }
if (p > se[1])
+ {
se[1] = p;
+ }
}
}
if (se != null)
int[][] vals = gl.toArray(new int[gl.size()][]);
int[] srt = new int[gl.size()];
for (int i = 0; i < vals.length; i++)
+ {
srt[i] = vals[i][0];
- jalview.util.QuickSort.sortInt(srt, vals);
+ }
+ QuickSort.sortInt(srt, vals);
list = false;
int last = vals[0][0] - 1;
for (int[] range : vals)
{
minsize = Integer.valueOf(val);
if (minsize >= 0)
+ {
return true;
+ }
} catch (Exception x)
{
*/
package jalview.ws.rest.params;
+import jalview.analysis.NJTree;
import jalview.util.MessageManager;
import jalview.ws.params.OptionI;
import jalview.ws.rest.InputType;
public Tree()
{
super(new Class[]
- { jalview.analysis.NJTree.class });
+ { NJTree.class });
}
// TODO specify modifiers for tree output format
*/
package jalview.ws.seqfetcher;
+import jalview.bin.Cache;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.DBRefEntry;
+import jalview.datamodel.SequenceI;
+import jalview.util.DBRefUtils;
+import jalview.util.MessageManager;
+import jalview.util.QuickSort;
+
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Stack;
import java.util.Vector;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.DBRefEntry;
-import jalview.datamodel.SequenceI;
-import jalview.util.DBRefUtils;
-import jalview.util.MessageManager;
-
public class ASequenceFetcher
{
return true;
}
}
- jalview.bin.Cache.log.warn("isFetchable doesn't know about '" + source
+ Cache.log.warn("isFetchable doesn't know about '" + source
+ "'");
return false;
}
- public SequenceI[] getSequences(jalview.datamodel.DBRefEntry[] refs)
+ public SequenceI[] getSequences(DBRefEntry[] refs)
{
SequenceI[] ret = null;
Vector<SequenceI> rseqs = new Vector();
{
nm[i++] = "" + s.getTier() + s.getDbName().toLowerCase();
}
- jalview.util.QuickSort.sort(nm, l);
+ QuickSort.sort(nm, l);
dbs = new ArrayList<DbSourceProxy>();
for (i = l.length - 1; i >= 0; i--)
{
*/
public String[] getDbInstances(Class class1)
{
- if (!jalview.ws.seqfetcher.DbSourceProxy.class.isAssignableFrom(class1))
+ if (!DbSourceProxy.class.isAssignableFrom(class1))
{
throw new Error(MessageManager.formatMessage("error.implementation_error_dbinstance_must_implement_interface", new String[]{class1.toString()}));
}