The GUS 3.0 Perl Object Layer CBIL Jonathan Schug June 18 2002.

Slides:



Advertisements
Similar presentations
Query Methods (SQL). What is SQL A programming language for databases. SQL (structured Query Language) It allows you add, edit, delete and run queries.
Advertisements

Program Management Portal: Overview for the Client
David M. Kroenke and David J. Auer Database Processing: F undamentals, Design, and Implementation Chapter Ten: Managing Databases with SQL Server 2008.
PHP (2) – Functions, Arrays, Databases, and sessions.
Process Description and Control Module 1.0. Major Requirements of an Operating System Interleave the execution of several processes to maximize processor.
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
Object-Oriented Application Development Using VB.NET 1 Chapter 13 Introduction to Data Access Classes and Persistence.
1 Relational Model. 2 Relational Database: Definitions  Relational database: a set of relations  Relation: made up of 2 parts: – Instance : a table,
Concepts of Database Management Sixth Edition
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
OLE and ODBC: Taming the Technologies The Third Annual Perl Conference, 1999 Sunday, August 22, 1999Roth Consulting ODBC.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 25 – Perl and CGI (Common Gateway Interface) Outline 25.1 Introduction 25.2 Perl 25.3 String Processing.
Module 9: Managing Schema Objects. Overview Naming guidelines for identifiers in schema object definitions Storage and structure of schema objects Implementing.
Enterprise Object Framework. What is EOF? Enterprise Objects Framework is a set of tools and resources that help you create applications that work with.
Lecture 3 – Data Storage with XML+AJAX and MySQL+socket.io
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Introduction –All information systems create, read, update and delete data. This data is stored in files and databases. Files are collections of similar.
Web Application Development. Define ER model in QSEE Generate SQL Create Database mySQL Write Script to use TableEditor class Process to create A simple.
Web Application Development. Tools to create a simple web- editable database QSEE MySQL (or PHPMyAdmin) PHP TableEditor.
Concepts of Database Management Seventh Edition
1 Overview of Databases. 2 Content Databases Example: Access Structure Query language (SQL)
ADO.NET A2 Teacher Up skilling LECTURE 3. What’s to come today? ADO.NET What is ADO.NET? ADO.NET Objects SqlConnection SqlCommand SqlDataReader DataSet.
© 2004 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice SISP Training Documentation Template.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Needs for Accessing Database To make your web site more dynamic and maintainable, you can display information on your web pages that are retrieved from.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Working with MSSQL Server Code:G0-C# Version: 1.0 Author: Pham Trung Hai CTD.
GUS Plugin System Michael Saffitz Genomics Unified Schema Workshop July 6-8th, Philadelphia, Pennsylvania.
(Chapter 10 continued) Our examples feature MySQL as the database engine. It's open source and free. It's fully featured. And it's platform independent.
1 Client/Server Databases and the Oracle Relational Database.
Treasures of Cache 2010 Ian Cargill Development Manager Dendrite Clinical Systems.
Concepts of Database Management Seventh Edition
1 The Relational Model. 2 Why Study the Relational Model? v Most widely used model. – Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc. v “Legacy.
FALL 2004CENG 351 File Structures and Data Management1 Relational Model Chapter 3.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
Chapter 10: The Data Tier We discuss back-end data storage for Web applications, relational data, and using the MySQL database server for back-end storage.
1 Database Concepts 2 Definition of a Database An organized Collection Of related records.
Templates, Databases and Frameworks. Databases: DBI Common database interface for perl Provides a functional,
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
Chapter 38 Persistence Framework with Patterns 1CS6359 Fall 2011 John Cole.
SQL Injection Jason Dunn. SQL Overview Structured Query Language For use with Databases Purpose is to retrieve information Main Statements Select Insert.
Chapter 9 Database Systems Introduction to CS 1 st Semester, 2014 Sanghyun Park.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Component 4: Introduction to Information and Computer Science Unit 6a Databases and SQL.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
GUS 3.0: Implementation and Dependencies June 19, 2002 Jonathan Crabtree
Linux+ Guide to Linux Certification, Third Edition
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Object storage and object interoperability
CP476 Internet Computing Perl CGI and MySql 1 Relational Databases –A database is a collection of data organized to allow relatively easy access for retrievals,
Starting with Oracle SQL Plus. Today in the lab… Connect to SQL Plus – your schema. Set up two tables. Find the tables in the catalog. Insert four rows.
JAVA: An Introduction to Problem Solving & Programming, 6 th Ed. By Walter Savitch ISBN © 2012 Pearson Education, Inc., Upper Saddle River,
Module 6: Administering Reporting Services. Overview Server Administration Performance and Reliability Monitoring Database Administration Security Administration.
G.Govi CERN/IT-DB 1GridPP7 June30 - July 2, 2003 Data Storage with the POOL persistency framework Motivation Strategy Storage model Storage operation Summary.
Level 1-2 Trigger Data Base development Current status and overview Myron Campbell, Alexei Varganov, Stephen Miller University of Michigan August 17, 2000.
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
Java Object-Relational Layer Sharon Diskin GUS 3.0 Workshop June 18-21, 2002.
Interstage BPM v11.2 1Copyright © 2010 FUJITSU LIMITED INTEGRATION.
DBS201: Data Modeling. Agenda Data Modeling Types of Models Entity Relationship Model.
1 Copyright © 2008, Oracle. All rights reserved. Repository Basics.
CENG 351 File Structures and Data Management1 Relational Model Chapter 3.
Chapter 9 Database Systems
IS444: Modern tools for applications development
IS444: Modern tools for applications development
“Introduction To Database and SQL”
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Java Object-Relational Layer
JDBC II IS
Presentation transcript:

The GUS 3.0 Perl Object Layer CBIL Jonathan Schug June

Outline Overview Objects Using Objects Superclasses GA - GusApplication Plugins

A Programmer's View of GUS3.0 The application programmer interacts with GUS via the GusApplication (GA) Perl program. The GA is a general framework for connecting to GUS30. Specific tasks are performed by individual plugins. Plugins use either table-specific classes or SQL access. Low-level database access is provided by DBI classes. RADTESSDoTS CoreSRes DBI Plugin Class SuperClasses SQL GusApplication

A GUS3.0 Table Primary key Table-specific attributes GUS overhead attributes Parents - pointed to by this table Children - point to this table

A GUS3.0 Perl Object Layer Class GUS30/DoTS/Clone.pm package DoTS::Clone; use strict; use GUS30::DoTS::gen::Clone_gen; use vars = qw (DoTS::Clone_gen); 1; Relies on _gen class for accessor methods. This is stub for hand-edited domain-specific methods.

The _gen Class - I GUS30/DoTS/gen/Clone_gen.pm package DoTS::Clone_gen; use strict; use GUS30::dbiperl_utils::RelationalRow; use vars = qw (RelationalRow); sub setDefaultParams {... } Inherits from RelationalRow setDefaultParams to determine if versionable and updateable.

The _gen Class - II GUS30/DoTS/gen/Clone_gen.pm sub setCloneId {... } sub getCloneId {... } sub setLibraryId {... } sub getLibraryId {... } sub setImageId {... } sub getImageId {... } sub setDbestCloneUid {... } sub getDbestCloneUid {... } sub setWashuName {... } sub getWashuName {... } sub setGdbId {... } sub getGdbId {... } sub setMgiId {... } sub getMgiId {... } sub setDbestLength {... } sub getDbestLength {... } sub setWashuLength {... } sub getWashuLength {... } There is an accessor for each column. Note the case change and loss of underscores.

The _gen Class - III GUS30/DoTS/gen/Clone_gen.pm sub setModificationDate {... } sub getModificationDate {... } sub setUserRead {... } sub getUserRead {... } sub setUserWrite {... } sub getUserWrite {... } sub setGroupRead {... } sub getGroupRead {... } sub setGroupWrite {... } sub getGroupWrite {... } sub setOtherRead {... } sub getOtherRead {... } sub setOtherWrite {... } sub getOtherWrite {... } sub setRowUserId {... } sub getRowUserId {... } sub setRowGroupId {... } sub getRowGroupId {... } sub setRowProjectId {... } sub getRowProjectId {... } sub setRowAlgInvocationId {... } sub getRowAlgInvocationId {... } There is an accessor for each column. Note the case change and loss of underscores.

Hand Edited Methods Edit main class file, e.g., GUS30/DoTS/Clone.pm Typically placed in GUS30/DoTS/hand_edited/ Symlink in GUS30/DoTS. Mostly used in DoTS section. DoTS/AAFeature.pm:4 DoTS/AASequence.pm:2 DoTS/Assembly.pm:76 DoTS/AssemblySequence.pm:29 DoTS/Evidence.pm:6 DoTS/GeneFeature.pm:4 DoTS/Gene.pm:9 DoTS/IndexWordSimLink.pm:2 DoTS/NAFeature.pm:5 DoTS/NASequence.pm:4 DoTS/RNAFeature.pm:4 DoTS/RNA.pm:3 DoTS/Similarity.pm:9 DoTS/SimilaritySpan.pm:6 DoTS/SplicedNASequence.pm:1 DoTS/TranslatedAAFeature.pm:3 DoTS/TranslatedAAFeatureSegment.pm:2 DoTS/TranslatedAASequence.pm:1 DoTS/VirtualSequence.pm:1

Creating Objects # get the class use GUS30::DoTS::Clone; … # create new object my $clone_gus = DoTS::Clone->new({ washu_length => 5, }); # adjust a column value $clone_gus->setDbestUid(‘A123456’); # print some values. print $clone_gus->getDbestUid, “\n”; print $clone_gus->toXML, “\n”; # submit to database $clone_gus->submit;

Connecting Objects use GUS30::DoTS::Clone; use GUS30::DoTS::CloneLibrary; My $clone_lib_gus = DoTS::CloneLibrary->new({…}); While (<>) { chomp; = split /\t/; my $clone_gus = DoTS::Clone->new({…}); # this $clone_lib_gus->addChild($clone_gus); # or this $clone_gus->setParent($clone_lib_gus); } $clone_lib_gus->submit;

Retrieving Objects Use GUS30::DoTS::CloneLibrary; My $clone_lib_gus = DoTS::CloneLibrary->new({ clone_library_id => }); If ($clone_lib_gus->retrieveFromDB) { $clone_lib_gus->set…(…); $clone_lib_gus->submit; print “found it!\n”; } Else { print “did not find any unique row!\n”; }

Traversing Object Relations - I Use GUS30::DoTS::CloneLibrary; Use GUS30::DoTS::Clone; My $clone_lib_gus = DoTS::CloneLibrary({ clone_library_id => }); If ($clone_lib_gus->retrieveFromDB) { = $clone_lib_gus->getChildren(‘DoTS.Clone’,1); foreach { … }

Traversing Object Relations - II Use GUS30::DoTS::CloneLibrary; Use GUS30::DoTS::Clone; My $clone_lib = DoTS::Clone->new({ clone_id => }); If ($clone_gus->retrieveFromDB) { my $clone_lib_gus = $clone_gus->getParent(‘DoTS.CloneLibrary’,1);... }

Deleting Objects Use GUS30::DoTS::CloneLibrary; Use GUS30::DoTS::Clone; My $clone_lib_gus = DoTS::CloneLibrary({ clone_library_id => }); If ($clone_lib_gus->retrieveFromDB) { $clone_lib_gus->markDeleted; = $clone_lib_gus->getChildren(‘DoTS.Clone’,1); foreach { $_->markDeleted; } $clone_lib_gus->submit; } Recursively deletes children as well.

The Object Cache A cache of objects is maintained so that getParents and getChildren always return the same instance of a row. Cache is limited in size to avoid large memory requirements. Cache is cleared with undefPointerCache method on object or plugin Cache size is increased with setMaximumNumberOfObjects method.

Dbiperl_utils Support and base classes for object classes. RelationalRow DbiRow DbiTable DbiDatabase

RelationalRow.pm Contains 176 methods in these categories: –Accessors for default overhead values –Accessors for debugging and verbose modes –Pointer cache maintenance –Class information –Parent/child information –XML management –Deletion marking –Submission management –Similarity and Evidence management Isa DbiRow

DbiRow.pm Contains 43 methods in these categories: –Get/Set methods to support class-specific accessors –Accessors for table and class names –Attribute information –Tracking attribute value changes –retrieveFromDB –IdentityInsert management –Get DbHandle, MetaHandle, and Database

DbiTable.pm 76 methods for –Various table names –Attribute information –Relations information –Primary keys and ids –Others

DbiDatabase.pm 103 methods covering these areas: –Database handles –Login information –Database and section names –Transaction management –Table and view names –Object cache –Counters

Overhead Columns Contain information about: History Ownership Access permissions Data provenance Who manages these columns?

GusApplication (GA) Purpose is to standardize database access application Provides: –Database login –Default ownership and permissions –Algorithm and parameter tracking –Command line access

Algorithms & Stuff Algorithm AlgorithmImplementation AlgorithmInvocation AlgorithmParamKey AlgorithmParamKeyType AlgorithmParam Tracks what programs implementing what algorithms were run with what parameters. GA populates these tables.

GA Usage ga [ ] [ ] is one of –+create : creates Algorithm, AlgorithmImplementation, and AlgorithmParamKey –+update : creates AlgorithmImplementation and AlgorithmParamKey –+history : lists invocations –+run : runs the plugin (default) –From hierarchical namespace, e.g., Utils::UpdateGusFromXML –Defined by plugin plus some generic GA options. –E.g., --file data.tab --commit --verbose

Plugins A plugin is just a package that inherits from GUS30::GA_plugins::Plugin. package = qw(GUS30::GA_plugins::Plugin); It must have two methods: –new - to create and initialize the plugin object –run - perform actions of plugin

The new Method Must initialize certain important plugin attributes: sub new { my $Class = shift; my $m = bless {}, $Class; $m->setUsage(‘what this algorithm does’); $m->setVersion('2.0'); $m->setRequiredDbVersion({ Core => ‘3’, DoTS => ‘3’ }); $m->setDescription(‘what is new in implementation); $m->setEasyCspOptions(…); # command line options return $m }

Command Line Options A hash describing a parameter: –h => hint for user –t => parameter data type (boolean, string, integer, float) –d => default value –l => is a list if true –e => list of legal reg-exps –r => required if true –o => command line flag E.g., { h => 'start label ordinals with this value', t => 'integer', d => 0, o => 'FirstOrdinal', },

GA-Supplied Comand-line Options GA adds these options: –commit –verbose –debug –user –group –project –comment –database –server –implementation –algoinvo Pink ones also read from config file.gus30.cfg

Example: TESS::LoadMultinomialLabelSet TESS::MultinomialLabelSetTESS::MultinomialLabel Task is to maintain entries in these two tables MultinomialLabelSet stores sets of labels for multinomial observations, e.g., DNA, AA, or dimer gaps. Can also be DNA or AA dimers, trimers, etc. MultinomialLabel stores individual names.