code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
public static Class getGenericClassFromParent(Object parent) {
return (Class) ((ParameterizedType) parent.getClass().getGenericSuperclass()).getActualTypeArguments()[0];
} | java |
public static String formatDouble(final Double amount, String pattern) {
if (pattern == null || pattern.equals("")) {
pattern = JKFormatUtil.DEFAULT_DOUBLE_FORMAT;
}
return JKFormatUtil.getNumberFormatter(pattern).format(amount);
} | java |
public synchronized static String formatTime(final Time object, String pattern) {
if (pattern == null || pattern.equals("")) {
pattern = JKFormatUtil.DEFAULT_TIME_PATTERN;
}
return JKFormatUtil.getDateFormatter(pattern).format(object);
} | java |
public synchronized static String formatTimeStamp(final Timestamp date, String pattern) {
if (pattern == null || pattern.equals("")) {
pattern = JKFormatUtil.DEFAULT_TIMESTAMP_PATTERN;
}
return JKFormatUtil.getDateFormatter(pattern).format(date);
} | java |
public static Format getDateFormatter(final String pattern) {
Format format = JKFormatUtil.formatMap.get(pattern);
if (format == null) {
format = new SimpleDateFormat(pattern);
JKFormatUtil.formatMap.put(pattern, format);
}
return format;
} | java |
public static Format getNumberFormatter(final String pattern) {
Format format = JKFormatUtil.formatMap.get(pattern);
if (format == null) {
format = new DecimalFormat(pattern);
JKFormatUtil.formatMap.put(pattern, format);
}
return format;
} | java |
public static String formatNumber(Number count) {
Format numberFormatter = getNumberFormatter(DEFAULT_NUMBER_FORMAT);
return numberFormatter.format(count);
} | java |
public static java.util.Date parseDate(String strDate, String pattern) {
try {
SimpleDateFormat parser = new SimpleDateFormat(pattern, Locale.US);
return parser.parse(strDate);
} catch (ParseException e) {
throw new JKException(e);
}
} | java |
public static int getYearFromData(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal.get(Calendar.YEAR);
} | java |
public static boolean isTimesEqaualed(Date time1, Date time2) {
return formatTime(time1).equals(formatTime(time2));
} | java |
public static int getNumOfMonths(Date date1, Date date2) {
Calendar firstDate = Calendar.getInstance();
Date date = new Date(date1.getTime());
firstDate.setTime(date);
Calendar secondDate = Calendar.getInstance();
Date date3 = new Date(date2.getTime());
secondDate.setTime(date3);
int months = first... | java |
public static CompareDates compareTwoDates(Date date1, Date date2) {
Date d1 = new Date(date1.getTime());// to unify the format of the dates
// before the compare
Date d2 = new Date(date2.getTime());
if (d1.compareTo(d2) < 0)
return CompareDates.DATE1_LESS_THAN_DATE2;
else if (d1.compareTo(d... | java |
public static Date adddDaysToCurrentDate(int numberOfDays) {
Date date = new Date();
Calendar instance = Calendar.getInstance();
instance.setTime(date);
instance.add(Calendar.DATE, numberOfDays);
return instance.getTime();
} | java |
public static boolean isDate(String strDate, String pattern) {
try {
parseDate(strDate, pattern);
return true;
} catch (Exception e) {
return false;
}
} | java |
public static Date addMonths(Date date, int numOfMonths) {
Calendar instance = Calendar.getInstance();
instance.setTime(date);
instance.add(Calendar.MONTH, numOfMonths);
return instance.getTime();
} | java |
public static long getDifference(Time timeFrom, Time timeTo) {
try {
DateFormat format = new SimpleDateFormat("HH:mm:ss");
// the a means am/pm marker
Date date = format.parse(timeFrom.toString());
Date date2 = format.parse(timeTo.toString());
long difference = (date2.getTime() - date.getTime()) ... | java |
private static int getDayOfMonth(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal.get(Calendar.DAY_OF_MONTH);
} | java |
public static int getDayOfWeek(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal.get(Calendar.DAY_OF_WEEK);
} | java |
public static int getHour(Date timeFrom) {
Calendar instance = Calendar.getInstance();
instance.setTime(timeFrom);
int hour = instance.get(Calendar.HOUR);
return hour;
} | java |
public static boolean isCurrentTimeBetweenTowTimes(Date fromDate, Date fromTime, Date toDate, Date timeTo) {
JKTimeObject currntTime = getCurrntTime();
JKTimeObject fromTimeObject = new JKTimeObject();
JKTimeObject toTimeObject = new JKTimeObject();
if (currntTime.after(fromTimeObject.toTimeObject(fromDate,... | java |
public static long getDayDifference(Date startDate, Date endDate) {
long startTime = startDate.getTime();
long endTime = endDate.getTime();
long diffTime = endTime - startTime;
long diffDays = TimeUnit.MILLISECONDS.toDays(diffTime);
return diffDays;
} | java |
public static long getSecondsDifference(Date startDate, Date endDate) {
long startTime = startDate.getTime();
long endTime = endDate.getTime();
long diffTime = endTime - startTime;
long diffInSeconds = TimeUnit.MILLISECONDS.toSeconds(diffTime);
return diffInSeconds;
} | java |
public static long getHoursDifference(Date startDate, Date endDate) {
long startTime = startDate.getTime();
long endTime = endDate.getTime();
long diffTime = endTime - startTime;
long diffInHours = TimeUnit.MILLISECONDS.toHours(diffTime);
return diffInHours;
} | java |
public static long getMillisDifference(Date startDate, Date endDate) {
long startTime = startDate.getTime();
long endTime = endDate.getTime();
long diffTime = endTime - startTime;
return diffTime;
} | java |
public static long getMinutesDifference(Date startDate, Date endDate) {
long startTime = startDate.getTime();
long endTime = endDate.getTime();
long diffTime = endTime - startTime;
long diffInMinutes = TimeUnit.MILLISECONDS.toMinutes(diffTime);
return diffInMinutes;
} | java |
public static boolean isDateEqaualed(final java.util.Date date1, final java.util.Date date2) {
final String d1 = JKFormatUtil.formatDate(date1, JKFormatUtil.MYSQL_DATE_DB_PATTERN);
final String d2 = JKFormatUtil.formatDate(date2, JKFormatUtil.MYSQL_DATE_DB_PATTERN);
return d1.equalsIgnoreCase(d2);
} | java |
public static boolean isPeriodActive(final Date startDate, final Date endDate) {
if (startDate == null && endDate == null) {
return true;
}
if (startDate == null) {
throw new JKException("START_DATE_CAN_NOT_BE_NULL");
}
if (endDate == null) {
throw new JKException("END_DATE_CAN_NOT_BE_NULL");... | java |
private static List<AbstractMolecule> buildMolecule(HELM2Notation helm2notation) throws BuilderMoleculeException, ChemistryException {
return BuilderMolecule.buildMoleculefromPolymers(helm2notation.getListOfPolymers(), HELM2NotationUtils.getAllEdgeConnections(helm2notation.getListOfConnections()));
} | java |
public static double getMolecularWeight(HELM2Notation helm2notation) throws BuilderMoleculeException, CTKException, ChemistryException {
/* First build one big molecule; List of molecules? */
List<AbstractMolecule> molecules = buildMolecule(helm2notation);
return calculateMolecularWeight(molecules);
} | java |
private static double calculateMolecularWeight(List<AbstractMolecule> molecules) throws BuilderMoleculeException, CTKException, ChemistryException {
Double result = 0.0;
for (AbstractMolecule molecule : molecules) {
molecule = BuilderMolecule.mergeRgroups(molecule);
result += Chemistry.getInstan... | java |
public static double getExactMass(HELM2Notation helm2notation) throws BuilderMoleculeException, CTKException, ChemistryException {
/* First build one big molecule; List of molecules */
List<AbstractMolecule> molecules = buildMolecule(helm2notation);
return calculateExactMass(molecules);
} | java |
private static double calculateExactMass(List<AbstractMolecule> molecules) throws CTKException, ChemistryException, BuilderMoleculeException {
Double result = 0.0;
for (AbstractMolecule molecule : molecules) {
molecule = BuilderMolecule.mergeRgroups(molecule);
result += Chemistry.getInstance()... | java |
public static String getMolecularFormular(HELM2Notation helm2notation) throws BuilderMoleculeException, CTKException, ChemistryException {
/* First build HELM molecule */
List<AbstractMolecule> molecules = buildMolecule(helm2notation);
LOG.info("Build process is finished");
return calculateMolecular... | java |
private static String calculateMolecularFormula(List<AbstractMolecule> molecules) throws BuilderMoleculeException, CTKException, ChemistryException {
Map<String, Integer> atomNumberMap = new TreeMap<String, Integer>();
for (AbstractMolecule molecule : molecules) {
LOG.info(molecule.getMolecule().toStri... | java |
public static MoleculeProperty getMoleculeProperties(HELM2Notation helm2notation) throws BuilderMoleculeException, CTKException, ExtinctionCoefficientException, ChemistryException {
MoleculeProperty result = new MoleculeProperty();
/* First build HELM molecule */
List<AbstractMolecule> molecules = buildM... | java |
private static Map<String, Integer> generateAtomNumberMap(AbstractMolecule molecule, Map<String, Integer> mapAtoms) throws BuilderMoleculeException, CTKException, ChemistryException {
molecule = BuilderMolecule.mergeRgroups(molecule);
LOG.info("Merge group is finished");
String formula = Chemistry.getIns... | java |
public void switchOff(BitSet switchGroupAddress, int switchCode) {
if (switchGroupAddress.length() > 5) {
throw new IllegalArgumentException("switch group address has more than 5 bits!");
}
this.sendTriState(this.getCodeWordA(switchGroupAddress, switchCode, false));
} | java |
public void send(final String bitString) {
BitSet bitSet = new BitSet(bitString.length());
for (int i = 0; i < bitString.length(); i++) {
if (bitString.charAt(i) == '1') {
bitSet.set(i);
}
}
send(bitSet, bitString.length());
} | java |
public void send(final BitSet bitSet, int length) {
if (transmitterPin != null) {
for (int nRepeat = 0; nRepeat < repeatTransmit; nRepeat++) {
for (int i = 0; i < length; i++) {
if (bitSet.get(i)) {
transmit(protocol.getOneBit());
... | java |
public void sendTriState(String codeWord) {
if (transmitterPin != null) {
for (int nRepeat = 0; nRepeat < repeatTransmit; nRepeat++) {
for (int i = 0; i < codeWord.length(); ++i) {
switch (codeWord.charAt(i)) {
case '0':
... | java |
public static BitSet getSwitchGroupAddress(String address) {
if (address.length() != 5) {
throw new IllegalArgumentException("the switchGroupAddress must consist of exactly 5 bits!");
}
BitSet bitSet = new BitSet(5);
for (int i = 0; i < 5; i++) {
bitSet.set(i, add... | java |
public static boolean start(RootDoc root) throws Exception {
umlProject = null;
mainGui = null;
Standard.start(root);
setOptions(root);
openOrCreateUmlProject(root);
generateUml(root);
return true;
} | java |
public static int optionLength(String option) {
int result = Standard.optionLength(option);
if(result == 0) {
if(option.equals(OPTION_PATH_UML_PROJECT)) {
result = 2;
}
}
return result;
} | java |
public final void add(final String problem, final Severity severity) {
this.problems.add(new Problem(problem, severity));
this.hasFatal |= severity == Severity.FATAL;
} | java |
public final Problem getLeadProblem() {
Collections.sort(this.problems);
return this.problems.isEmpty() ? null : this.problems.get(this.problems.size() - 1);
} | java |
public String toMutilLineString() {
final String newLine = System.getProperty("line.separator");
final StringBuffer problemStr = new StringBuffer();
for (final Problem problem : this.problems) {
problemStr.append(problem.getMessage() + newLine);
}
return problemStr.toString();
} | java |
public static int getTotalMonomerCount(PolymerNotation polymer) {
int count = 0;
for (MonomerNotation element : polymer.getPolymerElements().getListOfElements()) {
count += getMonomerCountFromMonomerNotation(element);
}
return count;
} | java |
private static int getMonomerCountFromMonomerNotation(MonomerNotation monomerNotation) {
int multiply;
try {
multiply = Integer.parseInt(monomerNotation.getCount());
if (multiply < 1) {
multiply = 1;
}
} catch (NumberFormatException e) {
multiply = 1;
}
if... | java |
public String nextGroup() {
int currentPosition = this.position;
do {
char currentCharacter = this.characters[currentPosition];
if (currentCharacter == '[') {
currentPosition = NucleotideParser.getMatchingBracketPosition(this.characters, currentPosition, '[', ']');
} else if (currentC... | java |
public final static String toJSON(HELM2Notation helm2notation) throws JsonProcessingException {
ObjectMapper mapper = new ObjectMapper();
String jsonINString = mapper.writeValueAsString(helm2notation);
jsonINString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(helm2notation);
return j... | java |
public final static List<ConnectionNotation> getAllEdgeConnections(List<ConnectionNotation> connections) {
List<ConnectionNotation> listEdgeConnection = new ArrayList<ConnectionNotation>();
for (ConnectionNotation connection : connections) {
if (!(connection.getrGroupSource().equals("pair"))) {
... | java |
public final static List<PolymerNotation> getRNAPolymers(List<PolymerNotation> polymers) {
List<PolymerNotation> rnaPolymers = new ArrayList<PolymerNotation>();
for (PolymerNotation polymer : polymers) {
if (polymer.getPolymerID() instanceof RNAEntity) {
rnaPolymers.add(polymer);
}
... | java |
public final static List<PolymerNotation> getPeptidePolymers(List<PolymerNotation> polymers) {
List<PolymerNotation> peptidePolymers = new ArrayList<PolymerNotation>();
for (PolymerNotation polymer : polymers) {
if (polymer.getPolymerID() instanceof PeptideEntity) {
peptidePolymers.add(polymer... | java |
public final static List<PolymerNotation> getCHEMPolymers(List<PolymerNotation> polymers) {
List<PolymerNotation> chemPolymers = new ArrayList<PolymerNotation>();
for (PolymerNotation polymer : polymers) {
if (polymer.getPolymerID() instanceof ChemEntity) {
chemPolymers.add(polymer);
}
... | java |
public final static List<PolymerNotation> getBLOBPolymers(List<PolymerNotation> polymers) {
List<PolymerNotation> blobPolymers = new ArrayList<PolymerNotation>();
for (PolymerNotation polymer : polymers) {
if (polymer.getPolymerID() instanceof BlobEntity) {
blobPolymers.add(polymer);
}
... | java |
public final static void combineHELM2notation(HELM2Notation helm2notation, HELM2Notation newHELM2Notation) throws NotationException {
HELM2NotationUtils.helm2notation = helm2notation;
Map<String, String> mapIds = generateMapChangeIds(newHELM2Notation.getPolymerAndGroupingIDs());
/* method to merge the ne... | java |
private static Map<String, String> generateMapChangeIds(List<String> newIDs) {
Map<String, String> mapIds = new HashMap<String, String>();
List<String> oldIds = HELM2NotationUtils.helm2notation.getPolymerAndGroupingIDs();
Map<String, String> mapOldIds = new HashMap<String, String>();
for (String o... | java |
private static void section1(List<PolymerNotation> polymers, Map<String, String> mapIds) throws NotationException {
for (PolymerNotation polymer : polymers) {
if (mapIds.containsKey(polymer.getPolymerID().getId())) {
/* change id */
PolymerNotation newpolymer = new PolymerNotation(mapIds.g... | java |
private static void section2(List<ConnectionNotation> connections, Map<String, String> mapIds) throws NotationException {
for (ConnectionNotation connection : connections) {
HELMEntity first = connection.getSourceId();
String idFirst = first.getId();
HELMEntity second = connection.getTarge... | java |
private static void section3(List<GroupingNotation> groupings, Map<String, String> mapIds) throws NotationException {
for (GroupingNotation grouping : groupings) {
GroupEntity groupID = grouping.getGroupID();
if (mapIds.containsKey(groupID.getId())) {
groupID = new GroupingNotation(mapIds.... | java |
private static void section4(List<AnnotationNotation> annotations, Map<String, String> mapIds) {
for (AnnotationNotation annotation : annotations) {
String notation = annotation.getAnnotation();
notation = changeIDs(notation, mapIds);
helm2notation.addAnnotation(new AnnotationNotation(notation... | java |
private static String changeIDs(String text, Map<String, String> mapIds) {
String result = text;
for (String key : mapIds.keySet()) {
result = result.replace(key, mapIds.get(key));
}
return result;
} | java |
public static final int getTotalMonomerCount(HELM2Notation helm2notation) {
int result = 0;
for (PolymerNotation polymer : helm2notation.getListOfPolymers()) {
result += PolymerUtils.getTotalMonomerCount(polymer);
}
return result;
} | java |
public static boolean hasNucleotideModification(List<PolymerNotation> polymers) throws NotationException {
for (PolymerNotation polymer : getRNAPolymers(polymers)) {
if (RNAUtils.hasNucleotideModification(polymer)) {
return true;
}
}
return false;
} | java |
public static String[] getFormatedSirnaSequences(HELM2Notation helm2notation) throws NotationException, RNAUtilsException, HELM2HandledException, org.helm.notation2.exception.NotationException,
ChemistryException {
return getFormatedSirnaSequences(helm2notation, DEFAULT_PADDING_CHAR, DEFAULT_BASE_PAIR_CHAR)... | java |
private static String reverseString(String source) {
int i;
int len = source.length();
StringBuffer dest = new StringBuffer();
for (i = (len - 1); i >= 0; i--) {
dest.append(source.charAt(i));
}
return dest.toString();
} | java |
public List<HELM2Notation> decompose(HELM2Notation helm2notation) {
List<HELM2Notation> list = new ArrayList<HELM2Notation>();
List<ConnectionNotation> allselfConnections = getAllSelfCycleConnections(helm2notation.getListOfConnections());
for (PolymerNotation polymer : helm2notation.getListOfPolymers()) ... | java |
private static List<ConnectionNotation> getAllSelfCycleConnections(List<ConnectionNotation> connections) {
List<ConnectionNotation> listSelfCycle = new ArrayList<ConnectionNotation>();
for (ConnectionNotation connection : connections) {
if ((connection.getTargetId().getId().equals(connection.getSourceI... | java |
private static List<ConnectionNotation> getSelfCycleConnections(String id, List<ConnectionNotation> connections) {
List<ConnectionNotation> list = new ArrayList<ConnectionNotation>();
for (ConnectionNotation connection : connections) {
if (connection.getSourceId().getId().equals(id)) {
list.ad... | java |
public static List<PolymerNotation> getListOfPolymersSpecificType(String str, List<PolymerNotation> polymers) {
List<PolymerNotation> list = new ArrayList<PolymerNotation>();
for (PolymerNotation polymer : polymers) {
if (polymer.getPolymerID().getType().equals(str)) {
list.add(polymer);
... | java |
public static String buildDynamicKey(final Object[] paramNames, final Object[] paramValues) {
return Arrays.toString(paramNames).concat(Arrays.toString(paramValues));
} | java |
private Map<String, String> deserializeNucleotideStore(JsonParser parser)
throws JsonParseException, IOException {
Map<String, String> nucleotides = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER);
String currentNucleotideSymbol = "";
String currentNucleotideNotation = "";
boolean ... | java |
public static void fixPropertiesKeys(final Properties prop) {
final Enumeration<Object> keys = prop.keys();
while (keys.hasMoreElements()) {
String currentKey = (String) keys.nextElement();
String fixedKey = fixPropertyKey(currentKey);
String value = prop.getProperty(currentKey);
value = fixProper... | java |
public static String fixPropertyValue(String value) {
// replace with predefined varialebls
value = value.replaceAll("\\{jk.appname\\}", JK.getAppName());
return value;
} | java |
public static Object unifyReferences(final Hashtable hash, Object object) {
final Object itemAtHash = hash.get(object.hashCode());
if (itemAtHash == null) {
hash.put(object.hashCode(), object);
} else {
object = itemAtHash;
}
return object;
} | java |
public static List<Entry> sortHashTable(final Hashtable<?, ?> hash, final boolean asc) {
// Put keys and values in to an arraylist using entryset
final ArrayList<Entry> myArrayList = new ArrayList(hash.entrySet());
// Sort the values based on values first and then keys.
Collections.sort(myArrayList, new Has... | java |
public static String formatProperties(Properties properties) {
StringBuffer buf = new StringBuffer();
Set<Object> keySet = properties.keySet();
for (Object key : keySet) {
buf.append(key.toString().trim().toUpperCase().replaceAll(" ", "_"));
buf.append("=");
buf.append(properties.get(key));
b... | java |
public static String getStandard(HELM2Notation helm2notation) throws HELM1FormatException, MonomerLoadingException, CTKException, ValidationException, ChemistryException {
try {
String firstSection = setStandardHELMFirstSection(helm2notation);
List<String> ListOfSecondAndThirdSection = setStandardHEL... | java |
private static String setStandardHELMFourthSection(List<AnnotationNotation> annotations) {
StringBuilder sb = new StringBuilder();
for (AnnotationNotation annotation : annotations) {
sb.append(annotation.toHELM2() + "|");
}
if (sb.length() > 1) {
sb.setLength(sb.length() - 1);
}... | java |
public static String getCanonical(HELM2Notation helm2notation) throws HELM1FormatException, ChemistryException {
Map<String, String> convertsortedIdstoIds;
try {
Object[] temp = setCanonicalHELMFirstSection(helm2notation);
LOG.info("First Section of canonical HELM was generated");
convert... | java |
private static String setCanonicalHELMSecondSection(Map<String, String> convertsortedIdstoIds, List<ConnectionNotation> connectionNotations) throws HELM1ConverterException {
StringBuilder notation = new StringBuilder();
for (ConnectionNotation connectionNotation : connectionNotations) {
/* canonicalize... | java |
private static String convertConnection(String notation, String source, String target, Map<String, String> convertIds) throws HELM1ConverterException {
try {
String test = notation.replace(source, "one");
test = test.replace(target, "two");
test = test.replace("one", convertIds.get(source));
... | java |
private Element getXHELMRootElement(String resource) throws JDOMException, IOException {
ByteArrayInputStream stream = new ByteArrayInputStream(resource.getBytes());
SAXBuilder builder = new SAXBuilder();
Document doc = builder.build(stream);
return doc.getRootElement();
} | java |
private void updateMonomerStore(MonomerStore monomerStore)
throws MonomerLoadingException, IOException, MonomerException, ChemistryException {
for (Monomer monomer : monomerStore.getAllMonomersList()) {
MonomerFactory.getInstance().getMonomerStore().addNewMonomer(monomer);
// save monomer db to local fil... | java |
private HELM2Notation readNotation(String notation)
throws ParserException, JDOMException, IOException, MonomerException, ChemistryException {
/* xhelm notation */
if (notation.contains("<Xhelm>")) {
LOG.info("xhelm is used as input");
String xhelm = notation;
Element xHELMRootElement = getXHELMRo... | java |
private HELM2Notation validate(String helm) throws ValidationException, ChemistryException {
try {
/* Read */
HELM2Notation helm2notation = readNotation(helm);
/* Validate */
LOG.info("Validation of HELM is starting");
Validation.validateNotationObjects(helm2notation);
LOG.info("Validatio... | java |
public void validateHELM(String helm) throws ValidationException, MonomerLoadingException, ChemistryException {
validate(helm);
setMonomerFactoryToDefault(helm);
} | java |
public String convertStandardHELMToCanonicalHELM(String notation)
throws HELM1FormatException, ValidationException, MonomerLoadingException, ChemistryException {
String result = HELM1Utils.getCanonical(validate(notation));
setMonomerFactoryToDefault(notation);
return result;
} | java |
public String convertIntoStandardHELM(String notation) throws HELM1FormatException, ValidationException,
MonomerLoadingException, CTKException, ChemistryException {
String result = HELM1Utils.getStandard(validate(notation));
setMonomerFactoryToDefault(notation);
return result;
} | java |
public Float calculateExtinctionCoefficient(String notation)
throws ExtinctionCoefficientException, ValidationException, MonomerLoadingException, ChemistryException {
Float result = ExtinctionCoefficient.getInstance().calculate(validate(notation));
setMonomerFactoryToDefault(notation);
return result;
} | java |
public String generateFasta(String notation)
throws FastaFormatException, ValidationException, MonomerLoadingException, ChemistryException {
String result = FastaFormat.generateFasta(validate(notation));
setMonomerFactoryToDefault(notation);
return result;
} | java |
public Double calculateMolecularWeight(String notation) throws MonomerLoadingException, BuilderMoleculeException,
CTKException, ValidationException, ChemistryException {
Double result = MoleculePropertyCalculator.getMolecularWeight(validate(notation));
setMonomerFactoryToDefault(notation);
return result;
... | java |
public String getMolecularFormula(String notation) throws BuilderMoleculeException, CTKException,
ValidationException, MonomerLoadingException, ChemistryException {
String result = MoleculePropertyCalculator.getMolecularFormular(validate(notation));
setMonomerFactoryToDefault(notation);
return result;
} | java |
public String readPeptide(String peptide) throws FastaFormatException,
org.helm.notation2.parser.exceptionparser.NotationException, ChemistryException {
return SequenceConverter.readPeptide(peptide).toHELM2();
} | java |
public String readRNA(String rna) throws org.helm.notation2.parser.exceptionparser.NotationException,
FastaFormatException, ChemistryException, org.helm.notation2.exception.NucleotideLoadingException {
return SequenceConverter.readRNA(rna).toHELM2();
} | java |
public byte[] generateImageForHELMMolecule(String notation)
throws BuilderMoleculeException, CTKException, IOException, ValidationException, ChemistryException {
byte[] result = Images.generateImageHELMMolecule(validate(notation));
setMonomerFactoryToDefault(notation);
return result;
} | java |
public byte[] generateImageForMonomer(Monomer monomer, boolean showRgroups)
throws BuilderMoleculeException, CTKException, ChemistryException {
return Images.generateImageofMonomer(monomer, showRgroups);
} | java |
public String generateJSON(String helm)
throws ValidationException, MonomerLoadingException, ChemistryException, JsonProcessingException {
String result = HELM2NotationUtils.toJSON(validate(helm));
setMonomerFactoryToDefault(helm);
return result;
} | java |
private void setMonomerFactoryToDefault(String helm) throws MonomerLoadingException, ChemistryException {
if (helm.contains("<Xhelm>")) {
LOG.info("Refresh local Monomer Store in case of Xhelm");
MonomerFactory.refreshMonomerCache();
}
} | java |
public String generateNaturalAnalogSequencePeptide(String notation)
throws HELM2HandledException, ValidationException, MonomerLoadingException, PeptideUtilsException,
org.helm.notation2.parser.exceptionparser.NotationException, ChemistryException {
String result = SequenceConverter.getPeptideNaturalAnalogSeq... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.