AcePerl: create new object

Ed Griffiths edgrif at sanger.ac.uk
Tue Nov 5 05:51:38 EST 2002


Jan,

I am not an aceperl person but here goes....


> I'm trying to write a script in which I can create objects (e.g. STS,
> BAC, ...) and insert these objects in an AceDB database.
> Unfortunately, very strange things happen. When I run the script (see
> code below), _no_ new object is created. But when I change the name of
> the object (in the code: replace "TestSTS" with e.g. "TestSTS1") and I
> run the script for the first time after this change, it _sometimes_
> inserts the object in the database (this is not always the case...).
> 
> A second problem: if the object gets inserted in the database, you
> can't click it to get its properties (in the code below: you can't
> access the STS_length or Oligo's). And the name does not appear as
> "TestSTS", but as "TestSTS;".

This behaviour suggests that if you do manage to create an object it is empty,
acedb does not show details for emtpy objects.

Can you show us the entry in models.wrm for the class STS ?

Also, can an aceperl person please check out the below code and get back to
Jan....

cheers Ed

> <START CODE>
> : use Ace;
> :
> : my $db = Ace->connect(-path => "/home/acedb/chickace");
> :
> : my $obj = new Ace::Object(-class => 'STS'
> :                          ,-name => "TestSTS"
> :                          ,-database => $db);
> : $obj->add(STS_length => 800);
> : $obj->add(Oligo_1 => "OL_1");
> : $obj->add(Oligo_2 => "OL_2");
> :
> : $obj->commit;
> :
> : $db->close();
> <END CODE>

-- 
 ------------------------------------------------------------------------
| Ed Griffiths, Acedb development, Informatics Group,                    |
|        Wellcome Trust Sanger Institute, Wellcome Trust Genome Campus,  |
|               Hinxton, Cambridge CB10 1SA, UK                          |
|                                                                        |
| email: edgrif at sanger.ac.uk  Tel: +44-1223-494780  Fax: +44-1223-494919 |
 ------------------------------------------------------------------------





More information about the Acedb mailing list