openmolecules.org

 
Home » DataWarrior » Functionality » macro buildEvolutionaryLibrary from a mac terminal (macro buildEvolutionaryLibrary)
macro buildEvolutionaryLibrary from a mac terminal [message #1621] Sat, 04 June 2022 12:17 Go to next message
Bruno is currently offline  Bruno
Messages: 4
Registered: June 2022
Junior Member
Dear Thomas
I am trying to run a macro directly from the terminal on a MAc (i haven t tried yet on Linux)... The content of this test macro is below.
When i open it in DataWarrior it runs fine. When i run from the Terminal, it doesn t. Would you have some advice ?
many thanks
Bruno



<macro name=“TestMacro">
<task name="buildEvolutionaryLibrary">
paramConfig2=rotatableBonds 15 0
paramConfig1=cLogP 8 0
paramConfig0=molweight 350 750 0
kind=drugs
generationCount=automatic
survivalCount=32
startSet=ek`\JD@AGFnMOIc`Ha@HRYWmYUyWYgHhl\JjvNijZji`@jZfJAQ @@
generationSize=256
paramCount=3
</task>
<task name="selectWindow">
viewName=Evolutionary Library
</task>
<task name="selectView">
viewName=Table
</task>
<task name="deleteColumns">
defCriterion=
columnList=Child No cLogP cLogP Fitness Fitness Generation Molecular weight Molecular weight Fitness Parent Generation Parent ID Rotatable bond count Rotatable bond count Fitness
columnDefMode=list
</task>
<task name="findAndReplace">
isStructure=false
column=ID
isRegex=true
what=$
with=-coag
</task>
<task name="addSmilesCodes">
structureColumn=Structure
</task>
<task name="calculateCompoundProperties">
propertyList=nasty
structureColumn=Structure
</task>
<task name="deleteColumns">
defCriterion=
columnList=Structure
columnDefMode=list
</task>
<task name="saveTextFile">
fileName=/Users/Test/Desktop/Test-collection.dir/Evolutionar y_Library-coagulation.txt
</task>
<task name="closeWindow">
</task>
</macro>
Re: macro buildEvolutionaryLibrary from a mac terminal [message #1626 is a reply to message #1621] Mon, 06 June 2022 10:17 Go to previous messageGo to next message
thomas is currently offline  thomas
Messages: 715
Registered: June 2014
Senior Member
Hi Bruno,

I tried to reproduce, but had many problems with your macro:
- all TABs seem to be replaced by SPACEs
- the startset of the first task contains a SPACE close to the end that does not belong there
- the first double quote is a wrong double quote character
- the column list in deleteColumns task contains lots of duplicates

It seems that you used a text editor that does funny things on its own. Maybe the problems are related to that. Otherwise, please send me a fresh copy of the working macro and I will try again...
Re: macro buildEvolutionaryLibrary from a mac terminal [message #1627 is a reply to message #1626] Mon, 06 June 2022 11:21 Go to previous messageGo to next message
Bruno is currently offline  Bruno
Messages: 4
Registered: June 2022
Junior Member
Thanks Thomas
yes it was a copy and paste, but here is a similar macro directly saved from Datawarrior (dwam).
It runs fine when started with the app, but not from my terminal, with the terminal it opens the Osiris window but does not start the process as if i was missing a command.
Best
Bruno
Re: macro buildEvolutionaryLibrary from a mac terminal [message #1628 is a reply to message #1627] Mon, 06 June 2022 17:37 Go to previous messageGo to next message
thomas is currently offline  thomas
Messages: 715
Registered: June 2014
Senior Member
Hi Bruno, thank you for the update. I have experimented a little bit and found that the appbundler, which I use to build the Macintosh DataWarrior application (/Applications/DataWarrior.app/Contents/MacOS/DataWarrior) has a bug, which prevents command line arguments from being passed to the main() function of the DataWarrior Java bytecode. It seems that there is a fork, that solves this issue. I will verify that and possibly use that fork for the next full Macintosh version. For the time being you may use another mechanism to launch DataWarrior from the command line if you have a JRE8 installed. If you don't have one, then I recommend liberica (full version is important, because only that has JavaFX included). If you type 'java -version' in a terminal and if it gives you a version 1.8... then you can use the following to solve your issue, i.e. to run datawarrior with parameters from the command line:

Copy the attached batch file 'datawarrior' to launch the DataWarrior application.
You may need to type and run 'chmod 755 datawarrior' to make the file executable.

Then you may execute the macro with 'datawarrior mymacro.dwam'.

I also attach a working macro file t.dwam in the following. Please notice that the macro exits without a dialog 'Do you want to save...'. I just noticed that it is the forum software that does the funny things to the macro, if you disable SMILIES.


  • Attachment: t.dwam
    (Size: 1.21KB, Downloaded 239 times)
  • Attachment: datawarrior
    (Size: 0.46KB, Downloaded 236 times)

[Updated on: Mon, 06 June 2022 17:46]

Report message to a moderator

Re: macro buildEvolutionaryLibrary from a mac terminal [message #1635 is a reply to message #1628] Wed, 15 June 2022 12:09 Go to previous messageGo to next message
Bruno is currently offline  Bruno
Messages: 4
Registered: June 2022
Junior Member
thanks a lot Thomas
i got this error now when running ./datawarrior t.dwam
Error: Could not find or load main class com.actelion.research.datawarrior.DataWarriorActelionLinux

Re: macro buildEvolutionaryLibrary from a mac terminal [message #1647 is a reply to message #1635] Sat, 25 June 2022 12:55 Go to previous message
thomas is currently offline  thomas
Messages: 715
Registered: June 2014
Senior Member
sorry, in the datawarrior batch file you should replace DataWarriorActelionLinux by DataWarriorLinux or DataWarriorOSX.
Previous Topic: Export Superimposed structures
Next Topic: Saving 2D-structure with labels
Goto Forum:
  


Current Time: Thu Nov 21 23:00:04 CET 2024

Total time taken to generate the page: 0.03454 seconds