Greetings Everyone!
Ive little question.
I am going to write a new Node and thats why I am trying a few things befor I begin to start the Node development.
The first thing Ive tried is to read a Mol2(1) (from Code) - do something with it(2) - and return it back to another Node(3).
(1) This step Ive simply tried with reading a Mol2 File and saving all its content into a Variable.
(2) Now I am going to do something with it.
(3) And here comes the Problem. I want to "bypass" the (internal) Mol2 File now.
I think I have to convert it first to a Mol2Cell and then simply return it.
But I get an Error if I do so.
Here is my Code:
protected BufferedDataTable[] execute(final BufferedDataTable[] inData, final ExecutionContext exec) throws Exception {/* * Defining our Result Table... */ String[] Header = new String[2]; //Creating the Header of the Table. Header[0] = "Test"; Header[1] = "Molecule"; DataType[] types = new DataType[2]; //Defining the Types of the Header. types [0] = StringCell.TYPE; types [1] = Mol2Cell.TYPE; DataTableSpec dataSpec = new DataTableSpec(Header,types); /* * Filling our Result Table... */ BufferedDataContainer table = exec.createDataContainer(dataSpec, false); String Molecule = readFile("/home/imax/test.mol2"); // (1) /* (2) * Do Something with Molecule... * Also if I don't touch the Molecule the error occurs. */ DataRow row = new DefaultRow(new RowKey("Test_" + Integer.toString(0)), new DataCell[]{ new StringCell ("Atom"), new Mol2Cell (Molecule)}); table.addRowToTable(row); table.close(); return new BufferedDataTable[]{table.getTable()}; //(3) }
Now if i start my Node there comes a red cross (Error-Icon) below my Node with the Tooltip: "Execute failed: org/knime/chem/types/Mol2Cell".
Somebody know what I am doing wrong?
Thanks for your help!
PS: I wanted to check the code from Mol2-Reader but I dont found the Source. Maybe because its not opensource ;) NVM.