* fetch and transfer genomic sequence features,
* fetch protein product and add as cross-reference
*/
* fetch and transfer genomic sequence features,
* fetch protein product and add as cross-reference
*/
SequenceI genomicSequence = null;
EnsemblFeatures gffFetcher = new EnsemblFeatures(getDomain());
EnsemblFeatureType[] features = getFeaturesToFetch();
SequenceI genomicSequence = null;
EnsemblFeatures gffFetcher = new EnsemblFeatures(getDomain());
EnsemblFeatureType[] features = getFeaturesToFetch();
AlignmentI geneFeatures = gffFetcher.getSequenceRecords(accId,
features);
if (geneFeatures != null && geneFeatures.getHeight() > 0)
{
genomicSequence = geneFeatures.getSequenceAt(0);
}
AlignmentI geneFeatures = gffFetcher.getSequenceRecords(accId,
features);
if (geneFeatures != null && geneFeatures.getHeight() > 0)
{
genomicSequence = geneFeatures.getSequenceAt(0);
}
* fetch and map protein product, and add it as a cross-reference
* of the retrieved sequence
*/
* fetch and map protein product, and add it as a cross-reference
* of the retrieved sequence
*/
EnsemblXref xrefFetcher = new EnsemblXref(getDomain(), getDbSource(),
getEnsemblDataVersion());
List<DBRefEntry> xrefs = xrefFetcher.getCrossReferences(seq.getName());
for (int i = 0, n = xrefs.size(); i < n; i++)
{
EnsemblXref xrefFetcher = new EnsemblXref(getDomain(), getDbSource(),
getEnsemblDataVersion());
List<DBRefEntry> xrefs = xrefFetcher.getCrossReferences(seq.getName());
for (int i = 0, n = xrefs.size(); i < n; i++)
{
// 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));
}
// 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));
}
* for now, assumes only one sequence returned; refactor if needed
* in future to handle a JSONArray with more than one
*/
* for now, assumes only one sequence returned; refactor if needed
* in future to handle a JSONArray with more than one
*/
Map<String, Object> val = (Map<String, Object>) getJSON(null, ids, -1, MODE_MAP, null);
if (val == null)
return null;
Map<String, Object> val = (Map<String, Object>) getJSON(null, ids, -1, MODE_MAP, null);
if (val == null)
return null;
*/
protected abstract List<SequenceFeature> getIdentifyingFeatures(
SequenceI seq, String accId);
*/
protected abstract List<SequenceFeature> getIdentifyingFeatures(
SequenceI seq, String accId);
/**
* Transfers the sequence feature to the target sequence, locating its start
* and end range based on the mapping. Features which do not overlap the
/**
* Transfers the sequence feature to the target sequence, locating its start
* and end range based on the mapping. Features which do not overlap the
}
int newBegin = Math.min(mappedRange[0], mappedRange[1]);
int newEnd = Math.max(mappedRange[0], mappedRange[1]);
}
int newBegin = Math.min(mappedRange[0], mappedRange[1]);
int newEnd = Math.max(mappedRange[0], mappedRange[1]);
- SequenceFeature copy = new SequenceFeature(sf, newBegin, newEnd,
- group, sf.getScore());
+// Platform.timeCheck(null, Platform.TIME_MARK);
+ bhtest++;
+ // 280 ms/1000 here:
+ SequenceFeature copy = new SequenceFeature(sf, newBegin, newEnd, group, sf.getScore());
+ // 0.175 ms here:
MapList mapping = getGenomicRangesFromFeatures(sourceSequence,
accessionId, targetSequence.getStart());
if (mapping == null)
MapList mapping = getGenomicRangesFromFeatures(sourceSequence,
accessionId, targetSequence.getStart());
if (mapping == null)
boolean result = transferFeatures(sfs, targetSequence, mapping,
accessionId);
// System.out.println("transferFeatures (" + (sfs.size()) + " --> "
boolean result = transferFeatures(sfs, targetSequence, mapping,
accessionId);
// System.out.println("transferFeatures (" + (sfs.size()) + " --> "
SequenceFeatures.sortFeatures(sfs, forwardStrand);
boolean transferred = false;
SequenceFeatures.sortFeatures(sfs, forwardStrand);
boolean transferred = false;
if (retainFeature(sf, parentId))
{
transferFeature(sf, targetSequence, mapping, forwardStrand);
transferred = true;
}
}
if (retainFeature(sf, parentId))
{
transferFeature(sf, targetSequence, mapping, forwardStrand);
transferred = true;
}
}