File: singlechiral

package info (click to toggle)
smiles-scripts 0.2.0%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,208 kB
  • sloc: perl: 1,189; java: 1,094; sh: 1,052; makefile: 249
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