import jalview.util.StringUtils;
import java.awt.Color;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
*/
public class EnsemblGene extends EnsemblSeqProxy
{
+ private static final List<String> CROSS_REFERENCES = Arrays
+ .asList(new String[] { "CCDS" });
+
private static final String GENE_PREFIX = "gene:";
/*
}
Sequence transcript = new Sequence(accId, seqChars, 1, transcriptLength);
- String geneName = (String) transcriptFeature.getValue(NAME);
- if (geneName != null)
+
+ /*
+ * Ensembl has gene name as transcript Name
+ * EnsemblGenomes doesn't, but has a url-encoded description field
+ */
+ String description = (String) transcriptFeature.getValue(NAME);
+ if (description == null)
{
- transcript.setDescription(geneName);
+ description = (String) transcriptFeature.getValue(DESCRIPTION);
+ }
+ if (description != null)
+ {
+ try
+ {
+ transcript.setDescription(URLDecoder.decode(description, "UTF-8"));
+ } catch (UnsupportedEncodingException e)
+ {
+ e.printStackTrace(); // as if
+ }
}
transcript.createDatasetSequence();
List<int[]> mapTo = new ArrayList<int[]>();
mapTo.add(new int[] { 1, transcriptLength });
MapList mapping = new MapList(mappedFrom, mapTo, 1, 1);
- new EnsemblCdna(getDomain()).transferFeatures(
- gene.getSequenceFeatures(), transcript.getDatasetSequence(),
- mapping, parentId);
+ EnsemblCdna cdna = new EnsemblCdna(getDomain());
+ cdna.transferFeatures(gene.getSequenceFeatures(),
+ transcript.getDatasetSequence(), mapping, parentId);
/*
* fetch and save cross-references
*/
- super.getCrossReferences(transcript);
+ cdna.getCrossReferences(transcript);
/*
* and finally fetch the protein product and save as a cross-reference
*/
- new EnsemblCdna(getDomain()).addProteinProduct(transcript);
+ cdna.addProteinProduct(transcript);
return transcript;
}
// found these for ENSG00000157764 on 30/01/2016:
// return new String[] {"Vega_gene", "OTTG", "ENS_LRG_gene", "ArrayExpress",
// "EntrezGene", "HGNC", "MIM_GENE", "MIM_MORBID", "WikiGene"};
- return super.getCrossReferenceDatabases();
+ return CROSS_REFERENCES;
}
/**