File: singlechiral

package info (click to toggle)
smiles-scripts 0.3.0%2Bsvn878%2Bbranch%2Bsystem%2Bdeps-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,860 kB
  • sloc: perl: 1,889; java: 1,218; sh: 1,092; makefile: 246
file content (17 lines) | stat: -rwxr-xr-x 581 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /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