private static final Collection<String> bootstrapProperties = new ArrayList<>(
Arrays.asList(JALVIEWLOGLEVEL, BOOTSTRAP_TEST));
+ public static final String PDB_CHAIN_NAME = "PDB_CHAIN_NAME";
+
public static Properties bootstrapProperties(String filename)
{
Properties bootstrapProps = new Properties();
package jalview.ws.dbsources;
import jalview.api.FeatureSettingsModelI;
+import jalview.bin.Cache;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
+import java.util.Locale;
import com.stevesoft.pat.Regex;
@Override
public AlignmentI getSequenceRecords(String queries) throws Exception
{
+ updateConfiguration();
AlignmentI pdbAlignment = null;
String chain = null;
String id = null;
{
// FIXME seems to result in 'PDB|1QIP|1qip|A' - 1QIP is redundant.
// TODO: suggest simplify naming to 1qip|A as default name defined
- pdbcs.setName(jalview.datamodel.DBRefSource.PDB + SEPARATOR + id
+ if (legacyJalviewPDBeName)
+ {
+ pdbcs.setName(jalview.datamodel.DBRefSource.PDB + SEPARATOR + id
+ SEPARATOR + pdbcs.getName());
+ } else {
+ if (simpleChainName)
+ {
+ int sep_pos = pdbcs.getName().indexOf(SEPARATOR);
+ String cid = pdbcs.getName().substring(0,sep_pos);
+ cid = cid.toLowerCase(Locale.ROOT);
+ pdbcs.setName(cid+"_"+pdbcs.getName().substring(sep_pos+1));
+ };
+ }
// Might need to add more metadata to the PDBEntry object
// like below
/*
}
return pdbAlignment;
}
+
+ boolean simpleChainName=false;
+ boolean legacyJalviewPDBeName=true;
+
+ private static String SIMPLE="SIMPLE";
+ private static String LEGACY="LEGACY";
+
+ /**
+ * update the chain naming conventions based on the configuration
+ */
+ private void updateConfiguration()
+ {
+ final String nameConf = Cache.getDefault(Cache.PDB_CHAIN_NAME, "SIMPLE");
+ simpleChainName = SIMPLE.equals(nameConf);
+ legacyJalviewPDBeName = LEGACY.equals(nameConf);
+ }
/*
* (non-Javadoc)