SequenceI[] selectedSeqs)
{
ThreeDBStructureChooserQuerySource tdbSource = new ThreeDBStructureChooserQuerySource();
- boolean hasUniprot=false;
+ boolean hasUniprot=false,hasCanonical=false;
boolean hasNA=false,hasProtein=false;
- for (SequenceI seq:selectedSeqs)
+ int protWithoutUni=0;
+ for (SequenceI seq : selectedSeqs)
{
- hasNA|=!seq.isProtein();
+ hasNA |= !seq.isProtein();
hasProtein |= seq.isProtein();
if (seq.isProtein())
{
- String query = tdbSource.buildQuery(seq);
- if (query!=null && query.length()>0)
+ int refsAvailable = ThreeDBStructureChooserQuerySource.checkUniprotRefs(seq.getDBRefs());
+ if (refsAvailable > -2)
{
- hasUniprot=true;
+ if (refsAvailable > -1)
+ hasCanonical = true;
}
+ hasUniprot = true;
+ }
+ else
+ {
+ protWithoutUni++;
}
}
+ //
+ // logic: all canonicals - no fetchdb
+ // some uniprot no canonicals: prompt do fetchDb for remaining
+ // no uniprot but protein: offer 3d-beacons search
+ //
if (hasProtein && hasUniprot && !hasNA)
{
return tdbSource;