本文整理汇总了Java中org.helm.notation.tools.ComplexNotationParser类的典型用法代码示例。如果您正苦于以下问题:Java ComplexNotationParser类的具体用法?Java ComplexNotationParser怎么用?Java ComplexNotationParser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ComplexNotationParser类属于org.helm.notation.tools包,在下文中一共展示了ComplexNotationParser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transferDynamicChemicalModifiersToMonomers
import org.helm.notation.tools.ComplexNotationParser; //导入依赖的package包/类
public static String transferDynamicChemicalModifiersToMonomers(
String notation, MonomerStore monomerStore)
throws NotationException, MonomerException, JDOMException,
IOException {
notation = ComplexNotationParser.getNotationByReplacingSmiles(notation,
monomerStore);
/*
* int p = notation.indexOf("{"); while (p > 0) { int p2 =
* notation.indexOf("}", p + 1); if (p2 < p) { break; }
*
* String smiles = notation.substring(p + 1, p2); if
* (smiles.indexOf("$") > 0) { Monomer monomer =
* org.helm.editor.editor.StructureFrame.getMonomerBySmiles(smiles);
* notation = notation.substring(0, p + 1) + monomer.getAlternateId() +
* notation.substring(p2); } p = notation.indexOf("{", p + 1); }
*/
return notation;
}
示例2: loadNucleotideSeqeuence
import org.helm.notation.tools.ComplexNotationParser; //导入依赖的package包/类
private void loadNucleotideSeqeuence(String inputText) {
try {
String existingNotation = editor.getNotation();
String complexNotation = NucleotideConverter.getInstance()
.getComplexNotation(inputText);
String newNotation = null;
if (null != existingNotation
&& existingNotation.trim().length() > 0) {
newNotation = ComplexNotationParser.getCombinedComlexNotation(
existingNotation, complexNotation);
} else {
newNotation = complexNotation;
}
editor.synchronizeZoom();
ModelController.notationUpdated(newNotation, _ownerCode);
} catch (Exception ex) {
JOptionPane.showMessageDialog(editor.getFrame(), ex.getMessage(),
"Error Loading Nucleotide Sequence",
JOptionPane.ERROR_MESSAGE);
Logger.getLogger(LoadPanel.class.getName()).log(Level.SEVERE, null,
ex);
}
}
示例3: init
import org.helm.notation.tools.ComplexNotationParser; //导入依赖的package包/类
public void init(String notation) {
try {
MonomerStore monomerStore = MonomerStoreCache.getInstance()
.getCombinedMonomerStore();
String[] compNotations = ComplexNotationParser.decompose(notation,
monomerStore);
List<SequenceTableDataModel> list = new ArrayList<SequenceTableDataModel>();
for (int rowNumber = 1; rowNumber <= compNotations.length; rowNumber++) {
SequenceTableDataModel dataModel = SequenceTableDataModel
.createSequenceTableDataModel(
compNotations[rowNumber - 1], monomerStore);
dataModel.setAnnotation(String.valueOf(rowNumber));
list.add(dataModel);
}
setData(list);
} catch (Exception ex) {
ExceptionHandler.handleException(ex);
Logger.getLogger(SequenceTableModel.class.getName()).log(
Level.SEVERE, null, ex);
}
}
示例4: replaceWholeGraph
import org.helm.notation.tools.ComplexNotationParser; //导入依赖的package包/类
public void replaceWholeGraph(String polymerType, String existingMonomerID,
String newMonomerID) throws MonomerException, IOException,
JDOMException, NotationException {
String notation = editor.getNotation();
String newNotation = ComplexNotationParser.replaceMonomer(notation,
polymerType, existingMonomerID, newMonomerID);
ModelController.notationUpdated(newNotation, _ownerCode);
}
示例5: loadToEditorButton1ActionPerformed
import org.helm.notation.tools.ComplexNotationParser; //导入依赖的package包/类
private void loadToEditorButton1ActionPerformed(
java.awt.event.ActionEvent evt) {// GEN-FIRST:event_loadToEditorButton1ActionPerformed
if (model.getRowCount() == 0) {
JOptionPane.showMessageDialog(this,
"The fragmentation result table is empty!",
"Load Selected Sequence into Editor",
JOptionPane.WARNING_MESSAGE);
return;
}
int rowIndex = fragmentTable.getSelectedRow();
if (rowIndex < 0) {
JOptionPane
.showMessageDialog(
this,
"Please select a record from the fragmentation result table first!",
"Load Selected Sequence into Editor",
JOptionPane.WARNING_MESSAGE);
return;
}
int modelIndex = fragmentTable.convertRowIndexToModel(rowIndex);
String selectedNotation = model.getFragments().get(modelIndex)
.getNotation();
String oldNotation = editor.getNotation();
try {
String newNotation = ComplexNotationParser
.getCombinedComlexNotation(oldNotation, selectedNotation);
editor.setNotation(newNotation);
editor.getFrame().setVisible(true);
} catch (Exception ex) {
JOptionPane.showMessageDialog(this,
"Error combining selected sequence with editor structure!",
"Load Selected Sequence into Editor",
JOptionPane.ERROR_MESSAGE);
Logger.getLogger(OligonucleotideFragmentDialog.class.getName())
.log(Level.SEVERE, null, ex);
}
}
示例6: getAllSimplePolymerNotation
import org.helm.notation.tools.ComplexNotationParser; //导入依赖的package包/类
/**
* parse an extended polymner notation to a list of simple sequence
* notations
*
* @param complexNotation
* @return a list of simple notations that contains every polymer
*/
public static ArrayList<String> getAllSimplePolymerNotation(
String complexNotation) throws NotationException,
StructureException, MonomerException, JDOMException, IOException {
List<PolymerNode> polymerNodeList = ComplexNotationParser
.getPolymerNodeList(ComplexNotationParser
.getAllNodeString(complexNotation));
// polymerNodeList =
// ComplexNotationParser.getPolymerNodeList(ComplexNotationParser.getAllNodeString(complexNotation));
ArrayList<String> simpleSequenceNotationList = new ArrayList<String>(
polymerNodeList.size());
for (PolymerNode polymerNode : polymerNodeList) {
if (polymerNode.getType().equalsIgnoreCase(
Monomer.CHEMICAL_POLYMER_TYPE)) {
simpleSequenceNotationList.add(polymerNode.getLabel());
} else if (polymerNode.getType().equalsIgnoreCase(
Monomer.NUCLIEC_ACID_POLYMER_TYPE)) {
simpleSequenceNotationList
.add(getSimpleNucleotideSequenceNotation(polymerNode
.getLabel()));
} else if (polymerNode.getType().equalsIgnoreCase(
Monomer.PEPTIDE_POLYMER_TYPE)) {
simpleSequenceNotationList
.add(getSimplePeptideSequenceNotation(polymerNode
.getLabel()));
} else {
simpleSequenceNotationList.add(polymerNode.getLabel());
}
}
return simpleSequenceNotationList;
}
示例7: getPolymerList
import org.helm.notation.tools.ComplexNotationParser; //导入依赖的package包/类
/**
* breaks a complex notation string into polymer list, the polymer could be
* a nucleotide sequence, a peptide sequence or a chemical linker
*
* @param complexNotation
* : the string notation for the whole structure
* @return a list of polymers that is in this structure
* @throws org.helm.notation.NotationException
*/
public static List<PolymerNode> getPolymerList(String complexNotation,
MonomerStore monomerStore) throws NotationException,
StructureException, MonomerException, JDOMException, IOException {
List<PolymerNode> list = ComplexNotationParser.getPolymerNodeList(
ComplexNotationParser.getAllNodeString(complexNotation),
monomerStore);
String anotationString = ComplexNotationParser
.getAllNodeLabelString(complexNotation);
if (anotationString != null && !anotationString.equalsIgnoreCase("")) {
String[] anotations = anotationString
.split(ComplexNotationParser.LIST_LEVEL_DELIMITER_REGEX);
int index = 0;
String nodeID = null;
String anotation = null;
// <NodeID, anotation> map, where nodeID is RNA1, CHEM1, RNA2 etc.
HashMap<String, String> anotationMap = new HashMap<String, String>();
for (int i = 0; i < anotations.length; i++) {
index = anotations[i]
.indexOf(ComplexNotationParser.NODE_LABEL_START_SYMBOL);
nodeID = anotations[i].substring(0, index);
anotation = anotations[i].substring(index + 1, anotations[i]
.indexOf(ComplexNotationParser.NODE_LABEL_END_SYMBOL));
anotationMap.put(nodeID, anotation);
}
for (PolymerNode node : list) {
node.setAnotation(anotationMap.get(node.getId()));
}
}
return list;
}
示例8: saveImage
import org.helm.notation.tools.ComplexNotationParser; //导入依赖的package包/类
private static void saveImage(String notation, String imageFilePath)
throws NotationException, MonomerException, StructureException,
JDOMException, IOException {
String complexNotation = SimpleNotationParser
.getComplextNotationForRNA(notation);
String smiles = ComplexNotationParser
.getComplexPolymerSMILES(complexNotation);
Molecule mol = MolImporter.importMol(smiles);
Image image = (Image) mol.toObject("image");
new SaveAsPNG(image, imageFilePath);
}
示例9: standardizeNotation
import org.helm.notation.tools.ComplexNotationParser; //导入依赖的package包/类
public static ConvertionResult standardizeNotation(String notation) {
ConvertionResult result = new ConvertionResult();
try {
result.setNotation(ComplexNotationParser.standardize(notation));
} catch (Exception ex) {
result.setException(ex);
}
return result;
}
示例10: loadPeptideSequence
import org.helm.notation.tools.ComplexNotationParser; //导入依赖的package包/类
private void loadPeptideSequence(String inputText) {
try {
String existingNotation = editor.getNotation();
String simpleNotation = PeptideSequenceParser
.getNotation(inputText);
String complexNotation = SimpleNotationParser
.getComplextNotationForPeptide(simpleNotation);
String newNotation = null;
if (null != existingNotation
&& existingNotation.trim().length() > 0) {
newNotation = ComplexNotationParser.getCombinedComlexNotation(
existingNotation, complexNotation);
} else {
newNotation = complexNotation;
}
editor.synchronizeZoom();
ModelController.notationUpdated(newNotation, _ownerCode);
} catch (Exception ex) {
JOptionPane
.showMessageDialog(editor.getFrame(), ex.getMessage(),
"Error Loading Peptide Sequence",
JOptionPane.ERROR_MESSAGE);
Logger.getLogger(LoadPanel.class.getName()).log(Level.SEVERE, null,
ex);
}
}
示例11: getConnStr
import org.helm.notation.tools.ComplexNotationParser; //导入依赖的package包/类
private String getConnStr(String sequence, String conn, String r)
throws NotationException {
if (sequence == null || sequence.length() == 0)
return "";
String ret = "";
// int p = sequence.indexOf("$");
// String[] ss = sequence.replace("|", ",").split(",");
// for (int i = 0; i < ss.length; ++i) {
// String s = ss[i];
// p = s.indexOf("{");
// if (ret.length() > 0)
// ret += "+";
// ret += s.substring(0, p);
// }
// use NotationToolkit
List<PolymerNode> pnl = ComplexNotationParser
.getPolymerNodeList(sequence);
for (PolymerNode pn : pnl) {
if (ret.length() > 0)
ret += PolymerEdge.NODE_CONCATENATOR;
ret += pn.getId();
}
if (conn == null || conn.length() == 0)
return ret + ",CHEM1," + PolymerEdge.GENERIC_EDGE_KEY + ":?-1:" + r;
return ret + ",CHEM1," + PolymerEdge.GENERIC_EDGE_KEY + ":" + conn
+ "-1:" + r;
}
示例12: updateNotation
import org.helm.notation.tools.ComplexNotationParser; //导入依赖的package包/类
public void updateNotation(String notation, MonomerStore monomerStore) {
try {
if (notation == null || notation.equals("")
|| notation.equals("$$$$")) {
reset();
return;
}
// if (notation.equalsIgnoreCase(getNotation())) {
// return;
// }
ComplexNotationParser.validateComplexNotation(notation,
monomerStore);
GraphPair pair = NotationParser
.getGraphPair(notation, monomerStore);
// set the graph and the graph manager
view.setGraph2D(pair.getGraph());
graphManager = pair.getGraphManager();
graphManager.getAnnotator().setGraph2D(view.getGraph2D());
view.getGraph2D().setDefaultNodeRealizer(new MonomerNodeRealizer());
} catch (Exception ex) {
ExceptionHandler.handleException(ex);
}
}
示例13: getCanonicalNotation
import org.helm.notation.tools.ComplexNotationParser; //导入依赖的package包/类
/**
* produce the canonical notation for this graph
*
* @return canonical notation for the graph
* @throws StructureException
*/
public String getCanonicalNotation() throws ClassNotFoundException,
NotationException, IOException, MonomerException, JDOMException,
StructureException {
if (view.getGraph2D().isEmpty() || graphManager == null) {
return null;
} else {
return ComplexNotationParser
.getCanonicalNotation(Graph2NotationTranslator
.getNewNotation(graphManager));
}
}
示例14: getCanonicalNotation
import org.helm.notation.tools.ComplexNotationParser; //导入依赖的package包/类
/**
* generate the canonical string notation for the graph being displaied
*
* @return canonical string notation
* @throws StructureException
*/
public String getCanonicalNotation() throws StructureException,
NotationException, JDOMException, MonomerException, IOException,
ClassNotFoundException {
if (null == _notation) {
return null;
} else {
return ComplexNotationParser.getCanonicalNotation(_notation);
}
}
示例15: onUpdate
import org.helm.notation.tools.ComplexNotationParser; //导入依赖的package包/类
public void onUpdate(NotationUpdateEvent event) {
if (!event.getOwner().equals(_ownerCode)) {
return;
}
String notation = event.getData();
if (notation == null || notation.equals("")) {
reset();
return;
}
try {
ComplexNotationParser.validateComplexNotation(notation);
GraphPair pair = NotationParser.getGraphPair(notation);
Graph2NotationTranslator.updateHyperGraph(pair.getGraph(),
pair.getGraphManager());
viewer.setGraph2D(pair.getGraph());
graphManager = pair.getGraphManager();
updateAnnotator();
(new SequenceLayout(viewer, graphManager)).doLayout();
viewer.updateView();
graphManager.getAnnotator().annotateAllBasePosition();
} catch (Exception ex) {
ExceptionHandler.handleException(ex);
}
}