- Platform.timeCheck("EG " + query, Platform.TIME_MARK);
-
/*
* convert to a non-duplicated list of gene identifiers
*/
List<String> geneIds = getGeneIds(query);
-
-
- Platform.timeCheck("EG genIds " + geneIds.size(), Platform.TIME_MARK);
-
AlignmentI al = null;
for (String geneId : geneIds)
{
/*
* fetch the gene sequence(s) with features and xrefs
*/
-
- Platform.timeCheck("EG fetch " + geneId, Platform.TIME_MARK);
-
-
AlignmentI geneAlignment = super.getSequenceRecords(geneId);
if (geneAlignment == null)
{
{
// ensure id has 'correct' case for the Ensembl identifier
geneId = geneAlignment.getSequenceAt(0).getName();
-
-
- Platform.timeCheck("EG loci " + geneId, Platform.TIME_MARK);
-
-
findGeneLoci(geneAlignment.getSequenceAt(0), geneId);
-
- Platform.timeCheck("EG transcript " + geneId, Platform.TIME_MARK);
-
getTranscripts(geneAlignment, geneId);
}
if (al == null)
al.append(geneAlignment);
}
}
-
- Platform.timeCheck("EG done", Platform.TIME_MARK);
-
return al;
}
StringBuilder postBody = new StringBuilder(64);
postBody.append("{\"ids\":[");
first = true;
- for (String id : ids)
+ for (int i = 0, n = ids.size(); i < n; i++)
{
+ String id = ids.get(i);
if (!first)
{
postBody.append(",");
if (url == null)
url = getUrl(ids);
- Platform.timeCheck("EnsembleRestClient.getJSON0 " + url, Platform.TIME_MARK);
+// Platform.timeCheck("EnsembleRestClient.getJSON0 " + url, Platform.TIME_MARK);
Reader br = null;
try {
br = (url == null ? null : getHttpResponse(url, ids, msDelay));
- Platform.timeCheck("EnsembleRestClient.getJSON1 parsing... ", Platform.TIME_MARK);
+// Platform.timeCheck("EnsembleRestClient.getJSON1 parsing... ", Platform.TIME_MARK);
Object ret = (br == null ? null : JSONUtils.parse(br));
- Platform.timeCheck("EnsembleRestClient.getJSON2 ...done ", Platform.TIME_MARK);
+// Platform.timeCheck("EnsembleRestClient.getJSON2 ...done ", Platform.TIME_MARK);
if (ret != null && mapKey != null)
ret = ((Map<String, Object>) ret).get(mapKey);
*/
SequenceI genomicSequence = null;
EnsemblFeatures gffFetcher = new EnsemblFeatures(getDomain());
- EnsemblFeatureType[] features = getFeaturesToFetch();
-
- Platform.timeCheck("ESP.getsequencerec1", Platform.TIME_MARK);
-
-
+ EnsemblFeatureType[] features = getFeaturesToFetch();
AlignmentI geneFeatures = gffFetcher.getSequenceRecords(accId,
features);
if (geneFeatures != null && geneFeatures.getHeight() > 0)
{
genomicSequence = geneFeatures.getSequenceAt(0);
}
-
- Platform.timeCheck("ESP.getsequencerec2", Platform.TIME_MARK);
-
if (genomicSequence != null)
{
/*
* transfer features to the query sequence
*/
SequenceI querySeq = alignment.findName(accId, true);
-
- Platform.timeCheck("ESP.transferfeat", Platform.TIME_MARK);
-
if (transferFeatures(accId, genomicSequence, querySeq))
{
* fetch and map protein product, and add it as a cross-reference
* of the retrieved sequence
*/
- Platform.timeCheck("ESP.addprotein", Platform.TIME_MARK);
addProteinProduct(querySeq);
}
}
System.err.println(
"Error transferring Ensembl features: " + e.getMessage());
}
- Platform.timeCheck("ESP.addfeat done", Platform.TIME_MARK);
}
/**
*/
protected void getCrossReferences(SequenceI seq)
{
-
- Platform.timeCheck("ESP. getdataseq ", Platform.TIME_MARK);
-
-
while (seq.getDatasetSequence() != null)
{
seq = seq.getDatasetSequence();
}
-
- Platform.timeCheck("ESP. getxref ", Platform.TIME_MARK);
-
EnsemblXref xrefFetcher = new EnsemblXref(getDomain(), getDbSource(),
getEnsemblDataVersion());
List<DBRefEntry> xrefs = xrefFetcher.getCrossReferences(seq.getName());
for (int i = 0, n = xrefs.size(); i < n; i++)
{
- Platform.timeCheck("ESP. getxref + " + (i) + "/" + n, Platform.TIME_MARK);
// BH 2019.01.25 this next method was taking 174 ms PER addition for a 266-reference example.
// DBRefUtils.ensurePrimaries(seq)
// was at the end of seq.addDBRef, so executed after ever addition!
// This method was moved to seq.getPrimaryDBRefs()
seq.addDBRef(xrefs.get(i));
}
-
- System.out.println("primaries are " + seq.getPrimaryDBRefs().toString());
/*
* and add a reference to itself
*/
-
- Platform.timeCheck("ESP. getxref self ", Platform.TIME_MARK);
-
DBRefEntry self = new DBRefEntry(getDbSource(), getEnsemblDataVersion(),
- seq.getName());
-
- Platform.timeCheck("ESP. getxref self add ", Platform.TIME_MARK);
-
+ seq.getName());
seq.addDBRef(self);
-
- Platform.timeCheck("ESP. seqprox done ", Platform.TIME_MARK);
-
}
/**
inProgress = false;
throw new JalviewException("ENSEMBL Rest API not available.");
}
- Platform.timeCheck("EnsemblSeqProx.fetchSeq ", Platform.TIME_MARK);
-
List<SequenceI> seqs = parseSequenceJson(ids);
if (seqs == null)
return alignment;
* for now, assumes only one sequence returned; refactor if needed
* in future to handle a JSONArray with more than one
*/
-
- Platform.timeCheck("ENS seqproxy", Platform.TIME_MARK);
Map<String, Object> val = (Map<String, Object>) getJSON(null, ids, -1, MODE_MAP, null);
if (val == null)
return null;
System.err.println("Error processing JSON response: " + e.toString());
// ignore
}
- Platform.timeCheck("ENS seqproxy2", Platform.TIME_MARK);
return result;
}