asad / ReactionDecoder

Reaction Decoder Tool (RDT) - Atom Atom Mapping Tool
GNU Lesser General Public License v3.0
76 stars 24 forks source link

mapping maltiple reactions #7

Open iwatobipen opened 5 years ago

iwatobipen commented 5 years ago

Dear Developer,

Is there any option for reaction mapping from list of reaction smiles? Currently I have file of reaction list and I would like to map many reactions. Any suggestion and advices are appreciated. Kind regards,

Taka

kjelljorner commented 4 years ago

@iwatobipen Did you ever find out how to do this? I have the same problem

iwatobipen commented 4 years ago

I wrote shell script to do it. But I took long time to process many reactions. I'm not good at Java so it has room for improvement. Thanks.

asad commented 4 years ago

Thanks, scripting is a way to go. We are exploring an inbuilt routine.

asad commented 4 years ago

Below is the shell script which can be used in BASH environment on UNIX/LINUX.

a) Store this in a file.. maybe run_recoder.sh b) change the jar file name in JAR variable c) RXN_FILE_DIR is the path to RXN files directory d) run it in a shell prompt sh run_recoder.sh RXN_FILE_DIR

#!/bin/bash
rxn_dir=$1
job_DIR="OUTPUT"
mkdir $job_DIR
for i in rxn_dir/*.rxn
do
 echo "Preparing job for $i"
 rxn_file = $i
 xbase=${rxn_file##*/}
 xpref=${xbase%.*}
 job_id=xpref
 JAR="ReactionDecoder.jar"
 echo "Processing JobID=$job_id rxn_file=$rxn_file"
 JOB="java -Xmx4G -jar $JAR -c -g -x -f BOTH -j AAM -p $job_id -Q RXN -q $rxn_file"
 echo "Running command $JOB"
 $JOB >> job.log
done

echo "===DONE=="
alperyilmaz commented 3 years ago

Hi, Here's a way to process many SMILES reactions in parallel.

parallel --joblog results/runtask.log --colsep ',' -j 10 'java -jar ReactionDecoder.jar -Q SMI -q "{=2 uq() =}" -g-c -j AAM -p results/{1} -f TEXT' :::: rxn_list.csv
UnixJunkie commented 2 years ago

there should be a -i option: reaction SMILES input file. And a -o option: reaction SMILES (mapped) output file

UnixJunkie commented 2 years ago

@iwatobipen you should try this updated version https://github.com/Laboratoire-de-Chemoinformatique/RDTool. They have -i and -o. It's a little slow though; about 1s per reaction and you need to set a timeout (maybe something like 3s) so that mapping some reactions doesn't take 20min...