X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fio%2FRnamlFile.java;h=955199270ef37f9b579491abb4dda3b1fbfb3ab4;hb=564c47bdd60cf84046269e45d2f85f39408e4441;hp=9852c75b9d29200d2dff2e6f6a20c3145bacb0ca;hpb=db93a1adcbe0a4eaaf06e0a70ade0d6c5c1961c3;p=jalview.git diff --git a/src/jalview/io/RnamlFile.java b/src/jalview/io/RnamlFile.java index 9852c75..9551992 100644 --- a/src/jalview/io/RnamlFile.java +++ b/src/jalview/io/RnamlFile.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2) - * Copyright (C) 2015 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -26,6 +26,7 @@ import jalview.datamodel.Annotation; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; import jalview.util.MessageManager; +import jalview.util.Platform; import java.io.BufferedReader; import java.io.FileNotFoundException; @@ -54,7 +55,7 @@ public class RnamlFile extends AlignFile } - public RnamlFile(String inFile, String type) throws IOException + public RnamlFile(String inFile, DataSourceType type) throws IOException { super(inFile, type); @@ -103,35 +104,35 @@ public class RnamlFile extends AlignFile } catch (ExceptionPermissionDenied pdx) { errormessage = MessageManager.formatMessage( - "exception.rnaml_couldnt_access_datasource", - new String[] { pdx.getMessage() }); + "exception.rnaml_couldnt_access_datasource", new String[] + { pdx.getMessage() }); throw new IOException(pdx); } catch (ExceptionLoadingFailed lf) { errormessage = MessageManager.formatMessage( - "exception.ranml_couldnt_process_data", - new String[] { lf.getMessage() }); + "exception.ranml_couldnt_process_data", new String[] + { lf.getMessage() }); throw new IOException(lf); } catch (ExceptionFileFormatOrSyntax iff) { - errormessage = MessageManager.formatMessage( - "exception.ranml_invalid_file", - new String[] { iff.getMessage() }); + errormessage = MessageManager + .formatMessage("exception.ranml_invalid_file", new String[] + { iff.getMessage() }); throw new IOException(iff); } catch (Exception x) { error = true; errormessage = MessageManager.formatMessage( - "exception.ranml_problem_parsing_data", - new String[] { x.getMessage() }); + "exception.ranml_problem_parsing_data", new String[] + { x.getMessage() }); throw new IOException(errormessage, x); } } @SuppressWarnings("unchecked") - public void _parse() throws FileNotFoundException, - ExceptionPermissionDenied, ExceptionLoadingFailed, - ExceptionFileFormatOrSyntax + public void _parse() + throws FileNotFoundException, ExceptionPermissionDenied, + ExceptionLoadingFailed, ExceptionFileFormatOrSyntax { result = RNAFactory.loadSecStrRNAML(getReader()); @@ -172,15 +173,16 @@ public class RnamlFile extends AlignFile } for (int k = 0; k < rna.length(); k++) { - ann[k] = new Annotation(annot[k], "", Rna.getRNASecStrucState( - annot[k]).charAt(0), 0f); + ann[k] = new Annotation(annot[k], "", + Rna.getRNASecStrucState(annot[k]).charAt(0), 0f); } AlignmentAnnotation align = new AlignmentAnnotation( "Secondary Structure", - current.getID().trim().length() > 0 ? "Secondary Structure for " - + current.getID() - : "", ann); + current.getID().trim().length() > 0 + ? "Secondary Structure for " + current.getID() + : "", + ann); sqs[i].addAlignmentAnnotation(align); sqs[i].setRNA(result.get(i)); @@ -195,16 +197,10 @@ public class RnamlFile extends AlignFile setSeqs(sqs); } - public static String print(SequenceI[] s) - { - return "not yet implemented"; - } - @Override - public String print() + public String print(SequenceI[] s, boolean jvSuffix) { - System.out.print("print :"); - return print(getSeqsAsArray()); + return "not yet implemented"; } public List getRNA() @@ -232,7 +228,7 @@ public class RnamlFile extends AlignFile dataName = dataName.substring(0, b - 1); } b = 0; - Regex m = new Regex("[\\/]?([-A-Za-z0-9]+)\\.?"); + Regex m = Platform.newRegex("[\\/]?([-A-Za-z0-9]+)\\.?"); String mm = dataName; while (m.searchFrom(dataName, b)) {