Re: [base] how to get a db connection after call dc.commit()

2006-12-15 Thread Keith Ching
sorry.. here is the stack trace if i don't call dc.commit() until after 
looping through all the samples.

net.sf.basedb.core.BaseException: net.sf.basedb.core.data.ExtractData
at net.sf.basedb.core.HibernateUtil.loadData(HibernateUtil.java:1120)
at net.sf.basedb.core.Extract.countLabeledExtracts(Extract.java:250)
at edu.ucsd.basedb.plugins.AutoBuild.addLabeledExtract(AutoBuild.java:265)
at edu.ucsd.basedb.plugins.AutoBuild.run(AutoBuild.java:412)
at 
net.sf.basedb.core.PluginExecutionRequest.invoke(PluginExecutionRequest.java:82)
at 
net.sf.basedb.core.InternalJobQueue$JobRunner.run(InternalJobQueue.java:420)
at java.lang.Thread.run(Thread.java:613)
Caused by: org.hibernate.TransientObjectException: 
net.sf.basedb.core.data.ExtractData
at 
org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:219)
at org.hibernate.type.EntityType.getIdentifier(EntityType.java:108)
at org.hibernate.type.ManyToOneType.nullSafeSet(ManyToOneType.java:87)
at 
org.hibernate.loader.hql.QueryLoader.bindNamedParameters(QueryLoader.java:517)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1576)
at org.hibernate.loader.Loader.doQuery(Loader.java:661)
at 
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2144)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
at org.hibernate.loader.Loader.list(Loader.java:2023)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:393)
at 
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at 
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at net.sf.basedb.core.HibernateUtil.loadData(HibernateUtil.java:1114)
... 6 more

thanks for any help.

-keith

Keith Ching wrote:
> Hi,
>
> I am trying to write a plugin to automatically make objects from sample 
> -> rawbioassay.
> however, after you call dc.commit() it closes the connection.  what is 
> the normal way to
> re-establish a connection?  dc.reconnect() does not seem to work.  
> getting a new dc via
> dc = sc.newDbControl(); does not seem to work either.
>
> i need to commit the created objects between steps because subsequent 
> objects do database
> lookups of previous objects to create themselves.
>
> here is my general outline.
>
> ArraySlide slide;
> for (Sample sourceObj : sources)
> {
> dc.reattachItem(sourceObj);
> /**
>  * 1. get the slide
>  */
> slideName = sourceObj.getName().split(" ")[0];
> slide = getSlideByName(dc, slideName);
>
> /**
>  * 2. make chromatin input sample from pooled sample
>  */
> Sample chromatinSample = getChromatinSample(dc, sourceObj);
> Extract chromatinExtract = addExtract(dc, chromatinSample);
> /**
>  * 3. make the extract from the pooled sample
>  */
> Extract pooledExtract = addExtract(dc, sourceObj);
> dc.commit();
>
> dc = sc.newDbControl();
> /**
>  * 4. make the labelled extracts from extracts
>  */
> LabeledExtract chromatinLabeledExtract = 
> addLabeledExtract(dc, inputLabel, chromatinExtract);
> LabeledExtract pooledLabeledExtract = 
> addLabeledExtract(dc, poolLabel, pooledExtract);
> dc.commit();
> dc = sc.newDbControl();
> /**
>  * 5. make the hybridization from the matched pairs, add 
> the slide
>  */
> Hybridization hyb = addHybridization(dc, 
> chromatinLabeledExtract, pooledLabeledExtract, slide);
> dc.commit();
> dc = sc.newDbControl();
> /**
>  * 6. make the scan
>  */
> Scan scan = addScan(dc, hyb);
> dc.commit();
> dc = sc.newDbControl();
> /**
>  * 7. make the rawbioassay
>  */
> String datatype = "GenePix";
> RawBioAssay myRawBioAssay = addRawBioAssay(dc, scan, 
> RawDataTypes.getRawDataType(datatype) );
> dc.commit();
> dc = sc.newDbControl();
> // group into experiment ?
>
> fileNames = fileNames + " " + 
> myRawBioAssay.getName();   
> }
>
>   

-- 
Keith Ching, Ph.D.
Bioinformatics, Laboratory of Gene Regulation
Ludwig Institute for Cancer Research
9500 Gilman Drive, #0653
CMM East, Room 3020
La Jolla, CA 92093-0653

[EMAIL PROTECTED]
858-822-5767


--

[base] how to get a db connection after call dc.commit()

2006-12-15 Thread Keith Ching
Hi,

I am trying to write a plugin to automatically make objects from sample 
-> rawbioassay.
however, after you call dc.commit() it closes the connection.  what is 
the normal way to
re-establish a connection?  dc.reconnect() does not seem to work.  
getting a new dc via
dc = sc.newDbControl(); does not seem to work either.

i need to commit the created objects between steps because subsequent 
objects do database
lookups of previous objects to create themselves.

here is my general outline.

ArraySlide slide;
for (Sample sourceObj : sources)
{
dc.reattachItem(sourceObj);
/**
 * 1. get the slide
 */
slideName = sourceObj.getName().split(" ")[0];
slide = getSlideByName(dc, slideName);
   
/**
 * 2. make chromatin input sample from pooled sample
 */
Sample chromatinSample = getChromatinSample(dc, sourceObj);
Extract chromatinExtract = addExtract(dc, chromatinSample);
/**
 * 3. make the extract from the pooled sample
 */
Extract pooledExtract = addExtract(dc, sourceObj);
dc.commit();

dc = sc.newDbControl();
/**
 * 4. make the labelled extracts from extracts
 */
LabeledExtract chromatinLabeledExtract = 
addLabeledExtract(dc, inputLabel, chromatinExtract);
LabeledExtract pooledLabeledExtract = 
addLabeledExtract(dc, poolLabel, pooledExtract);
dc.commit();
dc = sc.newDbControl();
/**
 * 5. make the hybridization from the matched pairs, add 
the slide
 */
Hybridization hyb = addHybridization(dc, 
chromatinLabeledExtract, pooledLabeledExtract, slide);
dc.commit();
dc = sc.newDbControl();
/**
 * 6. make the scan
 */
Scan scan = addScan(dc, hyb);
dc.commit();
dc = sc.newDbControl();
/**
 * 7. make the rawbioassay
 */
String datatype = "GenePix";
RawBioAssay myRawBioAssay = addRawBioAssay(dc, scan, 
RawDataTypes.getRawDataType(datatype) );
dc.commit();
dc = sc.newDbControl();
// group into experiment ?
   
fileNames = fileNames + " " + 
myRawBioAssay.getName();   
}

-- 
Keith Ching, Ph.D.
Bioinformatics, Laboratory of Gene Regulation
Ludwig Institute for Cancer Research
9500 Gilman Drive, #0653
CMM East, Room 3020
La Jolla, CA 92093-0653

[EMAIL PROTECTED]
858-822-5767


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
The BASE general discussion mailing list
basedb-users@lists.sourceforge.net
unsubscribe: send a mail with subject "unsubscribe" to
[EMAIL PROTECTED]


Re: [base] Réplicates in base 2

2006-12-15 Thread Johan Enell




I think I should answer this. There is still some features in the
Base1PluginExecuter to be done. It tries to simulate the plug-in
execution of BASE 1.2.17 and that process was a little bit more complex
then I first thought.


Q1?
-Why 3 Bioassay sets are created by this plugin ? (I clicked only 1
time)

A1-
There is only one BioAssaySet created, "Something after".
"Something---" is you transformation and JE_nbrOfElemets is a extra
value created by the plug-in.


Q2?
-Why those strange names: Something---, Something after (OK, it is not
a serious pb, except that I'm afraid it is the sign of something wong
in the process)

A2-
The names is because the plug-in (Base1PluginExecuter) is still in
development. It will of course change to be a useful name instead.


Q3?
-Why, in the Bioassay set Something after, are there 77148 Spots and 0
Reporters?

A3-
This is a known issue and of course it's wrong and will be corrected.


Q4?
-Why an extra value called JE_nbrOfElements is created as a last stuff ?

A3-
This is an extra value created by the plug-in. This value is the number
of spots the new merged spot was created from.

/Johan


Emmanuel Courcelle wrote:

  
  
  
  
I don't know much about the BASE 1 plugins. What do you think is buggy?

/Nicklas

  
  
  
Sorry, the html  copy-and-paste  was not clear; here is a hand-made
copy-and-paste:
  
  Name                                          
Spots/Values    Reporters
Plugin
Median FG              
                                             
 Formula intensity
calculator
   
Mediane   
80640  6229
   Filter: raw('flags') ==
0  
JEP filter plugin
  Filtered Mediane   
77148  6158
  Normalization: Median
ratio
Normalization: Median ratio
 Filtered normalized Mediane 
77148  6158
 
Something---
Base1PluginExecuter
   Something after
77148  0
    JE_nbrOfElements
77148 
Base1PluginExecuter
  
So, the things I don't understand (buggy or not buggy, that is the
question):
  
-Why 3 Bioassay sets are created by this plugin ? (I clicked only 1
time)
-Why those strange names: Something---, Something after (OK, it is not
a serious pb, except that I'm afraid it is the sign of something wong
in the process)
-Why, in the Bioassay set Something after, are there 77148 Spots and 0
Reporters ?
-Why an extra value called JE_nbrOfElements is created as a last stuff ?
  
  
  -- 
Emmanuel COURCELLE[EMAIL PROTECTED]
L.I.P.M. (UMR CNRS-INRA 2594/441) tel (33) 5-61-28-54-50
B.P.52627 - 31326 CASTANET TOLOSAN Cedex - FRANCE
--

  
  

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
  

___
The BASE general discussion mailing list
basedb-users@lists.sourceforge.net
unsubscribe: send a mail with subject "unsubscribe" to
[EMAIL PROTECTED]
  




-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
The BASE general discussion mailing list
basedb-users@lists.sourceforge.net
unsubscribe: send a mail with subject "unsubscribe" to
[EMAIL PROTECTED]


Re: [base] Réplicates in base 2

2006-12-15 Thread Emmanuel Courcelle



I don't know much about the BASE 1 plugins. What do you think is buggy?

/Nicklas

  


Sorry, the html  copy-and-paste  was not clear; here is a hand-made 
copy-and-paste:


*Name   
Spots/ValuesReporters 
Plugin*
Median FG   
 
Formula intensity 
calculator
   
Mediane
80640  6229
  Filter: raw('flags') == 
0   
JEP filter plugin
 Filtered Mediane
77148  6158
 Normalization: Median 
ratio 
Normalization: Median ratio
Filtered normalized Mediane  
77148  6158
* 
Something--- 
Base1PluginExecuter
  Something after 
77148  0
   JE_nbrOfElements 
77148  
Base1PluginExecuter*


So, the things I don't understand (buggy or not buggy, that is the 
question):


-Why 3 Bioassay sets are created by this plugin ? (I clicked only 1 time)
-Why those strange names: Something---, Something after (OK, it is not a 
serious pb, except that I'm afraid it is the sign of something wong in 
the process)
-Why, in the Bioassay set Something after, are there 77148 Spots and 0 
Reporters ?

-Why an extra value called JE_nbrOfElements is created as a last stuff ?


--
Emmanuel COURCELLE[EMAIL PROTECTED]
L.I.P.M. (UMR CNRS-INRA 2594/441) tel (33) 5-61-28-54-50
B.P.52627 - 31326 CASTANET TOLOSAN Cedex - FRANCE
--


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
The BASE general discussion mailing list
basedb-users@lists.sourceforge.net
unsubscribe: send a mail with subject "unsubscribe" to
[EMAIL PROTECTED]