import jalview.io.FileParse;
import jalview.io.gff.SequenceOntologyFactory;
import jalview.io.gff.SequenceOntologyI;
+import jalview.util.Comparison;
import jalview.util.DBRefUtils;
import jalview.util.MapList;
{
private static final String ALLELES = "alleles";
- private static final List<String> CROSS_REFERENCES = Arrays
- .asList(new String[] { "CCDS", "Uniprot/SWISSPROT",
- "Uniprot/SPTREMBL" });
-
- protected static final String CONSEQUENCE_TYPE = "consequence_type";
-
protected static final String PARENT = "Parent";
protected static final String ID = "ID";
GENOMIC("genomic"),
/**
- * type=cdna to fetch dna including UTRs
+ * type=cdna to fetch coding dna including UTRs
*/
CDNA("cdna"),
}
EnsemblXref xrefFetcher = new EnsemblXref(getDomain());
- List<DBRefEntry> xrefs = xrefFetcher.getCrossReferences(seq.getName(),
- getCrossReferenceDatabases());
+ List<DBRefEntry> xrefs = xrefFetcher.getCrossReferences(seq.getName());
for (DBRefEntry xref : xrefs)
{
seq.addDBRef(xref);
seq.setSourceDBRef(xref);
}
}
- }
- /**
- * Returns a list of database names to be used when fetching cross-references.
- * Specifically, the names are used to filter data returned by the Ensembl
- * xrefs REST service on the value in field 'dbname'.
- *
- * @return
- */
- protected List<String> getCrossReferenceDatabases()
- {
- return CROSS_REFERENCES;
+ /*
+ * and add a reference to itself
+ */
+ DBRefEntry self = new DBRefEntry(getDbSource(), "0", seq.getName());
+ seq.addDBRef(self);
}
/**
{
complement.append(",");
}
- if ("HGMD_MUTATION".equalsIgnoreCase(allele))
+
+ /*
+ * some 'alleles' are actually descriptive terms
+ * e.g. HGMD_MUTATION, PhenCode_variation
+ * - we don't want to 'reverse complement' these
+ */
+ if (!Comparison.isNucleotideSequence(allele, true))
{
complement.append(allele);
}
else
{
- char[] alleles = allele.toCharArray();
- for (int i = alleles.length - 1; i >= 0; i--)
+ for (int i = allele.length() - 1; i >= 0; i--)
{
- complement.append(Dna.getComplement(alleles[i]));
+ complement.append(Dna.getComplement(allele.charAt(i)));
}
}
}