<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.cebitec.uni-bielefeld.de/brf-software/index.php?action=history&amp;feed=atom&amp;title=GenDBWiki%2FDeveloperDocumentation%2FGenDBDemoScript</id>
	<title>GenDBWiki/DeveloperDocumentation/GenDBDemoScript - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.cebitec.uni-bielefeld.de/brf-software/index.php?action=history&amp;feed=atom&amp;title=GenDBWiki%2FDeveloperDocumentation%2FGenDBDemoScript"/>
	<link rel="alternate" type="text/html" href="https://wiki.cebitec.uni-bielefeld.de/brf-software/index.php?title=GenDBWiki/DeveloperDocumentation/GenDBDemoScript&amp;action=history"/>
	<updated>2026-04-18T07:24:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>https://wiki.cebitec.uni-bielefeld.de/brf-software/index.php?title=GenDBWiki/DeveloperDocumentation/GenDBDemoScript&amp;diff=2027&amp;oldid=prev</id>
		<title>Admin: 2 revisions</title>
		<link rel="alternate" type="text/html" href="https://wiki.cebitec.uni-bielefeld.de/brf-software/index.php?title=GenDBWiki/DeveloperDocumentation/GenDBDemoScript&amp;diff=2027&amp;oldid=prev"/>
		<updated>2011-10-26T06:16:41Z</updated>

		<summary type="html">&lt;p&gt;2 revisions&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:16, 26 October 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://wiki.cebitec.uni-bielefeld.de/brf-software/index.php?title=GenDBWiki/DeveloperDocumentation/GenDBDemoScript&amp;diff=2025&amp;oldid=prev</id>
		<title>imported&gt;AlexanderGoesmann at 18:00, 16 November 2004</title>
		<link rel="alternate" type="text/html" href="https://wiki.cebitec.uni-bielefeld.de/brf-software/index.php?title=GenDBWiki/DeveloperDocumentation/GenDBDemoScript&amp;diff=2025&amp;oldid=prev"/>
		<updated>2004-11-16T18:00:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:00, 16 November 2004&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>imported&gt;AlexanderGoesmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.cebitec.uni-bielefeld.de/brf-software/index.php?title=GenDBWiki/DeveloperDocumentation/GenDBDemoScript&amp;diff=2026&amp;oldid=prev</id>
		<title>Unknown user at 00:00, 1 January 1970</title>
		<link rel="alternate" type="text/html" href="https://wiki.cebitec.uni-bielefeld.de/brf-software/index.php?title=GenDBWiki/DeveloperDocumentation/GenDBDemoScript&amp;diff=2026&amp;oldid=prev"/>
		<updated>1970-01-01T00:00:00Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
= A simple GenDB Demo Script =&lt;br /&gt;
&lt;br /&gt;
This simple demo script listed below fetches all contigs from a GenDB project database and prints out their names.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#!/usr/bin/env perl&lt;br /&gt;
&lt;br /&gt;
# simple GenDB demo script that reads all contigs and writes their names&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
use Carp;&lt;br /&gt;
use Getopt::Std;&lt;br /&gt;
use Term::ReadKey;&lt;br /&gt;
use IO::Handle;&lt;br /&gt;
use GPMS::Application_Frame::GENDB;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
#  this is necessary if the script is started via rsh(1)&lt;br /&gt;
#  otherwise you won&amp;#039;t see any output until the first &amp;lt;RETURN&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
STDOUT-&amp;gt;autoflush(1);&lt;br /&gt;
&lt;br /&gt;
sub usage {&lt;br /&gt;
    print &amp;quot;gendb_demo - get all contig sequences and write their names\n&amp;quot;;&lt;br /&gt;
    print &amp;quot;usage: gendb_demo -p &amp;lt;project&amp;gt;\n\n&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# global variables&lt;br /&gt;
our($opt_p);&lt;br /&gt;
&lt;br /&gt;
getopts(&amp;#039;p:&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
# start sanity checks&lt;br /&gt;
if (!$opt_p) {&lt;br /&gt;
    usage;&lt;br /&gt;
    print &amp;quot;ERROR: Can&amp;#039;t initialize GenDB: No project name given!\n&amp;quot;;&lt;br /&gt;
    exit 1;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
# get the login name of the current user&lt;br /&gt;
my $user = defined( $ENV{&amp;#039;LOGNAME&amp;#039;} ) ? $ENV{&amp;#039;LOGNAME&amp;#039;} : (getpwuid( $&amp;gt; ))[0];&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Enter your database password: &amp;quot;;&lt;br /&gt;
ReadMode(&amp;#039;noecho&amp;#039;);&lt;br /&gt;
my $password = ReadLine(0);&lt;br /&gt;
chomp $password;&lt;br /&gt;
print &amp;quot;\n&amp;quot;;&lt;br /&gt;
ReadMode(&amp;#039;normal&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
# try to initialize GenDB project&lt;br /&gt;
# initialize an Application_Frame for the current project&lt;br /&gt;
my $gendbAppFrame = GPMS::Application_Frame::GENDB-&amp;gt;new($user, $password);&lt;br /&gt;
&lt;br /&gt;
# check if the initialization succeeded&lt;br /&gt;
die &amp;quot;Unable to initialize ApplicationFrame for GenDB project!&amp;quot; unless (ref $gendbAppFrame);&lt;br /&gt;
&lt;br /&gt;
# try to initialize a project for the given name&lt;br /&gt;
$gendbAppFrame-&amp;gt;project($opt_p);&lt;br /&gt;
&lt;br /&gt;
# check a basic privilege   &lt;br /&gt;
exit unless $gendbAppFrame-&amp;gt;right(&amp;quot;basic_access&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
# get a global O2DBI-2 master object&lt;br /&gt;
my $master = $gendbAppFrame-&amp;gt;application_master();&lt;br /&gt;
&lt;br /&gt;
# fetchall contigs and print their names&lt;br /&gt;
print &amp;quot;Contigs in GenDB project $opt_p:\n\n&amp;quot;;&lt;br /&gt;
my $contigs = $master-&amp;gt;Region-&amp;gt;Source-&amp;gt;Contig-&amp;gt;fetchall();&lt;br /&gt;
foreach my $contig (@$contigs) {&lt;br /&gt;
    print $contig-&amp;gt;name.&amp;quot;\n&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;\nDone.\n\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Unknown user</name></author>
	</entry>
</feed>