#!/usr/bin/perl -w

if (@ARGV == 0) {               # delete "transform" command
    while (<STDIN>) {
        print if !(/transform/ .. /;/);
    }
} elsif (@ARGV == 1 && (uc($ARGV[0]) =~ /-N/)) { # delete "header" to raster3d
    while (<STDIN>) {
        print if ($. > 20);
    }
} else {
    print <<DEL_MS_USAGE;
===========================================================================
SYNOPSIS
    del_ms [-n]
DESCRIPTION
    Deletes the "transform" section generated by "molauto" in MolScript in
    order to keep the original position and orientation. Deletes the "header"
    section generated by "molscript -r" to "render" in Raster3D to combine
    with other objects.
EXAMPLES
    molauto bdl084.pdb | del_ms
    molauto bdl084.pdb | del_ms | molscript -r | del_ms -n
AUTHOR
    Xiang-Jun Lu in the Laboratory of Wilma K. Olson at Rutgers Univ.
    Check URL: http://rutchem.rutgers.edu/~xiangjun/3DNA/
    Report bugs to <xiangjun\@rutchem.rutgers.edu>
===========================================================================
DEL_MS_USAGE
    die "\n";
}
