import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
-import jalview.datamodel.DBRefSource;
import jalview.datamodel.Mapping;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
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"),
{
// clunky: ensure Uniprot xref if we have one is on mapped sequence
SequenceI ds = proteinSeq.getDatasetSequence();
- ds.setSourceDBRef(proteinSeq.getSourceDBRef());
-
+ // TODO: Verify ensp primary ref is on proteinSeq.getDatasetSequence()
Mapping map = new Mapping(ds, mapList);
- DBRefEntry dbr = new DBRefEntry(getDbSource(), getDbVersion(),
- proteinSeq.getName(), map);
+ DBRefEntry dbr = new DBRefEntry(getDbSource(),
+ getEnsemblDataVersion(), proteinSeq.getName(), map);
querySeq.getDatasetSequence().addDBRef(dbr);
/*
seq = seq.getDatasetSequence();
}
- EnsemblXref xrefFetcher = new EnsemblXref(getDomain());
- List<DBRefEntry> xrefs = xrefFetcher.getCrossReferences(seq.getName(),
- getCrossReferenceDatabases());
+ EnsemblXref xrefFetcher = new EnsemblXref(getDomain(), getDbSource(),
+ getEnsemblDataVersion());
+ List<DBRefEntry> xrefs = xrefFetcher.getCrossReferences(seq.getName());
for (DBRefEntry xref : xrefs)
{
seq.addDBRef(xref);
- /*
- * Save any Uniprot xref to be the reference for SIFTS mapping
- */
- if (DBRefSource.UNIPROT.equals(xref.getSource()))
- {
- seq.setSourceDBRef(xref);
- }
}
/*
* and add a reference to itself
*/
- DBRefEntry self = new DBRefEntry(getDbSource(), "0", seq.getName());
+ DBRefEntry self = new DBRefEntry(getDbSource(),
+ getEnsemblDataVersion(), seq.getName());
seq.addDBRef(self);
}
/**
- * 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;
- }
-
- /**
* Fetches sequences for the list of accession ids and adds them to the
* alignment. Returns the extended (or created) alignment.
*
if (ids.contains(name)
|| ids.contains(name.replace("ENSP", "ENST")))
{
- DBRefUtils.parseToDbRef(sq, DBRefSource.ENSEMBL, "0", name);
+ DBRefEntry dbref = DBRefUtils.parseToDbRef(sq, getDbSource(),
+ getEnsemblDataVersion(), name);
+ sq.addDBRef(dbref);
}
}
if (alignment == null)
SequenceFeature copy = new SequenceFeature(sf);
copy.setBegin(Math.min(mappedRange[0], mappedRange[1]));
copy.setEnd(Math.max(mappedRange[0], mappedRange[1]));
+ if (".".equals(copy.getFeatureGroup()))
+ {
+ copy.setFeatureGroup(getDbSource());
+ }
targetSequence.addSequenceFeature(copy);
/*
{
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)));
}
}
}