File: miranradical

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 (32 lines) | stat: -rwxr-xr-x 800 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /bin/bash
# Moves to another directory all SMILES containing a nitrogen atom which
# appears not to be trivalent. These SMILES should be checked, 
# in many cases, they are coordination compounds with correct brackets around
# the nitrogen.

[ -d nrad ] || mkdir nrad
for i in `ls *.smi` ; do
   radical=no
   dato=`cat $i | grep [[]N[]]`
   if [ "$dato" != "" ]; then
     radical=si
   else  
     dato=`cat $i | grep [[]NH[]]`
     if [ "$dato" != "" ]; then
       radical=si
     else
       dato=`cat $i | grep [[]NH2[]]`
       if [ "$dato" != "" ]; then
         radical=si
       else
         dato=`cat $i | grep [[]NH3[]]`
         if [ "$dato" != "" ]; then
           radical=si
         fi
       fi
     fi
   fi
   if [ "$radical" == "si" ]; then
     mv $i nrad       
   fi
done