if (accAnnotations != null && accAnnotations.containsKey("AC"))
{
- if (dbsource != null)
+ String dbr = (String) accAnnotations.get("AC");
+ if (dbr != null)
{
- String dbr = (String) accAnnotations.get("AC");
- if (dbr != null)
- {
- // we could get very clever here - but for now - just try to
- // guess accession type from source of alignment plus structure
- // of accession
- guessDatabaseFor(seqO, dbr, dbsource);
-
- }
+ // we could get very clever here - but for now - just try to
+ // guess accession type from type of sequence, source of alignment plus
+ // structure
+ // of accession
+ guessDatabaseFor(seqO, dbr, dbsource);
}
// else - do what ? add the data anyway and prompt the user to
// specify what references these are ?
st = -1;
}
}
+ if (dbsource == null)
+ {
+ // make up an origin based on whether the sequence looks like it is nucleotide
+ // or protein
+ dbsource = (seqO.isProtein()) ? "PFAM" : "RFAM";
+ }
if (dbsource.equals("PFAM"))
{
seqdb = "UNIPROT";
int maxid = 0;
int in = 0;
Hashtable dataRef = null;
+ boolean isAA = s[in].isProtein();
while ((in < s.length) && (s[in] != null))
{
- boolean isAA = s[in].isProtein();
+
String tmp = printId(s[in], jvSuffix);
max = Math.max(max, s[in].getLength());
String type = (String) dataRef.remove(idd);
out.append(new Format("%-" + (maxid - 2) + "s")
.form("#=GS " + idd.toString() + " "));
- if (type.contains("PFAM") || type.contains("RFAM"))
+ if (isAA && type.contains("UNIPROT")
+ || (!isAA && type.contains("EMBL")))
{
out.append(" AC " + type.substring(type.indexOf(";") + 1));