#! /bin/bash
# SMILES strings with only one chiral mark are moved to the folder unoquir,
# separating them from those with more than one chiral mark. This separation
# is useful before applying racemiza1 (to the moved strings) or racemiza2
# (to the other)

[ -d unoquir ] || mkdir unoquir
for i in `ls *.smi`; do
  dato=`cat $i`
  dato=`echo $dato | sed -e s/@/x/`
  echo $dato | grep -v @ >/dev/null && mv $i unoquir
  echo $dato | grep -v @ >/dev/null || {
    dato=`cat $i`
    dato=`echo $dato | sed -e s/@@/x/`
    echo $dato | grep -v @ >/dev/null && mv $i unoquir
  }
done
