1 package jalview.ext.ensembl;
3 import jalview.analysis.AlignmentUtils;
4 import jalview.datamodel.Alignment;
5 import jalview.datamodel.AlignmentI;
6 import jalview.datamodel.DBRefEntry;
7 import jalview.datamodel.DBRefSource;
8 import jalview.datamodel.Mapping;
9 import jalview.datamodel.SequenceFeature;
10 import jalview.datamodel.SequenceI;
11 import jalview.exceptions.JalviewException;
12 import jalview.io.FastaFile;
13 import jalview.io.FileParse;
14 import jalview.io.gff.SequenceOntologyFactory;
15 import jalview.io.gff.SequenceOntologyI;
16 import jalview.schemes.ResidueProperties;
17 import jalview.util.DBRefUtils;
18 import jalview.util.MapList;
19 import jalview.util.MappingUtils;
20 import jalview.util.StringUtils;
22 import java.io.IOException;
23 import java.net.MalformedURLException;
25 import java.util.ArrayList;
26 import java.util.Arrays;
27 import java.util.Collections;
28 import java.util.Comparator;
29 import java.util.LinkedHashMap;
30 import java.util.List;
31 import java.util.Map.Entry;
34 * Base class for Ensembl sequence fetchers
38 public abstract class EnsemblSeqProxy extends EnsemblRestClient
40 private static final List<String> CROSS_REFERENCES = Arrays
41 .asList(new String[] { "CCDS" });
43 protected static final String CONSEQUENCE_TYPE = "consequence_type";
45 protected static final String PARENT = "Parent";
47 protected static final String ID = "ID";
49 protected static final String NAME = "Name";
51 public enum EnsemblSeqType
54 * type=genomic for the full dna including introns
59 * type=cdna for transcribed dna including UTRs
64 * type=cds for coding dna excluding UTRs
69 * type=protein for the peptide product sequence
74 * the value of the 'type' parameter to fetch this version of
79 EnsemblSeqType(String t)
84 public String getType()
92 * A comparator to sort ranges into ascending start position order
94 private class RangeSorter implements Comparator<int[]>
98 RangeSorter(boolean forward)
104 public int compare(int[] o1, int[] o2)
106 return (forwards ? 1 : -1) * Integer.compare(o1[0], o2[0]);
114 public EnsemblSeqProxy()
119 * Makes the sequence queries to Ensembl's REST service and returns an
120 * alignment consisting of the returned sequences.
123 public AlignmentI getSequenceRecords(String query) throws Exception
125 // TODO use a String... query vararg instead?
127 // danger: accession separator used as a regex here, a string elsewhere
128 // in this case it is ok (it is just a space), but (e.g.) '\' would not be
129 List<String> allIds = Arrays.asList(query
130 .split(getAccessionSeparator()));
131 AlignmentI alignment = null;
135 * execute queries, if necessary in batches of the
136 * maximum allowed number of ids
138 int maxQueryCount = getMaximumQueryCount();
139 for (int v = 0, vSize = allIds.size(); v < vSize; v += maxQueryCount)
141 int p = Math.min(vSize, v + maxQueryCount);
142 List<String> ids = allIds.subList(v, p);
145 alignment = fetchSequences(ids, alignment);
146 } catch (Throwable r)
149 String msg = "Aborting ID retrieval after " + v
150 + " chunks. Unexpected problem (" + r.getLocalizedMessage()
152 System.err.println(msg);
154 // if (alignment != null)
156 // break; // return what we got
160 // throw new JalviewException(msg, r);
166 * fetch and transfer genomic sequence features,
167 * fetch protein product and add as cross-reference
169 for (String accId : allIds)
171 addFeaturesAndProduct(accId, alignment);
174 for (SequenceI seq : alignment.getSequences())
176 getCrossReferences(seq);
183 * Fetches Ensembl features using the /overlap REST endpoint, and adds them to
184 * the sequence in the alignment. Also fetches the protein product, maps it
185 * from the CDS features of the sequence, and saves it as a cross-reference of
191 protected void addFeaturesAndProduct(String accId, AlignmentI alignment)
193 if (alignment == null)
201 * get 'dummy' genomic sequence with exon, cds and variation features
203 SequenceI genomicSequence = null;
204 EnsemblOverlap gffFetcher = new EnsemblOverlap();
205 EnsemblFeatureType[] features = getFeaturesToFetch();
206 AlignmentI geneFeatures = gffFetcher.getSequenceRecords(accId,
208 if (geneFeatures.getHeight() > 0)
210 genomicSequence = geneFeatures.getSequenceAt(0);
212 if (genomicSequence != null)
215 * transfer features to the query sequence
217 SequenceI querySeq = alignment.findName(accId);
218 if (transferFeatures(accId, genomicSequence, querySeq))
222 * fetch and map protein product, and add it as a cross-reference
223 * of the retrieved sequence
225 addProteinProduct(querySeq);
228 } catch (IOException e)
230 System.err.println("Error transferring Ensembl features: "
236 * Returns those sequence feature types to fetch from Ensembl. We may want
237 * features either because they are of interest to the user, or as means to
238 * identify the locations of the sequence on the genomic sequence (CDS
239 * features identify CDS, exon features identify cDNA etc).
243 protected abstract EnsemblFeatureType[] getFeaturesToFetch();
246 * Fetches and maps the protein product, and adds it as a cross-reference of
247 * the retrieved sequence
249 protected void addProteinProduct(SequenceI querySeq)
251 String accId = querySeq.getName();
254 AlignmentI protein = new EnsemblProtein().getSequenceRecords(accId);
255 if (protein == null || protein.getHeight() == 0)
257 System.out.println("Failed to retrieve protein for " + accId);
260 SequenceI proteinSeq = protein.getSequenceAt(0);
263 * need dataset sequences (to be the subject of mappings)
265 proteinSeq.createDatasetSequence();
266 querySeq.createDatasetSequence();
268 MapList mapList = mapCdsToProtein(querySeq, proteinSeq);
271 Mapping map = new Mapping(proteinSeq.getDatasetSequence(), mapList);
272 DBRefEntry dbr = new DBRefEntry(getDbSource(), getDbVersion(),
274 querySeq.getDatasetSequence().addDBRef(dbr);
277 * compute peptide variants from dna variants and add as
278 * sequence features on the protein sequence ta-da
280 computeProteinFeatures(querySeq, proteinSeq, mapList);
282 } catch (Exception e)
285 .println(String.format("Error retrieving protein for %s: %s",
286 accId, e.getMessage()));
291 * Get Uniprot and PDB xrefs from Ensembl, and attach them to the protein
296 protected void getCrossReferences(SequenceI seq)
298 while (seq.getDatasetSequence() != null)
300 seq = seq.getDatasetSequence();
303 EnsemblXref xrefFetcher = new EnsemblXref();
304 List<DBRefEntry> xrefs = xrefFetcher.getCrossReferences(seq.getName(),
305 getCrossReferenceDatabases());
306 for (DBRefEntry xref : xrefs)
310 * Save any Uniprot xref to be the reference for SIFTS mapping
312 if (DBRefSource.UNIPROT.equals(xref.getSource()))
314 seq.setSourceDBRef(xref);
320 * Returns a list of database names to be used when fetching cross-references.
324 protected List<String> getCrossReferenceDatabases()
326 return CROSS_REFERENCES;
330 * Returns a mapping from dna to protein by inspecting sequence features of
331 * type "CDS" on the dna.
337 protected MapList mapCdsToProtein(SequenceI dnaSeq, SequenceI proteinSeq)
339 List<int[]> ranges = new ArrayList<int[]>(50);
341 int mappedDnaLength = getCdsRanges(dnaSeq, ranges);
343 int proteinLength = proteinSeq.getLength();
344 List<int[]> proteinRange = new ArrayList<int[]>();
345 int proteinStart = 1;
348 * incomplete start codon may mean X at start of peptide
349 * we ignore both for mapping purposes
351 if (proteinSeq.getCharAt(0) == 'X')
356 proteinRange.add(new int[] { proteinStart, proteinLength });
359 * dna length should map to protein (or protein plus stop codon)
361 int codesForResidues = mappedDnaLength / 3;
362 if (codesForResidues == proteinLength
363 || codesForResidues == (proteinLength + 1))
365 return new MapList(ranges, proteinRange, 3, 1);
371 * Adds CDS ranges to the ranges list, and returns the total length mapped
374 * No need to worry about reverse strand dna, here since the retrieved
375 * sequence is as transcribed (reverse complement for reverse strand), i.e in
376 * the same sense as the peptide.
382 protected int getCdsRanges(SequenceI dnaSeq, List<int[]> ranges)
384 SequenceFeature[] sfs = dnaSeq.getSequenceFeatures();
389 int mappedDnaLength = 0;
390 for (SequenceFeature sf : sfs)
393 * process a CDS feature (or a sub-type of CDS)
395 if (SequenceOntologyFactory.getInstance().isA(sf.getType(),
396 SequenceOntologyI.CDS))
400 phase = Integer.parseInt(sf.getPhase());
401 } catch (NumberFormatException e)
406 * phase > 0 on first codon means 5' incomplete - skip to the start
407 * of the next codon; example ENST00000496384
409 int begin = sf.getBegin();
410 int end = sf.getEnd();
411 if (ranges.isEmpty() && phase > 0)
416 continue; // shouldn't happen?
419 ranges.add(new int[] { begin, end });
420 mappedDnaLength += Math.abs(end - begin) + 1;
423 return mappedDnaLength;
427 * Fetches sequences for the list of accession ids and adds them to the
428 * alignment. Returns the extended (or created) alignment.
433 * @throws JalviewException
434 * @throws IOException
436 protected AlignmentI fetchSequences(List<String> ids, AlignmentI alignment)
437 throws JalviewException, IOException
439 if (!isEnsemblAvailable())
442 throw new JalviewException("ENSEMBL Rest API not available.");
444 FileParse fp = getSequenceReader(ids);
445 FastaFile fr = new FastaFile(fp);
446 if (fr.hasWarningMessage())
448 System.out.println(String.format(
449 "Warning when retrieving %d ids %s\n%s", ids.size(),
450 ids.toString(), fr.getWarningMessage()));
452 else if (fr.getSeqs().size() != ids.size())
454 System.out.println(String.format(
455 "Only retrieved %d sequences for %d query strings", fr
456 .getSeqs().size(), ids.size()));
459 if (fr.getSeqs().size() == 1 && fr.getSeqs().get(0).getLength() == 0)
462 * POST request has returned an empty FASTA file e.g. for invalid id
464 throw new IOException("No data returned for " + ids);
467 if (fr.getSeqs().size() > 0)
469 AlignmentI seqal = new Alignment(
470 fr.getSeqsAsArray());
471 for (SequenceI sq:seqal.getSequences())
473 if (sq.getDescription() == null)
475 sq.setDescription(getDbName());
477 String name = sq.getName();
478 if (ids.contains(name)
479 || ids.contains(name.replace("ENSP", "ENST")))
481 DBRefUtils.parseToDbRef(sq, DBRefSource.ENSEMBL, "0", name);
484 if (alignment == null)
490 alignment.append(seqal);
497 * Returns the URL for the REST call
500 * @throws MalformedURLException
503 protected URL getUrl(List<String> ids) throws MalformedURLException
506 * a single id is included in the URL path
507 * multiple ids go in the POST body instead
509 StringBuffer urlstring = new StringBuffer(128);
510 urlstring.append(SEQUENCE_ID_URL);
513 urlstring.append("/").append(ids.get(0));
515 // @see https://github.com/Ensembl/ensembl-rest/wiki/Output-formats
516 urlstring.append("?type=").append(getSourceEnsemblType().getType());
517 urlstring.append(("&Accept=text/x-fasta"));
519 URL url = new URL(urlstring.toString());
524 * A sequence/id POST request currently allows up to 50 queries
526 * @see http://rest.ensembl.org/documentation/info/sequence_id_post
529 public int getMaximumQueryCount()
535 protected boolean useGetRequest()
541 protected String getRequestMimeType(boolean multipleIds)
543 return multipleIds ? "application/json" : "text/x-fasta";
547 protected String getResponseMimeType()
549 return "text/x-fasta";
554 * @return the configured sequence return type for this source
556 protected abstract EnsemblSeqType getSourceEnsemblType();
559 * Returns a list of [start, end] genomic ranges corresponding to the sequence
562 * The correspondence between the frames of reference is made by locating
563 * those features on the genomic sequence which identify the retrieved
564 * sequence. Specifically
566 * <li>genomic sequence is identified by "transcript" features with
567 * ID=transcript:transcriptId</li>
568 * <li>cdna sequence is identified by "exon" features with
569 * Parent=transcript:transcriptId</li>
570 * <li>cds sequence is identified by "CDS" features with
571 * Parent=transcript:transcriptId</li>
574 * The returned ranges are sorted to run forwards (for positive strand) or
575 * backwards (for negative strand). Aborts and returns null if both positive
576 * and negative strand are found (this should not normally happen).
578 * @param sourceSequence
581 * the start position of the sequence we are mapping to
584 protected MapList getGenomicRangesFromFeatures(SequenceI sourceSequence,
585 String accId, int start)
587 SequenceFeature[] sfs = sourceSequence.getSequenceFeatures();
594 * generously initial size for number of cds regions
595 * (worst case titin Q8WZ42 has c. 313 exons)
597 List<int[]> regions = new ArrayList<int[]>(100);
598 int mappedLength = 0;
599 int direction = 1; // forward
600 boolean directionSet = false;
602 for (SequenceFeature sf : sfs)
605 * accept the target feature type or a specialisation of it
606 * (e.g. coding_exon for exon)
608 if (identifiesSequence(sf, accId))
610 int strand = sf.getStrand();
611 strand = strand == 0 ? 1 : strand; // treat unknown as forward
613 if (directionSet && strand != direction)
615 // abort - mix of forward and backward
616 System.err.println("Error: forward and backward strand for "
624 * add to CDS ranges, semi-sorted forwards/backwards
628 regions.add(0, new int[] { sf.getEnd(), sf.getBegin() });
632 regions.add(new int[] { sf.getBegin(), sf.getEnd() });
634 mappedLength += Math.abs(sf.getEnd() - sf.getBegin() + 1);
639 * 'gene' sequence is contiguous so we can stop as soon as its
640 * identifying feature has been found
647 if (regions.isEmpty())
649 System.out.println("Failed to identify target sequence for " + accId
650 + " from genomic features");
655 * a final sort is needed since Ensembl returns CDS sorted within source
656 * (havana / ensembl_havana)
658 Collections.sort(regions, new RangeSorter(direction == 1));
660 List<int[]> to = Arrays.asList(new int[] { start,
661 start + mappedLength - 1 });
663 return new MapList(regions, to, 1, 1);
667 * Answers true if the sequence being retrieved may occupy discontiguous
668 * regions on the genomic sequence.
670 protected boolean isSpliceable()
676 * Returns true if the sequence feature marks positions of the genomic
677 * sequence feature which are within the sequence being retrieved. For
678 * example, an 'exon' feature whose parent is the target transcript marks the
679 * cdna positions of the transcript.
685 protected abstract boolean identifiesSequence(SequenceFeature sf,
689 * Transfers the sequence feature to the target sequence, locating its start
690 * and end range based on the mapping. Features which do not overlap the
691 * target sequence are ignored.
694 * @param targetSequence
696 * mapping from the sequence feature's coordinates to the target
699 protected void transferFeature(SequenceFeature sf,
700 SequenceI targetSequence, MapList mapping)
702 int start = sf.getBegin();
703 int end = sf.getEnd();
704 int[] mappedRange = mapping.locateInTo(start, end);
706 if (mappedRange != null)
708 SequenceFeature copy = new SequenceFeature(sf);
709 copy.setBegin(Math.min(mappedRange[0], mappedRange[1]));
710 copy.setEnd(Math.max(mappedRange[0], mappedRange[1]));
711 targetSequence.addSequenceFeature(copy);
714 * for sequence_variant, make an additional feature with consequence
716 if (SequenceOntologyFactory.getInstance().isA(sf.getType(),
717 SequenceOntologyI.SEQUENCE_VARIANT))
719 String consequence = (String) sf.getValue(CONSEQUENCE_TYPE);
720 if (consequence != null)
722 SequenceFeature sf2 = new SequenceFeature("consequence",
723 consequence, copy.getBegin(), copy.getEnd(), 0f,
725 targetSequence.addSequenceFeature(sf2);
732 * Transfers features from sourceSequence to targetSequence
735 * @param sourceSequence
736 * @param targetSequence
737 * @return true if any features were transferred, else false
739 protected boolean transferFeatures(String accessionId,
740 SequenceI sourceSequence, SequenceI targetSequence)
742 if (sourceSequence == null || targetSequence == null)
747 SequenceFeature[] sfs = sourceSequence.getSequenceFeatures();
748 MapList mapping = getGenomicRangesFromFeatures(sourceSequence, accessionId,
749 targetSequence.getStart());
755 return transferFeatures(sfs, targetSequence, mapping, accessionId);
759 * Transfer features to the target sequence. The start/end positions are
760 * converted using the mapping. Features which do not overlap are ignored.
761 * Features whose parent is not the specified identifier are also ignored.
764 * @param targetSequence
769 protected boolean transferFeatures(SequenceFeature[] features,
770 SequenceI targetSequence, MapList mapping, String parentId)
772 final boolean forwardStrand = mapping.isFromForwardStrand();
775 * sort features by start position (descending if reverse strand)
776 * before transferring (in forwards order) to the target sequence
778 Arrays.sort(features, new Comparator<SequenceFeature>()
781 public int compare(SequenceFeature o1, SequenceFeature o2)
783 int c = Integer.compare(o1.getBegin(), o2.getBegin());
784 return forwardStrand ? c : -c;
788 boolean transferred = false;
789 for (SequenceFeature sf : features)
791 if (retainFeature(sf, parentId))
793 transferFeature(sf, targetSequence, mapping);
801 * Answers true if the feature type is one we want to keep for the sequence.
802 * Some features are only retrieved in order to identify the sequence range,
803 * and may then be discarded as redundant information (e.g. "CDS" feature for
806 @SuppressWarnings("unused")
807 protected boolean retainFeature(SequenceFeature sf, String accessionId)
809 return true; // override as required
813 * Answers true if the feature has a Parent which refers to the given
814 * accession id, or if the feature has no parent. Answers false if the
815 * feature's Parent is for a different accession id.
821 protected boolean featureMayBelong(SequenceFeature sf, String identifier)
823 String parent = (String) sf.getValue(PARENT);
824 // using contains to allow for prefix "gene:", "transcript:" etc
825 if (parent != null && !parent.contains(identifier))
827 // this genomic feature belongs to a different transcript
834 public String getDescription()
836 return "Ensembl " + getSourceEnsemblType().getType()
837 + " sequence with variant features";
841 * Returns a (possibly empty) list of features on the sequence which have the
842 * specified sequence ontology type (or a sub-type of it), and the given
843 * identifier as parent
850 protected List<SequenceFeature> findFeatures(SequenceI sequence,
851 String type, String parentId)
853 List<SequenceFeature> result = new ArrayList<SequenceFeature>();
855 SequenceFeature[] sfs = sequence.getSequenceFeatures();
857 SequenceOntologyI so = SequenceOntologyFactory.getInstance();
858 for (SequenceFeature sf :sfs) {
859 if (so.isA(sf.getType(), type))
861 String parent = (String) sf.getValue(PARENT);
862 if (parent.equals(parentId))
873 * Maps exon features from dna to protein, and computes variants in peptide
874 * product generated by variants in dna, and adds them as sequence_variant
875 * features on the protein sequence. Returns the number of variant features
880 * @param dnaToProtein
882 static int computeProteinFeatures(SequenceI dnaSeq,
883 SequenceI peptide, MapList dnaToProtein)
885 while (dnaSeq.getDatasetSequence() != null)
887 dnaSeq = dnaSeq.getDatasetSequence();
889 while (peptide.getDatasetSequence() != null)
891 peptide = peptide.getDatasetSequence();
894 AlignmentUtils.transferFeatures(dnaSeq, peptide, dnaToProtein,
895 SequenceOntologyI.EXON);
897 LinkedHashMap<Integer, String[][]> variants = buildDnaVariantsMap(
898 dnaSeq, dnaToProtein);
901 * scan codon variations, compute peptide variants and add to peptide sequence
904 for (Entry<Integer, String[][]> variant : variants.entrySet())
906 int peptidePos = variant.getKey();
907 String[][] codonVariants = variant.getValue();
908 String residue = String.valueOf(peptide.getCharAt(peptidePos - 1)); // 0-based
909 List<String> peptideVariants = computePeptideVariants(codonVariants,
911 if (!peptideVariants.isEmpty())
913 String desc = StringUtils.listToDelimitedString(peptideVariants,
915 SequenceFeature sf = new SequenceFeature(
916 SequenceOntologyI.SEQUENCE_VARIANT, desc, peptidePos,
917 peptidePos, 0f, null);
918 peptide.addSequenceFeature(sf);
926 * Builds a map whose key is position in the protein sequence, and value is an
927 * array of all variants for the coding codon positions
930 * @param dnaToProtein
933 static LinkedHashMap<Integer, String[][]> buildDnaVariantsMap(
934 SequenceI dnaSeq, MapList dnaToProtein)
937 * map from peptide position to all variant features of the codon for it
938 * LinkedHashMap ensures we add the peptide features in sequence order
940 LinkedHashMap<Integer, String[][]> variants = new LinkedHashMap<Integer, String[][]>();
941 SequenceOntologyI so = SequenceOntologyFactory.getInstance();
943 SequenceFeature[] dnaFeatures = dnaSeq.getSequenceFeatures();
944 if (dnaFeatures == null)
949 int dnaStart = dnaSeq.getStart();
950 int[] lastCodon = null;
951 int lastPeptidePostion = 0;
954 * build a map of codon variations for peptides
956 for (SequenceFeature sf : dnaFeatures)
958 int dnaCol = sf.getBegin();
959 if (dnaCol != sf.getEnd())
961 // not handling multi-locus variant features
964 if (so.isA(sf.getType(), SequenceOntologyI.SEQUENCE_VARIANT))
966 int[] mapsTo = dnaToProtein.locateInTo(dnaCol, dnaCol);
969 // feature doesn't lie within coding region
972 int peptidePosition = mapsTo[0];
973 String[][] codonVariants = variants.get(peptidePosition);
974 if (codonVariants == null)
976 codonVariants = new String[3][];
977 variants.put(peptidePosition, codonVariants);
981 * extract dna variants to a string array
983 String alls = (String) sf.getValue("alleles");
988 String[] alleles = alls.split(",");
991 * get this peptides codon positions e.g. [3, 4, 5] or [4, 7, 10]
993 int[] codon = peptidePosition == lastPeptidePostion ? lastCodon
994 : MappingUtils.flattenRanges(dnaToProtein.locateInFrom(
995 peptidePosition, peptidePosition));
996 lastPeptidePostion = peptidePosition;
1000 * save nucleotide (and this variant) for each codon position
1002 for (int codonPos = 0; codonPos < 3; codonPos++)
1004 String nucleotide = String.valueOf(dnaSeq
1005 .getCharAt(codon[codonPos] - dnaStart));
1006 if (codon[codonPos] == dnaCol)
1009 * record current dna base and its alleles
1011 String[] dnaVariants = new String[alleles.length + 1];
1012 dnaVariants[0] = nucleotide;
1013 System.arraycopy(alleles, 0, dnaVariants, 1, alleles.length);
1014 codonVariants[codonPos] = dnaVariants;
1016 else if (codonVariants[codonPos] == null)
1019 * record current dna base only
1020 * (at least until we find any variation and overwrite it)
1022 codonVariants[codonPos] = new String[] { nucleotide };
1031 * Returns a sorted, non-redundant list of all peptide translations generated
1032 * by the given dna variants, excluding the current residue value
1034 * @param codonVariants
1035 * an array of base values (acgtACGT) for codon positions 1, 2, 3
1037 * the current residue translation
1040 static List<String> computePeptideVariants(
1041 String[][] codonVariants, String residue)
1043 List<String> result = new ArrayList<String>();
1044 for (String base1 : codonVariants[0])
1046 for (String base2 : codonVariants[1])
1048 for (String base3 : codonVariants[2])
1050 String codon = base1 + base2 + base3;
1051 // TODO: report frameshift/insertion/deletion
1052 // and multiple-base variants?!
1053 String peptide = codon.contains("-") ? "-" : ResidueProperties
1054 .codonTranslate(codon);
1055 if (peptide != null && !result.contains(peptide)
1056 && !peptide.equalsIgnoreCase(residue))
1058 result.add(peptide);
1065 * sort alphabetically with STOP at the end
1067 Collections.sort(result, new Comparator<String>()
1071 public int compare(String o1, String o2)
1073 if ("STOP".equals(o1))
1077 else if ("STOP".equals(o2))
1083 return o1.compareTo(o2);
1091 * Answers true if the feature type is either 'NMD_transcript_variant' or
1092 * 'transcript' or one of its sub-types in the Sequence Ontology. This is
1093 * needed because NMD_transcript_variant behaves like 'transcript' in Ensembl
1094 * although strictly speaking it is not (it is a sub-type of
1095 * sequence_variant).
1097 * @param featureType
1100 public static boolean isTranscript(String featureType)
1102 return SequenceOntologyI.NMD_TRANSCRIPT_VARIANT.equals(featureType)
1103 || SequenceOntologyFactory.getInstance().isA(featureType,
1104 SequenceOntologyI.TRANSCRIPT);