import java.util.List;
import java.util.Map;
-import MCview.PDBChain;
-
/**
* Routines for generating Chimera commands for Jalview/Chimera binding
*
public class ChimeraCommands
{
- private static final String NAMESPACE_PREFIX = "jv_";
+ public static final String NAMESPACE_PREFIX = "jv_";
/**
* Constructs Chimera commands to colour residues as per the Jalview alignment
for (SequenceFeature sf : sfs)
{
String type = sf.getType();
- if (!visibleFeatures.contains(type) || suppressFeature(type))
+
+ /*
+ * Only copy visible features, don't copy any which originated
+ * from Chimera, and suppress uninteresting ones (e.g. RESNUM)
+ */
+ boolean isFromViewer = JalviewChimeraBinding.CHIMERA_FEATURE_GROUP
+ .equals(sf.getFeatureGroup());
+ if (isFromViewer || !visibleFeatures.contains(type))
{
continue;
}
value = type;
}
float score = sf.getScore();
- if (score != 0f && score != Float.NaN)
+ if (score != 0f && !Float.isNaN(score))
{
value = Float.toString(score);
}
}
/**
- * Answers true if the feature type is one we don't wish to propagate to
- * Chimera - for now, RESNUM
- *
- * @param type
- * @return
- */
- static boolean suppressFeature(String type)
- {
- return PDBChain.RESNUM_FEATURE.equals(type);
- }
-
- /**
* Traverse the map of features/values/models/chains/positions to construct a
* list of 'setattr' commands (one per distinct feature type and value).
* <p>