code
stringlengths
73
34.1k
label
stringclasses
1 value
public String generateNaturalAnalogSequenceRNA(String notation) throws org.helm.notation2.parser.exceptionparser.NotationException, HELM2HandledException, ValidationException, MonomerLoadingException, ChemistryException { String result = SequenceConverter.getNucleotideNaturalAnalogSequenceFromNotation(valida...
java
public String convertMolFileSMILESWithAtomMapping(String molfile, List<Attachment> attachments) throws CTKException, ChemistryException{ return SMILES.convertMolToSMILESWithAtomMapping(molfile, attachments); }
java
public static List<MonomerNotation> getListOfMonomerNotation(List<PolymerNotation> polymers) { List<MonomerNotation> items = new ArrayList<MonomerNotation>(); for (PolymerNotation polymer : polymers) { items.addAll(polymer.getListMonomers()); } return items; }
java
public static List<Monomer> getListOfMonomer(List<MonomerNotation> monomerNotations) throws MonomerException, HELM2HandledException, CTKException, NotationException, ChemistryException, MonomerLoadingException { List<Monomer> items = new ArrayList<Monomer>(); for (int i = 0; i < monomerNotations.size();...
java
public static Monomer getMonomer(String type, String id, String info) throws MonomerException, NotationException, ChemistryException{ try { if (id.startsWith("[") && id.endsWith("]")) { id = id.substring(1, id.length() - 1); } MonomerFactory monomerFactory = MonomerFactory.getInstance(...
java
public static JKLocale valueOf(final String localeString) { return localeString.equals(ARABIC.shortName) ? ARABIC : ENGLISH; }
java
public String getAuditText() { final StringBuffer b = new StringBuffer(); b.append(getOldValue().replaceAll(",", "\n")); b.append("-----------------------------------------\n"); b.append(getNewValue().replaceAll(",", "\n")); b.append("-----------------------------------------\n"); return b.toString(); }
java
public float calculate(HELM2Notation helm2notation, int unitType) throws ExtinctionCoefficientException, ChemistryException { LOG.debug("ExtinctionCalculation is starting with the unitType: " + unitType); float result = 0.0f; List<PolymerNotation> polymerNodes = helm2notation.getListOfPolymers(); fo...
java
private static float calculateExtinctionFromRNA(List<Monomer> monomers) throws CalculationException, IOException { LOG.debug("ExtinctionCalculation of RNA"); float resultSingle = 0.0f; float resultDi = 0.0f; String previous = ""; if (monomers.size() == 0) { throw new CalculationException...
java
private static float calculateExtinctionFromPeptide(List<Monomer> monomers) throws IOException, HELM2HandledException { if (null == monomers || monomers.isEmpty()) { return 0.0f; } Map<String, Integer> countMap = new HashMap<String, Integer>(); for (Monomer monomer : monomers) { if...
java
public static boolean isAuthenticed(String host, int port, String userName, String password) throws NamingException { log.info("isAuthenticed"); // Set up the environment for creating the initial context Hashtable<String, String> env = new Hashtable<String, String>(); env.put(Context.INITIAL_CONTEXT_FACTORY, "c...
java
protected static String fixKey(final String key) { if (key.startsWith(getKeyPrefix())) { return key; } return getKeyPrefix() + "-" + key; }
java
public static float getFloat(final String key, final float def) { try { return systemRoot.getFloat(fixKey(key), def); } catch (final Exception e) { // just eat the exception to avoid any system // crash on system issues return def; } }
java
public static Hashtable<String, String> getHashtable(final String name) { final Hashtable<String, String> hash = new Hashtable<String, String>(); try { final String configStr = UserPreferences.get(fixKey(name), ""); if (!configStr.equals("")) { final String[] rows = configStr.split(";"); for (final St...
java
public static int getInt(final String key, final int def) { try { return systemRoot.getInt(fixKey(key), def); } catch (final Exception e) { // just eat the exception to avoid any system crash on system issues return def; } }
java
public static void putHashTable(final String name, final Hashtable hash) { final Enumeration<String> keys = hash.keys(); final StringBuffer buf = new StringBuffer(""); while (keys.hasMoreElements()) { if (!buf.toString().equals("")) { // end the previous record buf.append(";"); } final String key...
java
public static void setKeyPrefix(final String keyPrefix) { UserPreferences.keyPrefix = keyPrefix; try { systemRoot.sync(); } catch (final Exception e) { JKExceptionUtil.handle(e); } }
java
private static void initializeNucleotideTemplates() throws NucleotideLoadingException { InputStream in = null; File localFile = new File(LOCAL_NUCLEOTIDE_TEMPLATE_FILE_PATH); Map<String, Map<String, String>> templates = null; if (localFile.exists()) { try { in = new FileInputStream(local...
java
public void saveNucleotideTemplates() throws IOException { File f = new File(NOTATION_DIRECTORY); if (!f.exists()) { f.mkdir(); } String nucleotideTemplatesXML = NucleotideParser.getNucleotideTemplatesXML(getNucleotideTemplates()); FileOutputStream fos = new FileOutputStream( LOCAL_NUC...
java
@SuppressWarnings("rawtypes") public Class[] getParamtersTypes() { final Class[] types = new Class[this.paramters.length]; for (int i = 0; i < types.length; i++) { types[i] = this.paramters[i].getClass(); } return types; }
java
private void readConfigFile() { File configFile = new File(CONFIG_FILE_PATH); /* config file is not there -> create config file with default */ if (!configFile.exists()) { resetConfigToDefault(); } try { PropertiesConfiguration conf = new PropertiesConfiguration(CONFIG_FILE_PATH...
java
public static boolean compileJavaClass(String sourceCode) { try { String fileName = getClassName(sourceCode).concat(".java"); logger.info("Compiling Java Class ({})", fileName); File rootDir = JKIOUtil.createTempDirectory(); String packageDir = getPackageDir(sourceCode); File sourceFile ; i...
java
@Override public void showAndChoose(IConsumer<File> consumer) { this.consumer = consumer; initSrvNodeFile(); Intent activityTreeIntent = new Intent(activity, ActivityTreeChooser.class); activityTreeIntent.putExtra(FragmentNodes.ARG_ID_NODE_SRVNODES, new String[]{idFolderStart, idSrvGetNodeFile, idComm...
java
public static String getHELMNotationString(Element rootElement) { Element helmNotationElement = rootElement.getChild("HelmNotation"); return helmNotationElement.getText(); }
java
public static String getComplexNotationString(Element rootElement) { Element helmNotationElement = rootElement.getChild("HelmNotation"); return helmNotationElement.getText(); }
java
public static MonomerStore getMonomerStore(Element rootElement) throws MonomerException, IOException { MonomerStore monomerStore = new MonomerStore(); Element monomerListElement = rootElement.getChild("Monomers"); if (monomerListElement != null) { @SuppressWarnings("unchecked") List<...
java
public boolean isNumeric() { final Class c = getColumnClass(); return c.equals(Integer.class) || c.equals(Float.class) || c.equals(Long.class) || c.equals(BigDecimal.class); }
java
public void setColumnClassName(final String columnClassName) throws ClassNotFoundException { if (columnClassName.equals("byte[]")) { setColumnClass(Object.class); } else { setColumnClass(Class.forName(columnClassName)); } this.columnClassName = columnClassName; }
java
public static String generateMDL(final HELM2Notation helm2notation) throws BuilderMoleculeException, CTKException, NotationException, ChemistryException { LOG.debug("Generate smiles representation for the whole HELM molecule"); String smiles = SMILES.getSMILESForAll(helm2notation); LOG.debug("Convert smi...
java
public void callMethod(final MethodCallInfo info) { this.logger.info("calling remote method ".concat(info.toString())); try (Socket socket = new Socket(this.host, this.port)) { final ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream()); out.writeObject(info); final ObjectInputStre...
java
protected static Vector convertToVector(final Object[] anArray) { if (anArray == null) { return null; } final Vector v = new Vector(anArray.length); for (final Object element : anArray) { v.addElement(element); } return v; }
java
private static Vector newVector(final int size) { final Vector v = new Vector(size); v.setSize(size); return v; }
java
@Override public String getColumnName(final int column) { Object id = null; // This test is to cover the case when // getColumnCount has been subclassed by mistake ... if (column < this.columnIdentifiers.size() && column >= 0) { id = this.columnIdentifiers.elementAt(column); } return id == null ...
java
private void justifyRows(final int from, final int to) { // Sometimes the DefaultTableModel is subclassed // instead of the AbstractTableModel by mistake. // Set the number of rows for the case when getRowCount // is overridden. this.dataVector.setSize(getRowCount()); for (int i = from; i < to; i++)...
java
public static String findPathJar(final Class clas) throws IllegalStateException { URL url; String extURL; try { url = clas.getProtectionDomain().getCodeSource().getLocation(); } catch (final SecurityException ex) { url = clas.getResource(clas.getSimpleName() + ".class"); } extURL = url.toExter...
java
public static byte[] readStream(final InputStream inStream) { try { return IOUtils.toByteArray(inStream); } catch (IOException e) { throw new JKException(e); } // // try { // DataInputStream in = null; // try { // in = new DataInputStream(inStream); // int ch; // // List<Byte> b...
java
public static String convertToString(InputStream input) throws IOException { try { if (input == null) { throw new IOException("Input Stream Cannot be NULL"); } StringBuilder sb1 = new StringBuilder(); String line; try { BufferedReader r1 = new BufferedReader(new InputStreamReader(input,...
java
public static Reader getReader(String name) { InputStream inputStream = getInputStream(name); if (inputStream != null) { BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); return reader; } return null; }
java
public static String getExtension(final String fileName, final boolean withPoint) { final int lastIndexOf = fileName.lastIndexOf("."); if (!withPoint) { return fileName.substring(lastIndexOf + 1); } return fileName.substring(lastIndexOf); }
java
public static String removeExtension(String fileName) { final String separator = FILE_SEPARATOR; String filename; // Remove the path upto the filename. final int lastSeparatorIndex = fileName.lastIndexOf(separator); if (lastSeparatorIndex == -1) { filename = fileName; } else { filename = fileN...
java
public static File writeDataToFile(final byte[] data, final File file, final boolean append) { try (FileOutputStream out = new FileOutputStream(file, append)) { out.write(data); out.flush(); out.close(); return file; } catch (Exception e) { JKExceptionUtil.handle(e); return null; } }
java
public static Properties readPropertiesStream(InputStream inputStream) { try { final Properties prop = new Properties(); // try to read in utf 8 prop.load(new InputStreamReader(inputStream, Charset.forName("utf-8"))); JKCollectionUtil.fixPropertiesKeys(prop); return prop; } catch (IOException ...
java
public static File writeFileToTempDirectory(final byte[] data, final String fileName) { try { File file = createTempDirectory(); File out = new File(file, fileName); out.deleteOnExit(); file.deleteOnExit(); return writeDataToFile(data, out); } catch (IOException e) { JKExceptionUtil.handle...
java
public static File createTempFile(final String ext) { try { File file; file = File.createTempFile("jk-", "." + ext); return file; } catch (IOException e) { JK.throww(e); return null; } }
java
public static Process executeFile(final String fileName) { try { final String command = "cmd /c \"" + fileName + "\""; logger.info(command); return Runtime.getRuntime().exec(command); } catch (IOException e) { throw new RuntimeException(e); } }
java
public static String getSqlFile(String fileName) { String file = "/jk/sql/".concat(fileName); logger.debug("Loading sql file: ", file); return readFile(file); }
java
public static void clearTempFiles() { String userFolderPath = getUserFolderPath(false); File file = new File(userFolderPath); deleteDir(file); }
java
public static void startFakeThread(ServerSocket server) { Thread thread = new Thread(new FakeRunnable(server)); thread.start(); }
java
public static String getReportsOutPath(boolean appendFileSeprator) { String userLocalPath = getUserFolderPath(true); String reportPath = userLocalPath + REPORTS_OUT_PATH; checkFolderPath(reportPath, true);// to create the folder if not exist if (appendFileSeprator) { reportPath += FILE_SEPARATOR; } ...
java
public static List<String> getFilesInFolder(String folder, String ext) { // tryto find using normal file system lookup List<String> files = new Vector<>(); File dir = new File(folder); if (dir.exists() && dir.isDirectory()) { String[] list = dir.list(); for (String file : list) { if (file.endsW...
java
public static void copResourcesFromJarToDir(String sourceClassPath, File dest) { try { List<File> resourcesInnPackage = getResourcesInnPackage(sourceClassPath); for (File file : resourcesInnPackage) { JK.printBlock("Copying file: " + file.getName() + " to folder " + dest.getAbsolutePath()); FileUti...
java
public static List<File> getResourcesInnPackage(String root) { try { logger.debug("getResourcesInnPackage for package: " + root); ClassLoader loader = Thread.currentThread().getContextClassLoader(); URL url = loader.getResource(root); if (url != null) { logger.debug(" URL :" + url.toURI()); ...
java
public static JKConfig readConfigFile(String configFileName) { URL url = getURL(configFileName); logger.debug(configFileName + " Url is ", url.toString()); JKConfig config = new JKConfig(url); return config; }
java
private static String convertLessThanOneThousand(int number) { String soFar; if (number % 100 < 20) { soFar = numNames[number % 100]; number /= 100; } else { soFar = numNames[number % 10]; number /= 10; soFar = tensNames[number % 10] + soFar; number /= 10; } if (number == 0) {...
java
public static double addAmounts(final double num1, final double num2) { final BigDecimal b1 = new BigDecimal(num1); final BigDecimal b2 = new BigDecimal(num2); BigDecimal b3 = b1.add(b2); b3 = b3.setScale(3, BigDecimal.ROUND_HALF_UP); final double result = b3.doubleValue(); return result; }
java
public static double fixAmount(final double value) { final BigDecimal b1 = new BigDecimal(value); final BigDecimal b2 = b1.setScale(3, BigDecimal.ROUND_HALF_UP); return b2.doubleValue(); }
java
public static double subAmounts(final double n1, final double n2) { final BigDecimal b1 = new BigDecimal(n1); final BigDecimal b2 = new BigDecimal(n2); BigDecimal b3 = b1.subtract(b2); b3 = b3.setScale(3, BigDecimal.ROUND_HALF_UP); final double result = b3.doubleValue(); return result; }
java
public void fillEmail(final MultiPartEmail email) throws EmailException, IOException { email.setHostName(getHost()); email.setSmtpPort(getSmtpPort()); email.addTo(getTo()); email.setFrom(getFrom()); email.setSubject(getSubject()); email.setMsg(getMsg()); email.setSSLOnConnect(isSecured()); if(this.bcc!...
java
public static Date toDate(final Object value) { if (value instanceof Date) { return (Date) value; } if (value == null || value.equals("null")) { return null; } if (value instanceof String) { throw new IllegalStateException("fix me"); } return null; }
java
public static float toFloat(final Object value) { if (value instanceof Float) { return (float) value; } if (value == null) { return 0; } return new Float(value.toString()); }
java
public static java.sql.Time toTime(final Object value) { if (value == null) { return null; } if (value instanceof java.sql.Time) { return (java.sql.Time) value; } if (value instanceof java.util.Date) { final Date date = (java.util.Date) value; return new java.sql.Time(date.getTime()); ...
java
public static boolean toBoolean(Object value, boolean defaultValue) { boolean result;// = defaultValue; if (value != null) { if (value instanceof Boolean) { return ((Boolean) value).booleanValue(); } if (value.toString().trim().equals("1") || value.toString().trim().toLowerCase().equals("true")...
java
public static double toDouble(Object value, double defaultValue) { if (value == null || value.toString().trim().equals("")) { return defaultValue; } if (value instanceof Double) { return (double) value; } if (value instanceof Date) { final Date date = (Date) value; return date.getTime(); ...
java
public static int toInteger(Object value, int defaultValue) { if (value == null || value.toString().trim().equals("")) { return defaultValue; } if (value instanceof Integer) { return (Integer) value; } return (int) JKConversionUtil.toDouble(value); }
java
public static void validateNotationObjects(HELM2Notation helm2notation) throws PolymerIDsException, MonomerException, GroupingNotationException, ConnectionNotationException, NotationException, ChemistryException, MonomerLoadingException, org.helm.notation2.parser.exceptionparser.NotationException { LOG.info(...
java
protected static boolean validateMonomers(List<MonomerNotation> mon) throws ChemistryException, MonomerLoadingException, org.helm.notation2.parser.exceptionparser.NotationException { for (MonomerNotation monomerNotation : mon) { if (!(isMonomerValid(monomerNotation.getUnit(), monomerNotation.getType()))) { ...
java
private static boolean isConnectionSpecific(ConnectionNotation connectionNotation) { String connection = connectionNotation.getSourceUnit() + ":" + connectionNotation.getrGroupSource() + "-" + connectionNotation.getTargetUnit() + ":" + connectionNotation.getrGroupTarget(); /* check for specific interaction *...
java
private static List<Integer> getOccurencesOfMonomerNotation(String sourceUnit, HELMEntity e, HELM2Notation helm2notation) throws org.helm.notation2.parser.exceptionparser.NotationException, AttachmentException { List<Integer> occurences = new ArrayList<Integer>(); /* The monomer's position in the poly...
java
public static boolean validateGrouping(HELM2Notation helm2notation) { List<GroupingNotation> listGroupings = helm2notation.getListOfGroupings(); List<String> listPolymerIDs = helm2notation.getPolymerAndGroupingIDs(); /* validate each group */ for (GroupingNotation grouping : listGroupings) { /* check ...
java
public static boolean validateUniquePolymerIDs(HELM2Notation helm2notation) { List<String> listPolymerIDs = helm2notation.getPolymerAndGroupingIDs(); Map<String, String> uniqueId = new HashMap<String, String>(); for (String polymerID : listPolymerIDs) { uniqueId.put(polymerID, ""); } if (listPolymerI...
java
private static void checkExistenceOfPolymerID(String str, List<String> listPolymerIDs) throws PolymerIDsException { if (!(listPolymerIDs.contains(str))) { LOG.info("Polymer Id does not exist"); throw new PolymerIDsException("Polymer ID does not exist"); } }
java
private static boolean isMonomerValid(String str, String type) throws ChemistryException, MonomerLoadingException, org.helm.notation2.parser.exceptionparser.NotationException { LOG.info("Is Monomer valid: " + str); MonomerFactory monomerFactory = null; monomerFactory = MonomerFactory.getInstance(); /*...
java
private static void checkPolymerIDSConnection(ConnectionNotation not, List<String> listPolymerIDs) throws PolymerIDsException { /* the polymer ids have to be there */ checkExistenceOfPolymerID(not.getSourceId().getId(), listPolymerIDs); checkExistenceOfPolymerID(not.getTargetId().getId(), listPolymerIDs); ...
java
public static List<Monomer> getAllMonomers(MonomerNotation not, int position) throws HELM2HandledException, MonomerException, NotationException, ChemistryException, CTKException, MonomerLoadingException { List<Monomer> monomers = new ArrayList<Monomer>(); MonomerFactory monomerFactory = MonomerFactory.getIn...
java
public static List<Monomer> getAllMonomersOnlyBase(MonomerNotation not) throws HELM2HandledException, MonomerException, NotationException, ChemistryException, CTKException, MonomerLoadingException { LOG.debug("Get base for " + not); List<Monomer> monomers = new ArrayList<Monomer>(); MonomerFactory monome...
java
private static void checkAttachmentPoint(Monomer mon, String str) throws AttachmentException { if (!(mon.getAttachmentListString().contains(str))) { if (!(str.equals("?") || str.equals("pair")) && !mon.getAlternateId().equals("?")) { LOG.info("Attachment point for source is not there"); throw new Attac...
java
private static boolean checkSingleAttachment(List<Monomer> monomers, String rGroup, HELM2Notation helm2notation, ConnectionNotation not, InterConnections interconnection, String id) throws AttachmentException { for (Monomer monomer : monomers) { /* Are the attachment points there */ checkAttachmentPoin...
java
private static List<Monomer> getMonomersRNA(MonomerNotationUnitRNA rna, MonomerStore monomerStore, int position) throws HELM2HandledException { try { List<Monomer> monomers = new ArrayList<Monomer>(); for (int index = 0; index < rna.getContents().size(); index++) { String id = rna.getContents().get(...
java
private static List<Monomer> getMonomersRNAOnlyBase(MonomerNotationUnitRNA rna, MonomerStore monomerStore) throws HELM2HandledException { try { List<Monomer> monomers = new ArrayList<Monomer>(); for (MonomerNotationUnit unit : rna.getContents()) { String id = unit.getUnit().replace("[", ""); id...
java
private static void initComplementMap() { complementMap = new HashMap<String, String>(); complementMap.put("A", "U"); complementMap.put("G", "C"); complementMap.put("C", "G"); complementMap.put("U", "A"); complementMap.put("T", "A"); complementMap.put("X", "X"); }
java
public static boolean areAntiparallel(PolymerNotation polymerOne, PolymerNotation polymerTwo) throws RNAUtilsException, HELM2HandledException, ChemistryException, NucleotideLoadingException { checkRNA(polymerOne); checkRNA(polymerTwo); PolymerNotation antiparallel = getAntiparallel(polymerOne); String s...
java
public static String getMaxMatchFragment(String seq1, String seq2) throws NotationException { return getMaxMatchFragment(seq1, seq2, MINUMUM_MATCH_FRAGMENT_LENGTH); }
java
public static String getMaxMatchFragment(String seq1, String seq2, int minLength) throws NotationException { if (null == seq1 || null == seq2) { throw new NotationException("Both sequences must not be null "); } if (!seq1.equals(seq1.toUpperCase()) || !seq2.equals(seq2.toUpperCase())) { throw new Not...
java
public static void removeLastP(PolymerNotation polymer) throws RNAUtilsException, NotationException, HELM2HandledException { checkRNA(polymer); /* Get last monomerNotation */ MonomerNotation lastObject = polymer.getPolymerElements().getListOfElements() .get(polymer.getPolymerElements().getListOfElemen...
java
public static void addLastP(PolymerNotation polymer) throws RNAUtilsException, NotationException, HELM2HandledException { checkRNA(polymer); /* Get last monomerNotation */ MonomerNotation lastObject = polymer.getPolymerElements().getListOfElements() .get(polymer.getPolymerElements().getListOfElements...
java
public static PolymerNotation getInverse(PolymerNotation polymer) throws RNAUtilsException, org.helm.notation2.exception.NotationException, ChemistryException, NucleotideLoadingException { checkRNA(polymer); PolymerNotation inverse; try { inverse = SequenceConverter.readRNA(generateInverse(polymer).toStrin...
java
public static PolymerNotation getReverseComplement(PolymerNotation polymer) throws RNAUtilsException, org.helm.notation2.exception.NotationException, ChemistryException, NucleotideLoadingException { checkRNA(polymer); PolymerNotation complementReversePolymer; try { complementReversePolymer = SequenceConver...
java
private static StringBuilder generateInverse(PolymerNotation polymer) throws HELM2HandledException, RNAUtilsException, org.helm.notation2.exception.NotationException, ChemistryException { initComplementMap(); String sequence = getNaturalAnalogSequence(polymer); StringBuilder sb = new StringBuilder(sequence...
java
public static boolean hasNucleotideModification(PolymerNotation polymer) throws NotationException { for (MonomerNotation current : polymer.getPolymerElements().getListOfElements()) { if (hasModification(current)) { return true; } } return false; }
java
private static boolean hasModification(MonomerNotation monomerNotation) throws NotationException { if (monomerNotation instanceof MonomerNotationUnitRNA) { if (hasModification((MonomerNotationUnitRNA) monomerNotation)) { return true; } } else if (monomerNotation instanceof MonomerNotationGroup) { ...
java
private static boolean hasModification(MonomerNotationUnitRNA monomerNotation) { if (monomerNotation.getUnit().contains("[") || monomerNotation.getUnit().contains("(X)") || monomerNotation.getUnit().endsWith(")")) { return true; } return false; }
java
public static List<ConnectionNotation> hybridizeAntiparallel(PolymerNotation one, PolymerNotation two) throws RNAUtilsException, NotationException, HELM2HandledException, ChemistryException, NucleotideLoadingException { checkRNA(one); checkRNA(two); List<ConnectionNotation> connections = new ArrayLis...
java
public static String getSequence(PolymerNotation one) throws RNAUtilsException, HELM2HandledException, ChemistryException { checkRNA(one); List<Nucleotide> nucleotideList = getNucleotideList(one); StringBuffer sb = new StringBuffer(); for (int i = 0; i < nucleotideList.size(); i++) { sb.append(nuc...
java
public static String getModifiedNucleotideSequence(PolymerNotation polymer) throws RNAUtilsException, HELM2HandledException, ChemistryException { checkRNA(polymer); List<Nucleotide> nucleotides = getNucleotideList(polymer); StringBuilder sb = new StringBuilder(); for (Nucleotide nucleotide : nucleotides...
java
public static String getNucleotideSequence(PolymerNotation polymer) throws NotationException, RNAUtilsException, HELM2HandledException, NucleotideLoadingException, ChemistryException { List<Nucleotide> nucleotides = getNucleotideList(polymer); StringBuffer sb = new StringBuffer(); int count = 0; Map<S...
java
public static List<Nucleotide> getNucleotideList(PolymerNotation polymer) throws RNAUtilsException, HELM2HandledException, ChemistryException { checkRNA(polymer); List<Nucleotide> nucleotides = new ArrayList<Nucleotide>(); /* check for HELM2Elements */ List<MonomerNotation> monomerNotations = polymer.ge...
java
public static String getTrimmedNucleotideSequence(PolymerNotation polymer) throws RNAUtilsException, HELM2HandledException, ChemistryException { checkRNA(polymer); List<Nucleotide> list = getNucleotideList(polymer); int start = 0; Nucleotide na = list.get(start); while (null == na.getBaseMonomer())...
java
public static JKExceptionHandlerFactory getInstance() { if (JKExceptionHandlerFactory.instance == null) { JKExceptionHandlerFactory.instance = new JKExceptionHandlerFactory(); } return JKExceptionHandlerFactory.instance; }
java
public void setHandler(final Class<? extends Throwable> clas, final JKExceptionHandler handler) { this.handlers.put(clas, handler); }
java
public void registerHanders(String packageString) { List<String> list = AnnotationDetector.scanAsList(ExceptionHandler.class, packageString); for (String handler : list) { // System.out.println(handler); JKExceptionHandler<? extends Throwable> newInstance = JKObjectUtil.newInstance(handler); Class<? e...
java