public abstract class StructureFile extends AlignFile
{
-
private String id;
- public enum StructureFileType
- {
- PDB, MMCIF, MMTF
- };
-
private PDBEntry.Type dbRefType;
/**
private boolean pdbIdAvailable;
- public StructureFile(String inFile, String type) throws IOException
+ public StructureFile(String inFile, DataSourceType sourceType)
+ throws IOException
{
- super(inFile, type);
+ super(inFile, sourceType);
}
public StructureFile(FileParse fp) throws IOException
}
public StructureFile(boolean parseImmediately, String dataObject,
- String type) throws IOException
+ DataSourceType sourceType) throws IOException
{
- super(parseImmediately, dataObject, type);
+ super(parseImmediately, dataObject, sourceType);
}
public StructureFile(boolean a, FileParse fp) throws IOException
new Object[] {});
AlignmentI al = ((AlignmentI) cl.getMethod("getRNAMLFor",
new Class[] { FileParse.class }).invoke(annotate3d,
- new Object[] { new FileParse(getDataName(), type) }));
+ new Object[] { new FileParse(getDataName(), dataSourceType) }));
for (SequenceI sq : al.getSequences())
{
if (sq.getDatasetSequence() != null)
Class cl = Class.forName("jalview.ext.jmol.JmolParser");
if (cl != null)
{
- final Constructor constructor = cl
- .getConstructor(new Class[] { FileParse.class });
- final Object[] args = new Object[] { new FileParse(getDataName(),
- type) };
+ final Constructor constructor = cl.getConstructor(new Class[] {FileParse.class });
+ final Object[] args = new Object[] { new FileParse(getDataName(), dataSourceType) };
StructureImportSettings.setShowSeqFeatures(false);
StructureImportSettings.setVisibleChainAnnotation(false);
public static boolean isRNA(SequenceI seq)
{
- for (char c : seq.getSequence())
+ int length = seq.getLength();
+ for (int i = 0; i < length; i++)
{
+ char c = seq.getCharAt(i);
if ((c != 'A') && (c != 'C') && (c != 'G') && (c != 'U'))
{
return false;
* make a friendly ID string.
*
* @param dataName
- * @return truncated dataName to after last '/'
+ * @return truncated dataName to after last '/' and pruned .extension if
+ * present
*/
protected String safeName(String dataName)
{
{
dataName = dataName.substring(p + 1);
}
+ if(dataName.indexOf(".") > -1){
+ dataName = dataName.substring(0, dataName.lastIndexOf("."));
+ }
return dataName;
}
{
this.pdbIdAvailable = pdbIdAvailable;
}
-
- public static boolean isStructureFile(String fileType)
- {
- if (fileType == null)
- {
- return false;
- }
- for (StructureFileType sfType : StructureFileType.values())
- {
- if (sfType.name().equalsIgnoreCase(fileType))
- {
- return true;
- }
- }
- return false;
- }
}