ReactionDecoder icon indicating copy to clipboard operation
ReactionDecoder copied to clipboard

mapping maltiple reactions

Open iwatobipen opened this issue 6 years ago • 7 comments

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

iwatobipen avatar Dec 07 '18 10:12 iwatobipen

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

kjelljorner avatar Apr 15 '20 10:04 kjelljorner

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.

iwatobipen avatar Apr 25 '20 12:04 iwatobipen

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

asad avatar Jun 24 '20 11:06 asad

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=="

asad avatar Jun 29 '20 13:06 asad

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
  • rxn_list.csv is comma separated file, first column is reaction name or id, second column is the reaction smiles
  • outputs and log are put under results folder, so create it before running the command
  • requires newer version of parallel, (>2019)
  • I chose number of jobs as 10 but due to Java's inability to configure cpu affinity, still uses all cpus

alperyilmaz avatar Dec 01 '20 23:12 alperyilmaz

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

UnixJunkie avatar Mar 02 '22 02:03 UnixJunkie

@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...

UnixJunkie avatar Mar 18 '22 04:03 UnixJunkie