[Bio] / Sprout / SaplingTest.pl Repository:
ViewVC logotype

View of /Sprout/SaplingTest.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Sat Oct 1 10:35:02 2011 UTC (8 years, 9 months ago) by parrello
Branch: MAIN
CVS Tags: mgrast_release_3_1_2, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_10262011
Changes since 1.1: +36 -3 lines
Conversion to support Postgres for ERDB.

#!/usr/bin/perl -w

use strict;
use DBKernel;
use SeedUtils;
use Sapling;
use SaplingGenomeLoader;
use SaplingTaxonomyLoader;
use SaplingSubsystemLoader;

    my %options;
    if ($ENV{DB} eq 'mysql') {
        %options = (dbName => 'sapling_test', dbms => 'mysql',
            dbhost => 'localhost', port => 3306);
    } else {
        %options = (dbName => 'pg_sapling', dbms => 'Pg', 
        userData => 'seed/seed', dbhost => 'localhost', port => 5432);
    }
    my $sap = Sapling->new(%options, DBD => 'C:/Users/Bruce/FIG/FIG/WinBuild/SaplingDBD.xml');
    $sap->CreateTables();
    my $stats = SaplingGenomeLoader::Load($sap, 360108.3, 'C:/Users/Bruce/FIG/WebData/360108.3');
    print "Genome load:\n" . $stats->Show();
    $stats = SaplingSubsystemLoader::Process($sap, 'Benzoate degradation', 'C:/Users/Bruce/FIG/WebData/Subsystems/Benzoate_degradation');
    print "Subsystem load:\n" . $stats->Show();
    my $count1 = $sap->GetCount("Role", "Role(id) LIKE ?", ["Photosystem%"]);
    print "Photosystem count = $count1\n";
    $count1 = $sap->UpdateField("Feature(feature-type)", "rna", "rrna");
    print "RNAs updated: $count1\n";
    $sap->UpdateEntity(Feature => "fig|360108.3.rna.23", locked => 1, function => "phony function");
    print "fig|360108.3.rna.23 modified.\n";
    $sap->Disconnect("IsIdentifiedBy", "Identifier", "cds.1");
    print "cds.1 disconnected.\n";
    $sap->DeleteRow("IsIdentifiedBy", "fig|360108.3.peg.1", "ZP_01070606.1");
    print "peg 1 disconnected from ZP identifier.\n";
    $count1 = $sap->DeleteLike("IsIdentifiedBy", "IsIdentifiedBy(conf) = ?", ['A']);
    print "$count1 high-confidence identifiers deleted.\n";
    $count1 = $sap->DeleteValue("Role", "Photosystem II protein PsbI",
        "role-index", 7994);
    print "$count1 role-index rows deleted.\n";
    print "All done.\n";

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3