[Bio] / Babel / bin / export_ACH_resolution_DB.pl Repository:
ViewVC logotype

View of /Babel/bin/export_ACH_resolution_DB.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Tue Dec 1 15:22:43 2009 UTC (10 years, 7 months ago) by wilke
Branch: MAIN
CVS Tags: mgrast_dev_08112011, mgrast_dev_08022011, mgrast_dev_03052011, mgrast_dev_05262011, mgrast_dev_04082011, mgrast_dev_12152011, mgrast_dev_06072011, mgrast_dev_10262011, mgrast_dev_02212011, mgrast_release_3_0, mgrast_dev_03252011, mgrast_release_3_0_4, mgrast_release_3_0_2, mgrast_release_3_0_3, mgrast_release_3_0_1, mgrast_dev_03312011, mgrast_release_3_1_2, mgrast_release_3_1_1, mgrast_release_3_1_0, mgrast_dev_04132011, mgrast_dev_04012011, mgrast_dev_04052011, mgrast_dev_02222011
initial babel checkin

use Data::Dumper;
use Carp;
use FIG_Config;
use CGI;

my $cgi = new CGI;

use FIG;
my $fig = new FIG;

my $rdbH = $fig->db_handle;

&FIG::verify_dir("$FIG_Config::data/ACHresolution");

if (open(ASSERTION,">$FIG_Config::data/ACHresolution/Assertion"))
{
    my $relational_db_response = $rdbH->SQL("SELECT * FROM ACH_Assertion");
    foreach my $tuple (@$relational_db_response)
    {
	print ASSERTION join("\t",@$tuple),"\n";
    }
    close(ASSERTION);
}

if (open(CORR,">$FIG_Config::data/ACHresolution/Correspondence"))
{
    my $relational_db_response = $rdbH->SQL("SELECT * FROM ACH_Correspondence");
    foreach my $tuple (@$relational_db_response)
    {
	print CORR join("\t",@$tuple),"\n";
    }
    close(CORR);
}

if (open(COMMENTS,">$FIG_Config::data/ACHresolution/Comment_on_sequence_function"))
{
    my $relational_db_response = $rdbH->SQL("SELECT * FROM ACH_Comment_on_sequence_function");
    foreach my $tuple (@$relational_db_response)
    {
	my $comment = pop @$tuple;
	if (substr($comment,-1) ne "\n")
	{
	    $comment .= "\n";
	}
	$comment = &decode($comment);
	print COMMENTS join("\t",@$tuple),"\n$comment//\n";
    }
    close(COMMENTS);
}

if (open(COMMENT,">$FIG_Config::data/ACHresolution/Comment_on_status_change"))
{
    my $relational_db_response = $rdbH->SQL("SELECT * FROM ACH_Comment_on_status_change");
    foreach my $tuple (@$relational_db_response)
    {
	print COMMENT join("\t",@$tuple),"\n";
    }
    close(COMMENT);
}

sub decode {
    my($x) = @_;

    $x =~ s/\\\\/\\/g;
    $x =~ s/\'\'/\'/g;
    return $x;
}


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3