Skip to content

Commit

Permalink
Allow proteins to be in mol2 format
Browse files Browse the repository at this point in the history
Also used pdb with corrected secondary structure in KNIME example and test workflow.

To run test workflow successfully enable ui harness.

Fixes #14
  • Loading branch information
sverhoeven committed Dec 2, 2016
1 parent 0414efd commit d2cc509
Show file tree
Hide file tree
Showing 19 changed files with 355 additions and 247 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The file is formatted as described on http://keepachangelog.com/.

## Changed

* Allow proteins to be in mol2 format (#14)
* Switched from 3Dmol to NGL (https://github.com/3D-e-Chem/molviewer-tsx/issues/4)

## [0.1.4] - 2016-11-25
Expand Down
Binary file modified examples/molviewer-ligands-and-proteins-example.knwf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected LigandsAndProteinsViewerDialog() {

addDialogComponent(new DialogComponentColumnNameSelection(
new SettingsModelString(LigandsAndProteinsViewerModel.CFGKEY_LIGAND, null),
"Column with SDF formatted molecules", LigandsAndProteinsViewerModel.LIGAND_PORT, SdfValue.class,
"Column with SDF or Mol2 formatted molecules", LigandsAndProteinsViewerModel.LIGAND_PORT, SdfValue.class,
Mol2Value.class));

addDialogComponent(new DialogComponentColumnNameSelection(
Expand All @@ -44,7 +44,8 @@ protected LigandsAndProteinsViewerDialog() {

addDialogComponent(new DialogComponentColumnNameSelection(
new SettingsModelString(LigandsAndProteinsViewerModel.CFGKEY_PROTEIN, null),
"Column with PDB formatted molecules", LigandsAndProteinsViewerModel.PROTEIN_PORT, PdbValue.class));
"Column with PDB or Mol2 formatted molecules", LigandsAndProteinsViewerModel.PROTEIN_PORT, PdbValue.class,
Mol2Value.class));

addDialogComponent(new DialogComponentColumnNameSelection(
new SettingsModelColumnName(LigandsAndProteinsViewerModel.CFGKEY_PROTEIN_LABEL, null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
<option name="Ligands: Column with SDF molecules">Column with SDF or Mol2 formatted molecules in port 0.</option>
<option name="Ligands: Column with labels" optional="true">Column with
labels in port 0, if no column is selected uses Row ID.</option>
<option name="Proteins: Column with PDB molecules">Column with PDB formatted molecules in port 1.</option>
<option name="Proteins: Column with PDB molecules">Column with PDB or Mol2 formatted molecules in port 1.</option>
<option name="Proteins: Column with labels" optional="true">Column
with labels in port 1, if no column is selected uses Row ID.</option>
</fullDescription>

<ports>
<inPort index="0" name="Ligands">Table containing Ligands in SDF or Mol2 format</inPort>
<inPort index="1" name="Proteins">Table containing Proteins in PDB format</inPort>
<inPort index="1" name="Proteins">Table containing Proteins in PDB or Mol2 format</inPort>
</ports>
<views>
<view index="0" name="Web browser launcher">Display web browser launcher</view>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ protected void reset() {
protected DataTableSpec[] configure(final DataTableSpec[] inSpecs) throws InvalidSettingsException {
isCompatibleLambda compatibleLigand = (DataColumnSpec s) -> s.getType().isCompatible(SdfValue.class)
|| s.getType().isCompatible(Mol2Value.class);
isCompatibleLambda compatibleProtein = (DataColumnSpec s) -> s.getType().isCompatible(PdbValue.class);
isCompatibleLambda compatibleProtein = (DataColumnSpec s) -> s.getType().isCompatible(PdbValue.class)
|| s.getType().isCompatible(Mol2Value.class);
// as PDB, SDF and Mol2 are also string compatible exclude them for
// label
isCompatibleLambda compatibleLabel = (DataColumnSpec s) -> s.getType().isCompatible(StringValue.class)
Expand Down
1 change: 1 addition & 0 deletions tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<useUIHarness>true</useUIHarness>
<argLine>${tycho.test.jvmArgs}</argLine>
</configuration>

Expand Down
2 changes: 1 addition & 1 deletion tests/src/knime/molviewer-test/.savedWithData
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Do not delete this file!
This file serves to indicate that the workflow was written as part of the usual save routine (not exported).

Workflow was last saved by user verhoes on Fri Nov 25 13:30:08 CET 2016
Workflow was last saved by user verhoes on Fri Dec 02 17:48:25 CET 2016
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@
<entry key="node-bundle-name" type="xstring" value="MolViewer Nodes"/>
<entry key="node-bundle-symbolic-name" type="xstring" value="nl.esciencecenter.e3dchem.knime.molviewer.plugin"/>
<entry key="node-bundle-vendor" type="xstring" value="Netherlands eScience Center"/>
<entry key="node-bundle-version" type="xstring" value="0.1.9"/>
<entry key="node-bundle-version" type="xstring" value="0.1.5"/>
<entry key="node-feature-name" type="xstring" value="MolViewer nodes for KNIME"/>
<entry key="node-feature-symbolic-name" type="xstring" value="nl.esciencecenter.e3dchem.knime.molviewer.feature.feature.group"/>
<entry key="node-feature-vendor" type="xstring" value="Netherlands eScience Center"/>
<entry key="node-feature-version" type="xstring" value="0.1.9"/>
<entry key="node-feature-version" type="xstring" value="0.1.5"/>
<config key="factory_settings"/>
<entry key="name" type="xstring" value="Ligands and Proteins Viewer"/>
<entry key="hasContent" type="xboolean" value="false"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://www.knime.org/2008/09/XMLConfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.knime.org/2008/09/XMLConfig http://www.knime.org/XMLConfig_2008_09.xsd" key="settings.xml">
<entry key="node_file" type="xstring" value="settings.xml"/>
<config key="flow_stack"/>
<config key="internal_node_subsettings">
<entry key="memory_policy" type="xstring" value="CacheSmallInMemory"/>
</config>
<config key="model">
<config key="ligandColumn_Internals">
<entry key="SettingsModelID" type="xstring" value="SMID_string"/>
<entry key="EnabledStatus" type="xboolean" value="true"/>
</config>
<entry key="ligandColumn" type="xstring" value="Molecule"/>
<config key="ligandLabelColumn_Internals">
<entry key="SettingsModelID" type="xstring" value="SMID_string"/>
<entry key="EnabledStatus" type="xboolean" value="true"/>
</config>
<config key="ligandLabelColumn">
<entry key="useRowID" type="xboolean" value="true"/>
<entry key="columnName" type="xstring" isnull="true" value=""/>
</config>
<config key="proteinColumn_Internals">
<entry key="SettingsModelID" type="xstring" value="SMID_string"/>
<entry key="EnabledStatus" type="xboolean" value="true"/>
</config>
<entry key="proteinColumn" type="xstring" value="Molecule"/>
<config key="proteinLabelColumn_Internals">
<entry key="SettingsModelID" type="xstring" value="SMID_string"/>
<entry key="EnabledStatus" type="xboolean" value="true"/>
</config>
<config key="proteinLabelColumn">
<entry key="useRowID" type="xboolean" value="true"/>
<entry key="columnName" type="xstring" isnull="true" value=""/>
</config>
<config key="browserAutoOpen_Internals">
<entry key="SettingsModelID" type="xstring" value="SMID_boolean"/>
<entry key="EnabledStatus" type="xboolean" value="true"/>
</config>
<entry key="browserAutoOpen" type="xboolean" value="false"/>
</config>
<config key="nodeAnnotation">
<entry key="text" type="xstring" value="Test mol2 ligands %%00010and mol2 proteins"/>
<entry key="bgcolor" type="xint" value="16777215"/>
<entry key="x-coordinate" type="xint" value="483"/>
<entry key="y-coordinate" type="xint" value="499"/>
<entry key="width" type="xint" value="115"/>
<entry key="height" type="xint" value="32"/>
<entry key="alignment" type="xstring" value="CENTER"/>
<entry key="borderSize" type="xint" value="0"/>
<entry key="borderColor" type="xint" value="16777215"/>
<entry key="defFontSize" type="xint" value="9"/>
<entry key="annotation-version" type="xint" value="20151123"/>
<config key="styles"/>
</config>
<entry key="customDescription" type="xstring" isnull="true" value=""/>
<entry key="state" type="xstring" value="CONFIGURED"/>
<entry key="factory" type="xstring" value="nl.esciencecenter.e3dchem.knime.molviewer.ligandsandproteins.LigandsAndProteinsViewerFactory"/>
<entry key="node-name" type="xstring" value="Ligands and Proteins Viewer"/>
<entry key="node-bundle-name" type="xstring" value="MolViewer Nodes"/>
<entry key="node-bundle-symbolic-name" type="xstring" value="nl.esciencecenter.e3dchem.knime.molviewer.plugin"/>
<entry key="node-bundle-vendor" type="xstring" value="Netherlands eScience Center"/>
<entry key="node-bundle-version" type="xstring" value="0.1.12"/>
<entry key="node-feature-name" type="xstring" value="MolViewer nodes for KNIME"/>
<entry key="node-feature-symbolic-name" type="xstring" value="nl.esciencecenter.e3dchem.knime.molviewer.feature.feature.group"/>
<entry key="node-feature-vendor" type="xstring" value="Netherlands eScience Center"/>
<entry key="node-feature-version" type="xstring" value="0.1.12"/>
<config key="factory_settings"/>
<entry key="name" type="xstring" value="Ligands and Proteins Viewer"/>
<entry key="hasContent" type="xboolean" value="false"/>
<entry key="isInactive" type="xboolean" value="false"/>
<config key="ports"/>
<config key="filestores">
<entry key="file_store_location" type="xstring" isnull="true" value=""/>
<entry key="file_store_id" type="xstring" isnull="true" value=""/>
</config>
</config>
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@
<entry key="node-bundle-name" type="xstring" value="MolViewer Nodes"/>
<entry key="node-bundle-symbolic-name" type="xstring" value="nl.esciencecenter.e3dchem.knime.molviewer.plugin"/>
<entry key="node-bundle-vendor" type="xstring" value="Netherlands eScience Center"/>
<entry key="node-bundle-version" type="xstring" value="0.1.9"/>
<entry key="node-bundle-version" type="xstring" value="0.1.5"/>
<entry key="node-feature-name" type="xstring" value="MolViewer nodes for KNIME"/>
<entry key="node-feature-symbolic-name" type="xstring" value="nl.esciencecenter.e3dchem.knime.molviewer.feature.feature.group"/>
<entry key="node-feature-vendor" type="xstring" value="Netherlands eScience Center"/>
<entry key="node-feature-version" type="xstring" value="0.1.9"/>
<entry key="node-feature-version" type="xstring" value="0.1.5"/>
<config key="factory_settings"/>
<entry key="name" type="xstring" value="Ligands and Proteins Viewer"/>
<entry key="hasContent" type="xboolean" value="false"/>
Expand Down
42 changes: 21 additions & 21 deletions tests/src/knime/molviewer-test/PDB Loader (#12)/port_1/data.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://www.knime.org/2008/09/XMLConfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.knime.org/2008/09/XMLConfig http://www.knime.org/XMLConfig_2008_09.xsd" key="table_meta_info">
<entry key="table_ID" type="xint" value="29"/>
<entry key="table_type" type="xstring" value="rearrange_columns_table"/>
<config key="table_references">
<entry key="array-size" type="xint" value="0"/>
</config>
<config key="meta_internal">
<entry key="table_reference_ID" type="xint" value="28"/>
<config key="table_internal_map">
<entry key="array-size" type="xint" value="2"/>
<entry key="0" type="xint" value="0"/>
<entry key="1" type="xint" value="0"/>
</config>
<config key="table_internal_flags">
<entry key="array-size" type="xint" value="2"/>
<entry key="0" type="xboolean" value="true"/>
<entry key="1" type="xboolean" value="false"/>
</config>
</config>
<entry key="table_file_name" type="xstring" value="data.zip"/>
</config>
<config xmlns="http://www.knime.org/2008/09/XMLConfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.knime.org/2008/09/XMLConfig http://www.knime.org/XMLConfig_2008_09.xsd" key="table_meta_info">
<entry key="table_ID" type="xint" value="84"/>
<entry key="table_type" type="xstring" value="rearrange_columns_table"/>
<config key="table_references">
<entry key="array-size" type="xint" value="0"/>
</config>
<config key="meta_internal">
<entry key="table_reference_ID" type="xint" value="80"/>
<config key="table_internal_map">
<entry key="array-size" type="xint" value="2"/>
<entry key="0" type="xint" value="0"/>
<entry key="1" type="xint" value="0"/>
</config>
<config key="table_internal_flags">
<entry key="array-size" type="xint" value="2"/>
<entry key="0" type="xboolean" value="true"/>
<entry key="1" type="xboolean" value="false"/>
</config>
</config>
<entry key="table_file_name" type="xstring" value="data.zip"/>
</config>
Binary file modified tests/src/knime/molviewer-test/PDB Loader (#12)/port_1/data.zip
Binary file not shown.
72 changes: 36 additions & 36 deletions tests/src/knime/molviewer-test/PDB Loader (#12)/port_1/spec.xml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://www.knime.org/2008/09/XMLConfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.knime.org/2008/09/XMLConfig http://www.knime.org/XMLConfig_2008_09.xsd" key="spec.xml">
<entry key="spec_name" type="xstring" value="default"/>
<entry key="number_columns" type="xint" value="2"/>
<config key="column_spec_0">
<entry key="column_name" type="xstring" value="filename"/>
<config key="element_names">
<entry key="array-size" type="xint" value="0"/>
</config>
<config key="column_type">
<entry key="cell_class" type="xstring" value="org.knime.core.data.def.StringCell"/>
</config>
<config key="column_domain">
<config key="possible_values">
<entry key="array-size" type="xint" value="1"/>
<config key="0">
<entry key="datacell" type="xstring" value="org.knime.core.data.def.StringCell"/>
<config key="org.knime.core.data.def.StringCell">
<entry key="StringCell" type="xstring" value="file:/D:/data/3d-e-chem/molviewer/protein.pdb"/>
</config>
</config>
</config>
</config>
<config key="column_properties"/>
</config>
<config key="column_spec_1">
<entry key="column_name" type="xstring" value="PDB File"/>
<config key="element_names">
<entry key="array-size" type="xint" value="0"/>
</config>
<config key="column_type">
<entry key="cell_class" type="xstring" value="org.knime.bio.types.PdbCell"/>
</config>
<config key="column_domain"/>
<config key="column_properties"/>
</config>
</config>
<config xmlns="http://www.knime.org/2008/09/XMLConfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.knime.org/2008/09/XMLConfig http://www.knime.org/XMLConfig_2008_09.xsd" key="spec.xml">
<entry key="spec_name" type="xstring" value="default"/>
<entry key="number_columns" type="xint" value="2"/>
<config key="column_spec_0">
<entry key="column_name" type="xstring" value="filename"/>
<config key="element_names">
<entry key="array-size" type="xint" value="0"/>
</config>
<config key="column_type">
<entry key="cell_class" type="xstring" value="org.knime.core.data.def.StringCell"/>
</config>
<config key="column_domain">
<config key="possible_values">
<entry key="array-size" type="xint" value="1"/>
<config key="0">
<entry key="datacell" type="xstring" value="org.knime.core.data.def.StringCell"/>
<config key="org.knime.core.data.def.StringCell">
<entry key="StringCell" type="xstring" value="file:/tmp/protein.pdb"/>
</config>
</config>
</config>
</config>
<config key="column_properties"/>
</config>
<config key="column_spec_1">
<entry key="column_name" type="xstring" value="PDB File"/>
<config key="element_names">
<entry key="array-size" type="xint" value="0"/>
</config>
<config key="column_type">
<entry key="cell_class" type="xstring" value="org.knime.bio.types.PdbCell"/>
</config>
<config key="column_domain"/>
<config key="column_properties"/>
</config>
</config>
Loading

0 comments on commit d2cc509

Please sign in to comment.