X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FStructureFile.java;h=084f8869e5a85e6468bdef9ec61574ef8e7db6fc;hb=51b0b157926ed477cb558ca5971126bf9fccbd31;hp=40bb8bee96a75f0317f1001c0317e999a469e3c5;hpb=3d0101179759ef157b088ea135423cd909512d9f;p=jalview.git diff --git a/src/jalview/io/StructureFile.java b/src/jalview/io/StructureFile.java index 40bb8be..084f886 100644 --- a/src/jalview/io/StructureFile.java +++ b/src/jalview/io/StructureFile.java @@ -38,7 +38,7 @@ import java.lang.reflect.Constructor; import java.util.List; import java.util.Vector; -import MCview.PDBChain; +import mc_view.PDBChain; public abstract class StructureFile extends AlignFile { @@ -68,7 +68,7 @@ public abstract class StructureFile extends AlignFile private boolean pdbIdAvailable; - public StructureFile(String inFile, DataSourceType sourceType) + public StructureFile(Object inFile, DataSourceType sourceType) throws IOException { super(inFile, sourceType); @@ -98,7 +98,7 @@ public abstract class StructureFile extends AlignFile } - public StructureFile(boolean parseImmediately, String dataObject, + public StructureFile(boolean parseImmediately, Object dataObject, DataSourceType sourceType) throws IOException { super(parseImmediately, dataObject, sourceType); @@ -341,8 +341,15 @@ public abstract class StructureFile extends AlignFile } StructureImportSettings.setShowSeqFeatures(true); } - - public PDBChain findChain(String id) throws Exception + + /** + * Answers the first PDBChain found matching the given id, or null if none + * is found + * + * @param id + * @return + */ + public PDBChain findChain(String id) { for (PDBChain chain : getChains()) { @@ -351,7 +358,7 @@ public abstract class StructureFile extends AlignFile return chain; } } - throw new Exception("PDB chain not Found!"); + return null; } public void makeResidueList() @@ -397,8 +404,10 @@ public abstract class StructureFile extends AlignFile 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;