File: singlechiral

package info (click to toggle)
smiles-scripts 0.4.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,296 kB
  • sloc: perl: 2,333; java: 1,231; sh: 1,154; makefile: 253
file content (17 lines) | stat: -rwxr-xr-x 581 bytes parent folder | download | duplicates (3)
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