#!/usr/bin/env perl   

#  -*- perl -*-

use strict;
use warnings FATAL => qw ( all );
use Data::Dumper;
use Formats;
use Errors;

# ADDIT2
#
# Ebbe Sloth Andersen, March 2005.

# >>>>>>>>>>>>>>>>>> RUN PROGRAM <<<<<<<<<<<<<<<<<<<<

my ( $entries, $file, $file2, $header, $header2, $entries2 );

( $file, $file2 ) = @ARGV;
( $header, $entries ) = &Formats::read_col ( $file );
( $header2, $entries2 ) = &Formats::read_col ( $file2 );
&Errors::check_col ( $entries, { "TYPE" => ["RNA"] } );
unshift @{ $entries2 }, grep { $_->{'ENTRY'} eq "SS_cons" or $_->{'ENTRY'} eq "pairingmask" or $_->{'ENTRY'} eq "Pairingmask" } @{ $entries };
$header .= "This col file was generated by the program addit2.";
&Formats::write_col ( $header, $entries2 );

