import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
import jalview.util.MessageManager;
+import jalview.util.Platform;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
}
- public RnamlFile(String inFile, String type) throws IOException
+ public RnamlFile(String inFile, DataSourceType type) throws IOException
{
super(inFile, type);
} 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());
}
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));
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<RNA> getRNA()
dataName = dataName.substring(0, b - 1);
}
b = 0;
- Regex m = new Regex("[\\/]?([-A-Za-z0-9]+)\\.?");
+ Regex m = getSafeRegex();
String mm = dataName;
while (m.searchFrom(dataName, b))
{
}
return mm;
}
+
+ private static Regex SAFE_REGEX;
+
+ private static Regex getSafeRegex()
+ {
+ return (SAFE_REGEX == null
+ ? SAFE_REGEX = Platform.newRegex("[\\/]?([-A-Za-z0-9]+)\\.?", null)
+ : SAFE_REGEX);
+ }
}