*/
public abstract class EnsemblSeqProxy extends EnsemblRestClient
{
+ protected static final String PARENT = "Parent";
+
+ protected static final String ID = "ID";
+
public enum EnsemblSeqType
{
/**
@Override
public AlignmentI getSequenceRecords(String query) throws Exception
{
+ long now = System.currentTimeMillis();
// TODO use a String... query vararg instead?
// danger: accession separator used as a regex here, a string elsewhere
}
inProgress = false;
+ System.out.println(getClass().getName() + " took "
+ + (System.currentTimeMillis() - now) + "ms to fetch");
return alignment;
}
protected void transferFeature(SequenceFeature sf,
SequenceI targetSequence, MapList overlap)
{
- String parent = (String) sf.getValue("Parent");
+ String parent = (String) sf.getValue(PARENT);
if (parent != null && !parent.contains(targetSequence.getName()))
{
// this genomic feature belongs to a different transcript
copy.setBegin(offset + Math.min(mappedRange[0], mappedRange[1]));
copy.setEnd(offset + Math.max(mappedRange[0], mappedRange[1]));
targetSequence.addSequenceFeature(copy);
+
+ /*
+ * for sequence_variant, make an additional feature with consequence
+ */
+ if (SequenceOntology.getInstance().isSequenceVariant(sf.getType()))
+ {
+ String consequence = (String) sf.getValue("consequence_type");
+ if (consequence != null)
+ {
+ SequenceFeature sf2 = new SequenceFeature("consequence",
+ consequence, copy.getBegin(), copy.getEnd(), 0f,
+ null);
+ targetSequence.addSequenceFeature(sf2);
+ }
+ }
}
}