1 package jalview.ext.ensembl;
3 import jalview.datamodel.SequenceFeature;
6 * A client to fetch genomic sequence from Ensembl
8 * TODO: not currently used - delete?
13 public class EnsemblGenome extends EnsemblSeqProxy
16 * fetch transcript features on genomic sequence (to identify the transcript
17 * regions) and cds, exon and variation features (to retain)
19 private static final EnsemblFeatureType[] FEATURES_TO_FETCH = {
20 EnsemblFeatureType.transcript, EnsemblFeatureType.exon,
21 EnsemblFeatureType.cds, EnsemblFeatureType.variation };
24 * Default constructor (to use rest.ensembl.org)
26 public EnsemblGenome()
32 * Constructor given the target domain to fetch data from
36 public EnsemblGenome(String d)
42 public String getDbName()
44 return "ENSEMBL (Genomic)";
48 protected EnsemblSeqType getSourceEnsemblType()
50 return EnsemblSeqType.GENOMIC;
54 protected EnsemblFeatureType[] getFeaturesToFetch()
56 return FEATURES_TO_FETCH;
60 * Answers true unless the feature type is 'transcript' (or a sub-type of
61 * transcript in the Sequence Ontology), or has a parent other than the given
62 * accession id. Transcript features are only retrieved in order to identify
63 * the transcript sequence range, and are redundant information on the
64 * transcript sequence itself.
67 protected boolean retainFeature(SequenceFeature sf, String accessionId)
69 if (isTranscript(sf.getType()))
73 return featureMayBelong(sf, accessionId);
77 * Answers true if the sequence feature type is 'transcript' (or a subtype of
78 * transcript in the Sequence Ontology), and the ID of the feature is the
79 * transcript we are retrieving
82 protected boolean identifiesSequence(SequenceFeature sf, String accId)
84 if (isTranscript(sf.getType()))
86 String id = (String) sf.getValue(ID);
87 if (("transcript:" + accId).equals(id))