You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
(30) |
Sep
(24) |
Oct
(8) |
Nov
(7) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(16) |
Feb
(24) |
Mar
(20) |
Apr
(66) |
May
(18) |
Jun
(8) |
Jul
(21) |
Aug
(7) |
Sep
(39) |
Oct
(15) |
Nov
(2) |
Dec
|
2004 |
Jan
(1) |
Feb
(7) |
Mar
(6) |
Apr
(1) |
May
(2) |
Jun
(1) |
Jul
(5) |
Aug
(2) |
Sep
|
Oct
(4) |
Nov
(5) |
Dec
(2) |
2005 |
Jan
|
Feb
(6) |
Mar
(2) |
Apr
(5) |
May
|
Jun
(2) |
Jul
|
Aug
(7) |
Sep
(7) |
Oct
(2) |
Nov
(10) |
Dec
|
2006 |
Jan
(5) |
Feb
(2) |
Mar
(12) |
Apr
(2) |
May
(26) |
Jun
(12) |
Jul
(5) |
Aug
(10) |
Sep
(2) |
Oct
(36) |
Nov
(14) |
Dec
(5) |
2007 |
Jan
(12) |
Feb
(16) |
Mar
(6) |
Apr
(4) |
May
(15) |
Jun
(6) |
Jul
(20) |
Aug
(54) |
Sep
(49) |
Oct
(51) |
Nov
(46) |
Dec
(33) |
2008 |
Jan
(28) |
Feb
(12) |
Mar
(12) |
Apr
(13) |
May
(2) |
Jun
(3) |
Jul
(8) |
Aug
(9) |
Sep
(5) |
Oct
(4) |
Nov
(1) |
Dec
(6) |
2009 |
Jan
(1) |
Feb
(2) |
Mar
(11) |
Apr
|
May
(9) |
Jun
(20) |
Jul
|
Aug
(1) |
Sep
|
Oct
(3) |
Nov
(1) |
Dec
(18) |
2010 |
Jan
(10) |
Feb
(9) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2011 |
Jan
(3) |
Feb
(8) |
Mar
(2) |
Apr
|
May
(1) |
Jun
(1) |
Jul
(1) |
Aug
(9) |
Sep
(6) |
Oct
(1) |
Nov
(5) |
Dec
|
2012 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
2015 |
Jan
(1) |
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(2) |
Nov
(2) |
Dec
|
2016 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2017 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(1) |
May
|
Jun
(3) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2021 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2023 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
From: Nicklas N. <ni...@th...> - 2011-02-01 12:13:37
|
I added a ticket: http://base.thep.lu.se/ticket/1575 /Nicklas |
From: Nicklas N. <ni...@th...> - 2011-02-01 12:03:43
|
On 2011-02-01 11:29, Pawel Sztromwasser wrote: > Hi, > > I am working on an external authentication plugin for BASE that will use > an STS Web service to authenticate users. The plugin uses a bunch of > external jars for WS communication, but with different versions then > BASE. I was hoping for the same classloading mechanism as for regular > plugins (separate classloaders), but it looks like external > authentication plugins uses the default classloader of the webapp. Could > this be changed? How else could I install my plugin, without messing > with BASE's jars? That part of BASE is not very "pluginified". I am not aware of any real case that uses external authentication so it would be very interesting to see if you succeed. It's quite common that there are dependencies to different versions of 3rd-party JAR files, but it usually works if the latest one is used. But of course, it may not work if the API has changed in an incompatible way. If you can't get it to work by clever selection of JAR files, then you might have to modify the Application.getAuthenticator() method so that it uses a different class loader. It shouldn't be too difficult. It could for example pick up a JAR path from the base.config file and then use the net.sf.basedb.util.JarClassLoader.getInstance(path) to create a class loader. Dependencies need to be listed in the MANIFEST.MF in the same way as for plug-ins. There is a short notice about this at http://base.thep.lu.se/chrome/site/latest/html/developerdoc/plugin_developer/plugin_developer.organize.html and http://base.thep.lu.se/chrome/site/latest/api/net/sf/basedb/util/JarClassLoader.html As always, patches are welcome :) /Nicklas |
From: Pawel S. <Paw...@bc...> - 2011-02-01 10:49:17
|
Hi, I am working on an external authentication plugin for BASE that will use an STS Web service to authenticate users. The plugin uses a bunch of external jars for WS communication, but with different versions then BASE. I was hoping for the same classloading mechanism as for regular plugins (separate classloaders), but it looks like external authentication plugins uses the default classloader of the webapp. Could this be changed? How else could I install my plugin, without messing with BASE's jars? Thanks, Pawel |
From: Bob M. <r.m...@im...> - 2011-01-21 20:38:50
|
Thanks very much - that did the trick. I should have looked more carefully at the google results, with hindsight, the answer was actually there! (a changeset for the documentation) On Fri, Jan 21, 2011 at 1:46 PM, Nicklas Nordborg <ni...@th...> wrote: > >> It used to work on 2.12.x but I'm having trouble reproducing that now >> because I don't have a database with the correct schema easily to hand >> (we could dig up an old backup...). >> >> After some detective work, I believe it's something to do with >> http://dev.thep.lu.se/base/ticket/1350 >> and >> http://dev.thep.lu.se/base/changeset/5026/trunk/src/core/net/sf/basedb/core/data/ReporterData.java >> >> Should we change our code? >> ("Microarray" is one of our object classes) > > Yes, I think this is due to changes in ticket 1350. It is known that > this may affect backwards compatibility and it is mentioned in the > documentation: > http://base.thep.lu.se/chrome/site/latest/html/appendix/appendix.incompatible.html#appendix.incompatible.2.13 > > There is also code snippet that illustrates how to fix the problem. > Basically you'll need something like: > > featQuery.join(Hql.leftJoin(null, "reporter", Item.REPORTER.getAlias(), > null, true)); > > Hope this helps. > > /Nicklas > > > ------------------------------------------------------------------------------ > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! > Finally, a world-class log management solution at an even better price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > basedb-devel mailing list > bas...@li... > https://lists.sourceforge.net/lists/listinfo/basedb-devel > |
From: Nicklas N. <ni...@th...> - 2011-01-21 14:13:22
|
> It used to work on 2.12.x but I'm having trouble reproducing that now > because I don't have a database with the correct schema easily to hand > (we could dig up an old backup...). > > After some detective work, I believe it's something to do with > http://dev.thep.lu.se/base/ticket/1350 > and > http://dev.thep.lu.se/base/changeset/5026/trunk/src/core/net/sf/basedb/core/data/ReporterData.java > > Should we change our code? > ("Microarray" is one of our object classes) Yes, I think this is due to changes in ticket 1350. It is known that this may affect backwards compatibility and it is mentioned in the documentation: http://base.thep.lu.se/chrome/site/latest/html/appendix/appendix.incompatible.html#appendix.incompatible.2.13 There is also code snippet that illustrates how to fix the problem. Basically you'll need something like: featQuery.join(Hql.leftJoin(null, "reporter", Item.REPORTER.getAlias(), null, true)); Hope this helps. /Nicklas |
From: Bob M. <r.m...@im...> - 2011-01-21 13:34:58
|
Hi, We're getting an exception in some of our own code compiled against base-2.16.2pre [java] Exception in thread "main" org.hibernate.SessionException: proxies cannot be fetched by a stateless session [java] at org.hibernate.impl.StatelessSessionImpl.immediateLoad(StatelessSessionImpl.java:244) [java] at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:176) [java] at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:215) [java] at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:191) [java] at net.sf.basedb.core.data.ReporterData_$$_javassist_37.hashCode(ReporterData_$$_javassist_37.java) [java] at java.util.HashMap.put(HashMap.java:372) [java] at java.util.HashSet.add(HashSet.java:200) [java] at org.vectorbase.funcgen.gesol.DB.base2.Base2ReporterAdaptor.fetchByMicroarray(Base2ReporterAdaptor.java:122) [java] at org.vectorbase.funcgen.lucene.IndexReporter.indexAll(IndexReporter.java:75) [java] at org.vectorbase.funcgen.lucene.IndexReporter.main(IndexReporter.java:50) It used to work on 2.12.x but I'm having trouble reproducing that now because I don't have a database with the correct schema easily to hand (we could dig up an old backup...). After some detective work, I believe it's something to do with http://dev.thep.lu.se/base/ticket/1350 and http://dev.thep.lu.se/base/changeset/5026/trunk/src/core/net/sf/basedb/core/data/ReporterData.java Should we change our code? ("Microarray" is one of our object classes) public List fetchByMicroarray(Microarray array) { ArrayList result = new ArrayList(); ArrayDesign baseArray = net.sf.basedb.core.ArrayDesign.getById(getDbControl(), array.getDBID()); DbControl dc = getDbControl(); if (baseArray.isPlatform(Platform.AFFYMETRIX)) { // snipped, // not relevant here } else { DataQuery<FeatureData> featQuery = baseArray.getFeatures(); featQuery.include(Include.SHARED); DataResultIterator<FeatureData> featIt = featQuery.iterate(dc); Set resultSet = new HashSet(); while (featIt.hasNext()) { FeatureData featData = (FeatureData)featIt.next(); resultSet.add(featData.getReporter()); } Iterator setIt = resultSet.iterator(); while(setIt.hasNext()) { org.vectorbase.funcgen.gesol.Reporter reporter = makeFromBaseRep((ReporterData)setIt.next()); result.add(reporter); } } return result; } Any help would be greatly appreciated - as we are not hibernate specialists. many thanks, Bob. |
From: Nicklas N. <ni...@th...> - 2010-11-22 07:54:34
|
Hello all, We are happy to announce the release of BASE 2.16. This is a bugfix release that fixes mostly minor bugs but also a critical problem that made it impossible to view reporter and raw data information in some places. For a complete list of changes, see: http://base.thep.lu.se/query?status=closed&milestone=BASE+2.16.1&group=type Installation/upgrade instructions: http://base.thep.lu.se/chrome/site/latest/html/admindoc/installation_upgrade/installation_upgrade.html As usual, the program can be downloaded from: http://base.thep.lu.se/wiki/DownloadPage /Nicklas |
From: Nicklas N. <ni...@th...> - 2010-11-03 09:05:15
|
Hello all, We are happy to announce the release of BASE 2.16. This is a major release which lots of new functionality and enhancements as well as some bug fixes For a complete list of changes, see: http://base.thep.lu.se/query?status=closed&milestone=BASE+2.16&group=type Installation/upgrade instructions: http://base.thep.lu.se/chrome/site/latest/html/admindoc/installation_upgrade/installation_upgrade.html As usual, the program can be downloaded from: http://base.thep.lu.se/wiki/DownloadPage /Nicklas |
From: Nicklas N. <ni...@th...> - 2010-04-20 07:29:26
|
Hello all, We are happy to announce the release of BASE 2.15. This is a major release which among other things include a new plug-in executor for running external analysis programs. The executor is highly configurable and extendable and it is intended that this should replace the old and inflexible wrapper for executing BASE 1 plug-ins. The new executor uses a new export/import format (BFS) which should be easier to use/parse than the old BASEfile format. For a complete list of changes, see: http://base.thep.lu.se/query?status=closed&milestone=BASE+2.15&group=type Installation/upgrade instructions: http://base.thep.lu.se/chrome/site/latest/html/admindoc/installation_upgrade/installation_upgrade.html As usual, the program can be downloaded from: http://base.thep.lu.se/wiki/DownloadPage /Nicklas |
From: Nicklas N. <ni...@th...> - 2010-02-22 10:21:06
|
Hello all, We are happy to announce the release of BASE 2.14.2. This is a bugfix release that fixes minor issues only. For a complete list of changes, see: http://base.thep.lu.se/query?status=closed&milestone=BASE+2.14.2&group=type Installation/upgrade instructions: http://base.thep.lu.se/chrome/site/latest/html/admindoc/installation_upgrade/installation_upgrade.html As usual, the program can be downloaded from: http://base.thep.lu.se/wiki/DownloadPage /Nicklas |
From: Nicklas N. <ni...@th...> - 2010-02-15 10:48:44
|
On 2010-02-15 11:26, Gildas Le Corguillé wrote: > Hi Jari, > > I watched this warning and tried to fix it. But I don't know enough Base > to understand this warning. > It was there before I worked on the plugin. It's when it wants to > retrieve LabeledExtract from Hybridization : > > ItemResultList<LabeledExtract> labeledExtracts = > (ItemResultList<LabeledExtract>) > rba.getScan().getHybridization().getCreationEvent().getSources().list(dc); > for (LabeledExtract labeledExtract :labeledExtracts) > { > > Despite this, it works :) Tag the method with @SuppressWarnings("unchecked") to get rid of the warning. The getSources() method can return LabeledExtract, Extract or Sample objects depending on which type of objects you start with. So the compiler issues a warning since it can't guarantee the exact type, but since you know that you are starting with a Hybridization it is safe to assume that it will return LabeledExtracts. I am not so sure that it is safe with rba.getScan().getHybridization().getCreationEvent() though. You may get a NullPointerException, PermissionDeniedException, etc. in any one of those steps. But maybe error handling has already been setup to handle this... > > About, BASE2WSClient.jar, it's a Base2 library. I include it in the lib > directory because I had a strange error in eclipse without it !? This jar file is somtimes required to compile even if the actual code only uses classes in the BASE2Core.jar file. It seems like the Tab2Mage exporter can be compiled without it. The problems with Eclipse is probably happening because it tries to load the entire BASE2Core.jar file, not just the parts that the Tab2Mage exporter needs. /Nicklas |
From: Gildas Le C. <lec...@sb...> - 2010-02-15 10:26:44
|
Hi Jari, I watched this warning and tried to fix it. But I don't know enough Base to understand this warning. It was there before I worked on the plugin. It's when it wants to retrieve LabeledExtract from Hybridization : ItemResultList<LabeledExtract> labeledExtracts = (ItemResultList<LabeledExtract>) rba.getScan().getHybridization().getCreationEvent().getSources().list(dc); for (LabeledExtract labeledExtract :labeledExtracts) { Despite this, it works :) About, BASE2WSClient.jar, it's a Base2 library. I include it in the lib directory because I had a strange error in eclipse without it !? I realize that my answers are not very clear ^^' Cheers Gildas Le 11/02/2010 15:10, Jari Häkkinen a écrit : > Forgot this in my previous post. > > > I have committed the code to the repository. Building Tab2MageExporter > causes a few warnings of which all but is complaining about use of > deprecated BASE2Core calls. There is one warning about unchecked cast: > > src/uk/ac/ebi/nugo/plugins/ta2mageexport/Tab2MageValidator.java:216: > warning: [unchecked] unchecked cast > [javac] found : net.sf.basedb.core.ItemResultList<capture#213 of > ? extends net.sf.basedb.core.MeasuredBioMaterial> > [javac] required: > net.sf.basedb.core.ItemResultList<net.sf.basedb.core.LabeledExtract> > [javac] > rba.getScan().getHybridization().getCreationEvent().getSources().list(dc); > > But that is probably okay? > > Also, the patch you provided has a reference to a file > Tab2MageExporter/lib/BASE2WSClient.jar that is not in the repository. > The file is not required for a successful compile of the > Tab2MageExporter. Maybe it is a stray file in your working copy? > > > Cheers, > > Jari > > > On 2/9/10 2:29 PM, Gildas Le Corguillé wrote: > >> Hi, >> >> I join you my patch for Tab2MageExporter. Is it what you expected in >> your email ? >> >> Until now, I've never participated to an open project. Thus don't be >> affraid if you see my name everywhere, it's because I wanted to sign and >> assume what I changed if there were troubles with my updates. >> >> I might have to make modifications later (bugs) or adapt this current >> script for a MAGE-TAB exporter because Tab2Mage format don't allow >> pooling like Base does : >> - Base : n samples in 1 sample >> - Tab2Mage : n sampels in 1 extract >> It will depend of my free times among my own projects. >> >> Excerpt from ChangeLog.txt : >> >> version 1.01 : 08/02/2010 - lecorguille >> - Fix a problem with pooling which was not supported ... for me >> - Modification : Filenames are use instead of RawBioAssays' names >> for File[raw] column in the Hybridization section >> - Add the possibility to have several Files[raw] per RawBioAssay (ex >> : one cy3 and one cy5) >> - Add a scan column in the Hybridization section >> - Add a BioSourceDescription column in the Hybridization section >> - Fix a problem with protocols in the Hybridization section >> >> >> Cheers >> >> Gildas >> >> >> >> Le 05/02/2010 11:27, Jari Häkkinen a écrit : >> >>> Hi Gildas, >>> >>> Great to see work done on the Tab2Mage exporter. The original author has >>> left for other tasks and the Tab2Mage code is currently without a >>> maintainer but lives under the GPL2 license so it is free to modify and >>> improve. >>> >>> You can submit your patches to me and I make sure that they are >>> committed to the repository. If you checked out the source from >>> subversion then you can simply create a patch diff. Excerpt from >>> http://base.thep.lu.se/wiki/DeveloperInformation: >>> >>> ... send an email to the developers list containing your log message and >>> the output of svn diff (from the top of your Subversion working copy) ... >>> >>> Send the patch to me. >>> >>> For the new method usage we simply increase the BASE version requirement >>> on the plug-in. I'll find out when the new method appeared in BASE. >>> Changing the Tab2Mage plugin will not affect already installed servers >>> but rather new users of the Tab2Mage plugin. Of course, users wanting to >>> use your new features must of course upgrade their BASE if it is >>> obsolete. >>> >>> >>> Cheers, >>> >>> Jari >>> >>> >>> On 2/5/10 10:07 AM, Gildas Le Corguillé wrote: >>> >>>> Dear colleagues, >>>> >>>> I had a problem with Tab2Mage exporter plugin about polling. >>>> Then to know if it was my fault or its fault, I downloaded the sources >>>> to study the pooling implications. >>>> >>>> And finally, I tried to fix what I thought be a bug. >>>> >>>> Now Tab2Mage_exporter : >>>> - supports pooling >>>> - creates a scan column in the output file >>>> - uses the filemane name in the "File[raw]" column instead of the >>>> RawBioAssay name >>>> - supports several files per RawBioAssay >>>> >>>> >>>> I hope I didn't add bug !? >>>> And now, what is your policy about submiting an update ? Must I contact >>>> the original author ? >>>> >>>> For the last point, I had to use the method RawBioAssay.setFileSet(). >>>> Which is implement in a newer BASE2Core than Tab2Mage_exporter >>>> previously used. >>>> But I don't know from which version of Base, this method appear ? Then >>>> if we propose my update, old version of base will show troubles. >>>> >>>> Thank you for your attention >>>> >>>> Best regards >>>> >>>> Gildas >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> >>>> The Planet: dedicated and managed hosting, cloud storage, colocation >>>> Stay online with enterprise data centers and the best network in the >>>> business >>>> Choose flexible plans and management services without long-term >>>> contracts >>>> Personal 24x7 support from experience hosting pros just a phone call >>>> away. >>>> http://p.sf.net/sfu/theplanet-com >>>> _______________________________________________ >>>> basedb-devel mailing list >>>> bas...@li... >>>> https://lists.sourceforge.net/lists/listinfo/basedb-devel >>>> >>> ------------------------------------------------------------------------------ >>> >>> The Planet: dedicated and managed hosting, cloud storage, colocation >>> Stay online with enterprise data centers and the best network in the >>> business >>> Choose flexible plans and management services without long-term contracts >>> Personal 24x7 support from experience hosting pros just a phone call >>> away. >>> http://p.sf.net/sfu/theplanet-com >>> _______________________________________________ >>> basedb-devel mailing list >>> bas...@li... >>> https://lists.sourceforge.net/lists/listinfo/basedb-devel >>> >> >> > > ------------------------------------------------------------------------------ > SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > http://p.sf.net/sfu/solaris-dev2dev > _______________________________________________ > basedb-devel mailing list > bas...@li... > https://lists.sourceforge.net/lists/listinfo/basedb-devel > |
From: Jari H. <ja...@th...> - 2010-02-11 14:10:38
|
Forgot this in my previous post. I have committed the code to the repository. Building Tab2MageExporter causes a few warnings of which all but is complaining about use of deprecated BASE2Core calls. There is one warning about unchecked cast: src/uk/ac/ebi/nugo/plugins/ta2mageexport/Tab2MageValidator.java:216: warning: [unchecked] unchecked cast [javac] found : net.sf.basedb.core.ItemResultList<capture#213 of ? extends net.sf.basedb.core.MeasuredBioMaterial> [javac] required: net.sf.basedb.core.ItemResultList<net.sf.basedb.core.LabeledExtract> [javac] rba.getScan().getHybridization().getCreationEvent().getSources().list(dc); But that is probably okay? Also, the patch you provided has a reference to a file Tab2MageExporter/lib/BASE2WSClient.jar that is not in the repository. The file is not required for a successful compile of the Tab2MageExporter. Maybe it is a stray file in your working copy? Cheers, Jari On 2/9/10 2:29 PM, Gildas Le Corguillé wrote: > Hi, > > I join you my patch for Tab2MageExporter. Is it what you expected in > your email ? > > Until now, I've never participated to an open project. Thus don't be > affraid if you see my name everywhere, it's because I wanted to sign and > assume what I changed if there were troubles with my updates. > > I might have to make modifications later (bugs) or adapt this current > script for a MAGE-TAB exporter because Tab2Mage format don't allow > pooling like Base does : > - Base : n samples in 1 sample > - Tab2Mage : n sampels in 1 extract > It will depend of my free times among my own projects. > > Excerpt from ChangeLog.txt : > > version 1.01 : 08/02/2010 - lecorguille > - Fix a problem with pooling which was not supported ... for me > - Modification : Filenames are use instead of RawBioAssays' names > for File[raw] column in the Hybridization section > - Add the possibility to have several Files[raw] per RawBioAssay (ex > : one cy3 and one cy5) > - Add a scan column in the Hybridization section > - Add a BioSourceDescription column in the Hybridization section > - Fix a problem with protocols in the Hybridization section > > > Cheers > > Gildas > > > > Le 05/02/2010 11:27, Jari Häkkinen a écrit : >> Hi Gildas, >> >> Great to see work done on the Tab2Mage exporter. The original author has >> left for other tasks and the Tab2Mage code is currently without a >> maintainer but lives under the GPL2 license so it is free to modify and >> improve. >> >> You can submit your patches to me and I make sure that they are >> committed to the repository. If you checked out the source from >> subversion then you can simply create a patch diff. Excerpt from >> http://base.thep.lu.se/wiki/DeveloperInformation: >> >> ... send an email to the developers list containing your log message and >> the output of svn diff (from the top of your Subversion working copy) ... >> >> Send the patch to me. >> >> For the new method usage we simply increase the BASE version requirement >> on the plug-in. I'll find out when the new method appeared in BASE. >> Changing the Tab2Mage plugin will not affect already installed servers >> but rather new users of the Tab2Mage plugin. Of course, users wanting to >> use your new features must of course upgrade their BASE if it is >> obsolete. >> >> >> Cheers, >> >> Jari >> >> >> On 2/5/10 10:07 AM, Gildas Le Corguillé wrote: >>> Dear colleagues, >>> >>> I had a problem with Tab2Mage exporter plugin about polling. >>> Then to know if it was my fault or its fault, I downloaded the sources >>> to study the pooling implications. >>> >>> And finally, I tried to fix what I thought be a bug. >>> >>> Now Tab2Mage_exporter : >>> - supports pooling >>> - creates a scan column in the output file >>> - uses the filemane name in the "File[raw]" column instead of the >>> RawBioAssay name >>> - supports several files per RawBioAssay >>> >>> >>> I hope I didn't add bug !? >>> And now, what is your policy about submiting an update ? Must I contact >>> the original author ? >>> >>> For the last point, I had to use the method RawBioAssay.setFileSet(). >>> Which is implement in a newer BASE2Core than Tab2Mage_exporter >>> previously used. >>> But I don't know from which version of Base, this method appear ? Then >>> if we propose my update, old version of base will show troubles. >>> >>> Thank you for your attention >>> >>> Best regards >>> >>> Gildas >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> The Planet: dedicated and managed hosting, cloud storage, colocation >>> Stay online with enterprise data centers and the best network in the >>> business >>> Choose flexible plans and management services without long-term >>> contracts >>> Personal 24x7 support from experience hosting pros just a phone call >>> away. >>> http://p.sf.net/sfu/theplanet-com >>> _______________________________________________ >>> basedb-devel mailing list >>> bas...@li... >>> https://lists.sourceforge.net/lists/listinfo/basedb-devel >> >> ------------------------------------------------------------------------------ >> >> The Planet: dedicated and managed hosting, cloud storage, colocation >> Stay online with enterprise data centers and the best network in the >> business >> Choose flexible plans and management services without long-term contracts >> Personal 24x7 support from experience hosting pros just a phone call >> away. >> http://p.sf.net/sfu/theplanet-com >> _______________________________________________ >> basedb-devel mailing list >> bas...@li... >> https://lists.sourceforge.net/lists/listinfo/basedb-devel > > |
From: Jari H. <ja...@th...> - 2010-02-11 14:05:14
|
Committed in http://baseplugins.thep.lu.se/changeset/1188 and the plug-in wiki page is updated accordingly. Thanks, Jari On 2/9/10 2:29 PM, Gildas Le Corguillé wrote: > Hi, > > I join you my patch for Tab2MageExporter. Is it what you expected in > your email ? > > Until now, I've never participated to an open project. Thus don't be > affraid if you see my name everywhere, it's because I wanted to sign and > assume what I changed if there were troubles with my updates. > > I might have to make modifications later (bugs) or adapt this current > script for a MAGE-TAB exporter because Tab2Mage format don't allow > pooling like Base does : > - Base : n samples in 1 sample > - Tab2Mage : n sampels in 1 extract > It will depend of my free times among my own projects. > > Excerpt from ChangeLog.txt : > > version 1.01 : 08/02/2010 - lecorguille > - Fix a problem with pooling which was not supported ... for me > - Modification : Filenames are use instead of RawBioAssays' names > for File[raw] column in the Hybridization section > - Add the possibility to have several Files[raw] per RawBioAssay (ex > : one cy3 and one cy5) > - Add a scan column in the Hybridization section > - Add a BioSourceDescription column in the Hybridization section > - Fix a problem with protocols in the Hybridization section > > > Cheers > > Gildas > > > > Le 05/02/2010 11:27, Jari Häkkinen a écrit : >> Hi Gildas, >> >> Great to see work done on the Tab2Mage exporter. The original author has >> left for other tasks and the Tab2Mage code is currently without a >> maintainer but lives under the GPL2 license so it is free to modify and >> improve. >> >> You can submit your patches to me and I make sure that they are >> committed to the repository. If you checked out the source from >> subversion then you can simply create a patch diff. Excerpt from >> http://base.thep.lu.se/wiki/DeveloperInformation: >> >> ... send an email to the developers list containing your log message and >> the output of svn diff (from the top of your Subversion working copy) ... >> >> Send the patch to me. >> >> For the new method usage we simply increase the BASE version requirement >> on the plug-in. I'll find out when the new method appeared in BASE. >> Changing the Tab2Mage plugin will not affect already installed servers >> but rather new users of the Tab2Mage plugin. Of course, users wanting to >> use your new features must of course upgrade their BASE if it is >> obsolete. >> >> >> Cheers, >> >> Jari >> >> >> On 2/5/10 10:07 AM, Gildas Le Corguillé wrote: >>> Dear colleagues, >>> >>> I had a problem with Tab2Mage exporter plugin about polling. >>> Then to know if it was my fault or its fault, I downloaded the sources >>> to study the pooling implications. >>> >>> And finally, I tried to fix what I thought be a bug. >>> >>> Now Tab2Mage_exporter : >>> - supports pooling >>> - creates a scan column in the output file >>> - uses the filemane name in the "File[raw]" column instead of the >>> RawBioAssay name >>> - supports several files per RawBioAssay >>> >>> >>> I hope I didn't add bug !? >>> And now, what is your policy about submiting an update ? Must I contact >>> the original author ? >>> >>> For the last point, I had to use the method RawBioAssay.setFileSet(). >>> Which is implement in a newer BASE2Core than Tab2Mage_exporter >>> previously used. >>> But I don't know from which version of Base, this method appear ? Then >>> if we propose my update, old version of base will show troubles. >>> >>> Thank you for your attention >>> >>> Best regards >>> >>> Gildas >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> The Planet: dedicated and managed hosting, cloud storage, colocation >>> Stay online with enterprise data centers and the best network in the >>> business >>> Choose flexible plans and management services without long-term >>> contracts >>> Personal 24x7 support from experience hosting pros just a phone call >>> away. >>> http://p.sf.net/sfu/theplanet-com >>> _______________________________________________ >>> basedb-devel mailing list >>> bas...@li... >>> https://lists.sourceforge.net/lists/listinfo/basedb-devel >> >> ------------------------------------------------------------------------------ >> >> The Planet: dedicated and managed hosting, cloud storage, colocation >> Stay online with enterprise data centers and the best network in the >> business >> Choose flexible plans and management services without long-term contracts >> Personal 24x7 support from experience hosting pros just a phone call >> away. >> http://p.sf.net/sfu/theplanet-com >> _______________________________________________ >> basedb-devel mailing list >> bas...@li... >> https://lists.sourceforge.net/lists/listinfo/basedb-devel > > > > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > > > > _______________________________________________ > basedb-devel mailing list > bas...@li... > https://lists.sourceforge.net/lists/listinfo/basedb-devel |
From: Gildas Le C. <lec...@sb...> - 2010-02-09 13:29:17
|
Index: Tab2MageExporter/ChangeLog.txt =================================================================== --- Tab2MageExporter/ChangeLog.txt (revision 1186) +++ Tab2MageExporter/ChangeLog.txt (working copy) @@ -1,5 +1,13 @@ ,____This file will contain information about changes in subsequent releases. -Latest version 2.0 +version 1.0 - Pooling of biomaterials - Pooled sample, extract, and labeled extract are now supported in this release. - Redesigned code to improve reuse. + +version 1.01 : 08/02/2010 - lecorguille +- Fix a problem with pooling which was not supported ... for me +- Modification : Filenames are use instead of RawBioAssays' names for File[raw] column in the Hybridization section +- Add the possibility to have several Files[raw] per RawBioAssay (ex : one cy3 and one cy5) +- Add a scan column in the Hybridization section +- Add a BioSourceDescription column in the Hybridization section +- Fix a problem with protocols in the Hybridization section Index: Tab2MageExporter/lib/BASE2Core.jar =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: Tab2MageExporter/lib/BASE2WSClient.jar =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: Tab2MageExporter/lib/BASE2WSClient.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: Tab2MageExporter/lib/BASE2CorePlugins.jar =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/Tab2MageFileWriter.java =================================================================== --- Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/Tab2MageFileWriter.java (revision 1186) +++ Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/Tab2MageFileWriter.java (working copy) @@ -61,6 +61,15 @@ @author Dominic Oyeniran @email oye...@eb.../doy...@gm... @version 1.0 + + @author Gildas Le Corguillé + @email lec...@sb... + @version 1.01 + + ChangeLog : + 05/02/2010 - lecorguille : addition of a Scan column to the output file + 08/02/2010 - lecorguille : addition of a BioSourceDescription column to the output file + displaying of the protocol descriptions in one line */ public class Tab2MageFileWriter { @@ -83,8 +92,10 @@ //OutputStreamWriter is used so that characters written to it are encoded into bytes using a specified charset for all out= new BufferedWriter(new OutputStreamWriter(outputFile.getUploadStream(false),encoding)); statusOut= new BufferedWriter(new OutputStreamWriter(statusFile.getUploadStream(false),encoding)); + + statusOut.write(" Please check the messages below for the status of the export\n\n"); } - catch(UnsupportedEncodingException e) + catch (IOException e) { new NutribasePluginException(e.getMessage()); } @@ -138,8 +149,8 @@ { try { - statusOut.write(" Please check the messages below for the status of the export"); //not part of experiment and may be moved elsewhere. + out.write("# This file contains an experiment exported in tab2mage specification from BASE\n\n"); out.write("Experiment section \n"); out.write(Tab2MageConstants.domain.getName()+"\t"+Application.getHostName()+"\n"); @@ -150,7 +161,7 @@ String description = experiment.getDescription()!=null && experiment.getDescription().length()!=0 ? experiment.getDescription(): ValueFormatter.getEmptyStringIfNull(experiment.getAbstract()).toString(); out.write(Tab2MageConstants.description.getName()+"\t"+description +"\n"); out.write(Tab2MageConstants.release_date.getName()+"\t"+job.getValue("releaseDate").toString()+"\n"); - out.write(Tab2MageConstants.submission_date.getName()+"\t"+Values.formatDate(new Date())+"\n"); + out.write(Tab2MageConstants.submission_date.getName()+"\t"+ValueFormatter.DATE_FORMAT.format(new Date())+"\n"); out.write(Tab2MageConstants.submitter.getName()+"\t"+experiment.getOwner().getName()+"\n"); out.write(Tab2MageConstants.submitter_email.getName()+"\t"+ValueFormatter.getEmptyStringIfNull(experiment.getOwner().getEmail())+"\n"); out.write(Tab2MageConstants.organization.getName()+"\t"+ ValueFormatter.getEmptyStringIfNull(experiment.getOwner().getOrganisation()) +"\n"); @@ -170,6 +181,7 @@ response.setError(ex.getMessage(), Arrays.asList(ex)); } } + /** writes Tab2Mage protocol section @param protocols, list of protocols to write @@ -190,7 +202,7 @@ if (protocol!=null) { out.write("P-BASE-"+protocol.getId()+"\t"); - out.write(ValueFormatter.getEmptyStringIfNull(protocol.getDescription())+"\t"); + out.write(ValueFormatter.getStringWithoutLineBreaker(String.valueOf(ValueFormatter.getEmptyStringIfNull(protocol.getDescription())))+"\t"); out.write(ValueFormatter.getEmptyStringIfNull(protocol.getName())+"\t"); out.write(ValueFormatter.getEmptyStringIfNull(protocol.getProtocolType().getName())+"\t"); ItemQuery<AnnotationType> parameterQuery= protocol.getParameters(); @@ -247,11 +259,11 @@ } /** + * @deprecated Tab2Mage Hybridization Channel Line Section @param hybDataRow, the data rows to display @param response, the response object to return failures or exceptions */ - public static void writeTab2MageHybridizationRow( List<String> hybDataRows,Response response) { try @@ -276,6 +288,7 @@ response.setError(ex.getMessage(), Arrays.asList(ex)); } } + /** write the Tab2Mage File Hybridization Section @param hybList, the list of Hybridizations @@ -285,7 +298,6 @@ @param factorValueHeaders, experimental section header @param response, response object */ - private static void writeTab2MageHybridizationRows(List<Tab2MageHybridization> hybList,Set<String> bioXterHybSectionHeader, Set<String> protocolHeaders,Set<String>parameterHeaders,Set<String>factorValueHeaders, Response response) @@ -299,7 +311,6 @@ out.write(ValueFormatter.getEmptyStringIfNull(h.getLine().getFileRaw())+"\t") ; tempList.add(ValueFormatter.getEmptyStringIfNull(h.getLine().getFileRaw())+"\t"); - int channelNo = h.getChannelNumber(); Tab2MageHybridizationLine l= h.getLine(); @@ -343,6 +354,10 @@ Map<String, String> parameterMap = new HashMap<String, String>(); parameterMap.putAll(l.getParameter()); + //Scan + out.write(ValueFormatter.getEmptyStringIfNull(l.getScan())+"\t") ; + tempList.add(ValueFormatter.getEmptyStringIfNull(l.getScan())+"\t") ; + //Hybridization out.write(ValueFormatter.getEmptyStringIfNull(l.getHybridization())+"\t") ; tempList.add(ValueFormatter.getEmptyStringIfNull(l.getHybridization())+"\t") ; @@ -365,6 +380,7 @@ out.write(ValueFormatter.getEmptyStringIfNull(sl.getExtract())+"\t") ; out.write(ValueFormatter.getEmptyStringIfNull(sl.getSample())+"\t") ; out.write(ValueFormatter.getEmptyStringIfNull(sl.getBioSource())+"\t") ; + out.write(ValueFormatter.getEmptyStringIfNull(sl.getBioSourceDescription())+"\t") ; // biomaterial xteristics @@ -411,6 +427,8 @@ } } + /** NOT USE + * @deprecated */ public static void createZipFile(User user, File tab2mageFile, DbControl dc ) { Directory dir= user.getHomeDirectory(); @@ -425,13 +443,16 @@ } - /** + + /** closes the file writers */ public static void closeWriter() { try { + out.flush(); + statusOut.flush(); if (out!= null) out.close(); if (statusOut!=null) statusOut.close(); } @@ -463,7 +484,7 @@ { return statusOut; } - + static void setStatusOut(Writer statusOut) { Tab2MageFileWriter.statusOut = statusOut; Index: Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/ExportHelper.java =================================================================== --- Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/ExportHelper.java (revision 1186) +++ Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/ExportHelper.java (working copy) @@ -1,18 +1,24 @@ package uk.ac.ebi.nugo.plugins.ta2mageexport; +import java.util.Arrays; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; +import net.sf.basedb.core.Affymetrix; import net.sf.basedb.core.Annotatable; import net.sf.basedb.core.AnnotationType; +import net.sf.basedb.core.ArrayDesign; import net.sf.basedb.core.BaseException; import net.sf.basedb.core.BioSource; import net.sf.basedb.core.DbControl; import net.sf.basedb.core.Directory; import net.sf.basedb.core.Extract; +import net.sf.basedb.core.File; +import net.sf.basedb.core.FileSetMember; import net.sf.basedb.core.Hybridization; +import net.sf.basedb.core.ItemQuery; import net.sf.basedb.core.ItemResultList; import net.sf.basedb.core.LabeledExtract; import net.sf.basedb.core.MeasuredBioMaterial; @@ -22,6 +28,7 @@ import net.sf.basedb.core.Sample; import net.sf.basedb.core.SessionControl; import net.sf.basedb.core.User; +import net.sf.basedb.core.plugin.Response; import uk.ac.ebi.nugo.common.Tab2MageConstants; /** @@ -29,11 +36,28 @@ [TODO] This class may be merged to other utils in the main base 2 source code @author Dominic Oyeniran @version 1.0 + + + @author Gildas Le Corguillé + @email lec...@sb... + @version 1.01 + + ChangeLog : + 05/02/2010 - lecorguille : modifification of the getItems fonctions to allow pooling + 05/02/2010 - lecorguille : substitution of RawBioAssay names in the File[Raw] be the filenames + */ public class ExportHelper { - public static Set<Sample> getSamples(Annotatable item, DbControl dc) + + /** + * @deprecated by lecorguille + * @param item + * @param dc + * @return + */ + public static Set<Sample> getSamplesBk(Annotatable item, DbControl dc) { Set<Sample> itemList= new LinkedHashSet<Sample>(); Set<Annotatable> pooledObjects= item.getAnnotatableParents(); @@ -53,13 +77,14 @@ } /** + * @deprecated by lecorguille gets a sample from extract. returns the first item at random, if extract is pooled @param extract, extract item @param dc, the database control @return Sample */ - public static Sample getSample(Annotatable extract, DbControl dc) + public static Sample getSampleBk(Annotatable extract, DbControl dc) { Sample sample=null; Set<Annotatable> sampleOrPooledExtracts= extract.getAnnotatableParents(); //returns sample and pooled extract @@ -86,13 +111,14 @@ } /** + * @deprecated by lecorguille gets an extract from a labeled extract. returns the first item at random, if labeled extract is pooled @param labeledExtract, labeled extract item @param dc, the database control @return extract */ - public static Extract getExtract(Annotatable labeledExtract, DbControl dc) + public static Extract getExtractBk(Annotatable labeledExtract, DbControl dc) { Extract extract=null; Set<Annotatable> extractOrPooledLabeledExtracts= labeledExtract.getAnnotatableParents(); //returns sample and pooled extract @@ -117,29 +143,14 @@ } return extract; } - - - public static Set<Extract> getExtracts(Annotatable item, DbControl dc) - { - Set<Extract> itemList= new LinkedHashSet<Extract>(); - Set<Annotatable> pooledObjects= item.getAnnotatableParents(); - for (Annotatable pooled: pooledObjects) - { - if (pooled instanceof LabeledExtract) - { - Set<Annotatable> extracts= pooled.getAnnotatableParents(); - for (Annotatable extractItem: extracts) - { - Extract extract= Extract.getById(dc, extractItem.getId()); - itemList.add(extract); - } - } - } - return itemList; - } - - public static Set<BioSource> getBiosources(MeasuredBioMaterial item, DbControl dc) + /** + * @deprecated by lecorguille + * @param item + * @param dc + * @return + */ + public static Set<BioSource> getBiosourcesBk(MeasuredBioMaterial item, DbControl dc) { Set<BioSource> bioSourceList= new LinkedHashSet<BioSource>(); Set<Annotatable> pooledSamples= item.getAnnotatableParents(); @@ -158,16 +169,15 @@ return bioSourceList; } - /** + * @deprecated by lecorguille gets a biosource from sample. returns the first item at random, if sample is pooled @param sample, sample item @param dc. the database control @return BioSource */ - - public static BioSource getBioSource(Annotatable sample, DbControl dc) + public static BioSource getBioSourceBk(Annotatable sample, DbControl dc) { BioSource biosource=null; Set<Annotatable> biosourceOrPooledSample= sample.getAnnotatableParents(); //returns biosource and pooled samples @@ -195,6 +205,189 @@ } /** + * @author lecorguille + * Return a Extract from a non-pooling LabeledExtract. + * @param labeledExtract + * @param dc the database control + * @return Extract + */ + private static Extract getExtract(LabeledExtract labeledExtract, DbControl dc) { + Extract extract=null; + + Set<Annotatable> extractAnnots = labeledExtract.getAnnotatableParents(); + for (Annotatable extractAnnot : extractAnnots) { + extract = Extract.getById(dc, extractAnnot.getId()); + } + return extract; + } + + /** + * @author lecorguille + * Return a set of Extract from a LabeledExtract. + * this method can return several Extracts if there is a LabeledExtract pooling + * @param labeledExtract + * @param dc the database control + * @return Set<Extract> + */ + public static Set<Extract> getExtracts(LabeledExtract labeledExtract, DbControl dc) { + + Set<Extract> itemList= new LinkedHashSet<Extract>(); + + // not pooled + if (!labeledExtract.isPooled()) { + itemList.add(getExtract(labeledExtract, dc)); + } + // pooled + else { + Set<Annotatable> labeledExtractPoolAnnots = labeledExtract.getAnnotatableParents(); + for (Annotatable labeledExtractPoolAnnot : labeledExtractPoolAnnots) { + LabeledExtract labeledExtractPooled = LabeledExtract.getById(dc, labeledExtractPoolAnnot.getId()); + itemList.add(getExtract(labeledExtractPooled, dc)); + } + } + + return (itemList); + } + + /** + * @author lecorguille + * Return a Sample from a non-pooling Extract. + * @param extract + * @param dc the database control + * @return Sample + */ + private static Sample getSample(Extract extract, DbControl dc) { + Sample sample=null; + + Set<Annotatable> sampleAnnots = extract.getAnnotatableParents(); + for (Annotatable sampleAnnot : sampleAnnots) { + sample = Sample.getById(dc, sampleAnnot.getId()); + } + return sample; + } + + /** + * @author lecorguille + * Return a set of Sample from a Extract. + * this method can return several Samples if there is a Extract pooling + * @param extract + * @param dc the database control + * @return Set<Sample> + */ + public static Set<Sample> getSamples(Extract extract, DbControl dc) + { + Set<Sample> itemList= new LinkedHashSet<Sample>(); + + // not pooled + if (!extract.isPooled()) { + itemList.add(getSample(extract, dc)); + } + // pooled + else { + Set<Annotatable> extractPoolAnnots = extract.getAnnotatableParents(); + for (Annotatable extractPoolAnnot : extractPoolAnnots) { + Extract extractPooled = Extract.getById(dc, extractPoolAnnot.getId()); + itemList.add(getSample(extractPooled, dc)); + } + } + + return (itemList); + } + + /** + * @author lecorguille + * Return a Biosource from a non-pooling Sample. + * @param sample + * @param dc the database control + * @return BioSource + */ + private static BioSource getBioSource(Sample sample, DbControl dc) { + BioSource bioSource=null; + + Set<Annotatable> bioSourceAnnots = sample.getAnnotatableParents(); + for (Annotatable bioSourceAnnot : bioSourceAnnots) { + bioSource = BioSource.getById(dc, bioSourceAnnot.getId()); + } + return bioSource; + } + + /** + * @author lecorguille + * Return a set of Biosource from a Sample. + * this method can return several Biosources if there is a Sample pooling + * @param sample + * @param dc the database control + * @return Set<BioSource> + */ + public static Set<BioSource> getBioSources(Sample sample, DbControl dc) + { + Set<BioSource> itemList= new LinkedHashSet<BioSource>(); + + // not pooled + if (!sample.isPooled()) { + itemList.add(getBioSource(sample, dc)); + } + // pooled + else { + Set<Annotatable> samplePoolAnnots = sample.getAnnotatableParents(); + for (Annotatable samplePoolAnnot : samplePoolAnnots) { + Sample samplePooled = Sample.getById(dc, samplePoolAnnot.getId()); + itemList.add(getBioSource(samplePooled, dc)); + } + } + + return (itemList); + } + + /** + * @author lecorguille + * Return a set of Tab2MageHybridizationLine from a RawBioAssay. + * This method can return several lines if there is several Files for the RawBioAssay (ex: Nimblegen 2 channels <=> 2 files per scan) + * @param rba + * @param dc the database control + * @param response + * @return Set<Tab2MageHybridizationLine> + * @TODO use non-deprecated methods for Affymetrix + * @TODO it's not very clean but it's work without huge modifications + */ + public static Set<Tab2MageHybridizationLine> getRawBioAssayFiles(RawBioAssay rba, DbControl dc, Response response) { + Set<Tab2MageHybridizationLine> itemList= new LinkedHashSet<Tab2MageHybridizationLine>(); + + try + { + if (rba.getArrayDesign().isAffyChip()) + { + Tab2MageHybridizationLine hybRow = new Tab2MageHybridizationLine(); + + File celFile=Affymetrix.getCelFile(rba); + File cdfFile= Affymetrix.getCdfFile(rba.getArrayDesign()); + + hybRow.set("File", Tab2MageConstants.raw_file.getName(), celFile.getName()); + hybRow.set("File",Tab2MageConstants.cdf_file.getName(), cdfFile.getName()); + + itemList.add(hybRow); + } + else + { + ItemQuery<FileSetMember> fileSetMemberQuery =(ItemQuery<FileSetMember>) rba.getFileSet().getMembers(); // get all the labeled extract + ItemResultList<FileSetMember> fileSetMembers= fileSetMemberQuery.list(dc); + + for (FileSetMember fileSetMember :fileSetMembers) { + Tab2MageHybridizationLine hybRow = new Tab2MageHybridizationLine(); + hybRow.set("File", Tab2MageConstants.raw_file.getName(), fileSetMember.getFile().getName()); + itemList.add(hybRow); + } + } + } + catch(Throwable tr) + { + response.setError(tr.getMessage(), Arrays.asList(tr)); + } + + return itemList; + } + + /** Gets the base format id for the protocols in the Tab2Mage Protocol Section, if protocol is null an empty string is returned this is required to have consistent tab delimited format @@ -226,7 +419,6 @@ return at.getDefaultValue()!=null? at.getDefaultValue():""; } - /** creates the header from Hybridization Section header data structure @@ -234,7 +426,6 @@ @return the set of hybridization section headers */ - @SuppressWarnings("unchecked") public static Set<String> createHybridizationSectionHeader( DbControl dc, List<Tab2MageHybridization> hybList, Set<String> bioXterHybSectionHeader, Set<String> protocolHybSectionHeader, Set<String> parameterHybSectionHeader, Set<String> factorValuesHybSectionHeader) @@ -265,6 +456,9 @@ { hybHeader.add("FactorValue["+factorValueHeader+"]"); } + + if (l.getScan()!=null && l.getScan().length()!=0) + hybHeader.add(Tab2MageConstants.scan.getName()); if (l.getHybridization()!=null && l.getHybridization().length()!=0) hybHeader.add(Tab2MageConstants.hybridization.getName()); @@ -310,7 +504,6 @@ return hybHeader; } - /** create the set of protocol objects for the tab2mage protocol section each protocol object maps to a line of the protocol section of the tab2mage file @@ -344,20 +537,23 @@ protocols.add(lbExtractProtocol); // add extract protocol - Extract extract= getExtract(labeledExtract, dc); - if (extract!=null) - { - Protocol extractProtocol =extract.getCreationEvent().getProtocol(); - protocols.add(extractProtocol); + Set<Extract> extracts = ExportHelper.getExtracts(labeledExtract, dc); + for (Extract extract : extracts) { + if (extract!=null) + { + Protocol extractProtocol =extract.getCreationEvent().getProtocol(); + protocols.add(extractProtocol); + } + // add sample protocol + Set<Sample> samples = ExportHelper.getSamples(extract, dc); + for (Sample sample : samples) { + if (sample != null) + { + Protocol sampleProtocol=sample.getCreationEvent().getProtocol(); + protocols.add(sampleProtocol); + } + } } - // add sample protocol - - Sample sample = getSample(extract, dc); - if (sample != null) - { - Protocol sampleProtocol=sample.getCreationEvent().getProtocol(); - protocols.add(sampleProtocol); - } } } return protocols; @@ -389,6 +585,7 @@ } return p; } + /** utility method for the tab2mage exporter it ges the only the Keys mapped to not null and not empty ("") values in a map. Index: Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/Tab2MageHybridization.java =================================================================== --- Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/Tab2MageHybridization.java (revision 1186) +++ Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/Tab2MageHybridization.java (working copy) @@ -37,6 +37,15 @@ @author Dominic Oyeniran @email oye...@eb.../doy...@gm... + @version 1.0 + + + @author Gildas Le Corguillé + @email lec...@sb... + @version 1.01 + + ChangeLog : + 05/02/2010 - lecorguille : addition of SCAN */ public class Tab2MageHybridization { @@ -44,11 +53,13 @@ protected static Logger log = Logger.getLogger(Tab2MageHybridization.class); public static final String BIOSOURCE = "BioSource"; + public static final String BIOSOURCEDESCRIPTION = "BioSourceDescription"; public static final String SAMPLE = "Sample"; public static final String EXTRACT = "Extract"; public static final String LABELEDEXTRACT = "LabeledExtract"; public static final String DYE = "Dye"; public static final String HYBRIDIZATION = "Hybridization"; + public static final String SCAN = "Scan"; public static final String BIOMATERIALCHARACTERISTICS = "BioMaterialCharacteristics"; public static final String PROTOCOL = "Protocol"; public static final String PARAMETER = "Parameter"; @@ -123,6 +134,7 @@ /** + * @deprecated by lecorguille Get the size of the <code>Tab2MageHybridization</code> object. The size is the number of <code>Tab2MageHybridizationLine</code> objects stored. @@ -141,6 +153,7 @@ } /** + * @deprecated by lecorguille Get the set of all <code>Tab2MageHybridizationLine</code> objects. @return A <code>HashMap</code> with a String as key and a <code>TAB2MAGEHybridizationLine</code> as value */ @@ -150,6 +163,7 @@ } /** + * @deprecated by lecorguille Get the name of the raw data file. @return The name of the raw data file */ @@ -177,6 +191,7 @@ /** + * @deprecated by lecorguille Get the information about the Array[...] entries in the Tab2Mage files. @return a <code>HashMap</code> with the information from the Array entries. @@ -203,6 +218,7 @@ /** + * @deprecated by lecorguille Has the Hyb object a pooled property */ public boolean isPooled() @@ -210,6 +226,7 @@ return pooled; } /** + * @deprecated by lecorguille check if the Hyb line object a re pooled abnd set the global variable pooled * @param pooled */ @@ -219,6 +236,7 @@ } /** + * @deprecated by lecorguille get the name of the Hybridization from the HybLine objects @return @throws NutribasePluginException Index: Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/Tab2MageSubHybLine.java =================================================================== --- Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/Tab2MageSubHybLine.java (revision 1186) +++ Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/Tab2MageSubHybLine.java (working copy) @@ -30,11 +30,20 @@ @author Dominic Oyeniran @email oye...@eb.../doy...@gm... @version 1.0 + + + @author Gildas Le Corguillé + @email lec...@sb... + @version 1.01 + + ChangeLog : + 05/02/2010 - lecorguille : addition of BioSourceDescription */ public class Tab2MageSubHybLine { protected String bioSource; + protected String bioSourceDescription; protected String sample; protected String extract; protected String labeledExtract; @@ -74,6 +83,17 @@ this.bioSource = bioSource; } + + public String getBioSourceDescription() + { + return bioSourceDescription; + } + + public void setBioSourceDescription(String bioSourceDescription) + { + this.bioSourceDescription = bioSourceDescription; + } + /* Sample */ @@ -182,8 +202,15 @@ setBioSource((String)value); return; } + + //set BioSource + if (key == Tab2MageHybridization.BIOSOURCEDESCRIPTION) + { + setBioSourceDescription((String)value); + return; + } - // set sample + // set Sample if (key == Tab2MageHybridization.SAMPLE) { setSample((String)value); Index: Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/Tab2MageValidator.java =================================================================== --- Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/Tab2MageValidator.java (revision 1186) +++ Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/Tab2MageValidator.java (working copy) @@ -22,6 +22,7 @@ */ package uk.ac.ebi.nugo.plugins.ta2mageexport; +import java.io.IOException; import java.util.Arrays; import java.util.LinkedHashSet; import java.util.LinkedList; @@ -56,6 +57,15 @@ @author Dominic Oyeniran @email oye...@eb.../doy...@gm... @version 1.0 + + + @author Gildas Le Corguillé + @email lec...@sb... + @version 1.01 + + ChangeLog : + 05/02/2010 - lecorguille : addition a pooling management for the setting of protocols + 08/02/2010 - lecorguille : fix a problem with protocols */ public class Tab2MageValidator { @@ -80,10 +90,13 @@ // counts the number of extraction protocol used in the experiment private static int samplingProtocolCount=0; + /** @deprecated by lecorguille */ private Set<String> parameterHeaders= new LinkedHashSet<String>(); + /** @deprecated by lecorguille */ private Set<String> bioMaterialXteristicsHeaders= new LinkedHashSet<String>(); + /** @deprecated by lecorguille */ private static Set<String> factorValuesHybSectionHeader= new LinkedHashSet<String>(); private static Set<String> protocolHybSectionHeader= new LinkedHashSet<String>(); @@ -95,7 +108,7 @@ */ private int channelNumber = 0; // the experiment - private Experiment experiment; + private ItemResultList<RawBioAssay> rawBioAssays; private SessionControl sc; @@ -107,9 +120,9 @@ @param sc @param response */ - public Tab2MageValidator(Experiment experiment, SessionControl sc, Response response) + public Tab2MageValidator(ItemResultList<RawBioAssay> rawBioAssays, SessionControl sc, Response response) { - this.experiment=experiment; + this.rawBioAssays=rawBioAssays; this.sc = sc; this.response= response; countProtocols(); @@ -126,8 +139,7 @@ try { dc = sc.newDbControl(); - ItemResultList<RawBioAssay> rbas= experiment.getRawBioAssays().list(dc); - for (RawBioAssay rba : rbas) + for (RawBioAssay rba : rawBioAssays) { if (rba.getProtocol()!=null) feProtocolCount++ ; @@ -147,16 +159,17 @@ if (labeledExtract.getProtocol()!=null) labelingProtocolCount++; - //Extract extract = labeledExtract.getExtract(); // RefExtract - Extract extract = ExportHelper.getExtract(labeledExtract, dc); - if (extract.getProtocol()!=null) - extractProtocolCount++; - - //sample - Sample sample = ExportHelper.getSample(extract, dc); - if (sample.getProtocol()!=null) - samplingProtocolCount++; - + Set<Extract> extracts = ExportHelper.getExtracts(labeledExtract, dc); + for (Extract extract : extracts) { + if (extract.getProtocol()!=null) + extractProtocolCount++; + + Set<Sample> samples = ExportHelper.getSamples(extract, dc); + for (Sample sample : samples) { + if (sample.getProtocol()!=null) + samplingProtocolCount++; + } + } } } } @@ -176,56 +189,59 @@ /** create both the parameter [AT] header and BioMaterialCharactertistic[AT] headers found in the whole experiment */ - @SuppressWarnings({"deprecation","unchecked"}) private void createHeaders() { DbControl dc =null; try { dc = sc.newDbControl(); - ItemResultList<RawBioAssay> rbas= experiment.getRawBioAssays().list(dc); - for (RawBioAssay rba : rbas) + for (RawBioAssay rba : rawBioAssays) { if (rba.getProtocol()!=null) { - createParameterSectionHeaders(rba, dc ); + //createParameterSectionHeaders(rba, dc); createProtocolHybSectionHeader(Tab2MageValidator.getFeProtocolCount(),Tab2MageConstants.protocol_featureextraction.getName()); } if (rba.getScan().getProtocol()!=null) { - createParameterSectionHeaders(rba.getScan(), dc ); + //createParameterSectionHeaders(rba.getScan(), dc ); createProtocolHybSectionHeader(Tab2MageValidator.getScanningProtocolCount(), Tab2MageConstants.protocol_scanning.getName()); } if (rba.getScan().getHybridization().getProtocol()!=null) { - createParameterSectionHeaders(rba.getScan().getHybridization(), dc ); + //createParameterSectionHeaders(rba.getScan().getHybridization(), dc ); createProtocolHybSectionHeader(Tab2MageValidator.getHybridizationProtocolCount(), Tab2MageConstants.protocol_hyb.getName()); } - ItemResultList<LabeledExtract>labeledExtracts = (ItemResultList<LabeledExtract>) + ItemResultList<LabeledExtract> labeledExtracts = (ItemResultList<LabeledExtract>) rba.getScan().getHybridization().getCreationEvent().getSources().list(dc); for (LabeledExtract labeledExtract :labeledExtracts) { if (labeledExtract.getProtocol()!=null) { - createParameterSectionHeaders(labeledExtract, dc ); + //createParameterSectionHeaders(labeledExtract, dc ); createProtocolHybSectionHeader(Tab2MageValidator.getLabelingProtocolCount(), Tab2MageConstants.protocol_labeling.getName()); } - //Extract extract= labeledExtract.getExtract(); - Extract extract = ExportHelper.getExtract(labeledExtract, dc); - if (extract.getProtocol()!=null) - { - createParameterSectionHeaders(labeledExtract.getExtract(), dc ); - createProtocolHybSectionHeader(Tab2MageValidator.getExtractProtocolCount(), Tab2MageConstants.protocol_extraction.getName()); + Set<Extract> extracts = ExportHelper.getExtracts(labeledExtract, dc); + for (Extract extract : extracts) { + if (extract.getProtocol()!=null) + { + //createParameterSectionHeaders(labeledExtract.getExtract(), dc ); + createProtocolHybSectionHeader(Tab2MageValidator.getExtractProtocolCount(), Tab2MageConstants.protocol_extraction.getName()); + } + Set<Sample> samples = ExportHelper.getSamples(extract, dc); + for (Sample sample : samples) { + if (sample.getProtocol()!=null) + { + //createParameterSectionHeaders(sample, dc ); + createProtocolHybSectionHeader(Tab2MageValidator.getSamplingProtocolCount(), Tab2MageConstants.protocol_treatment.getName()); + } + Set<BioSource> bioSources = ExportHelper.getBioSources(sample, dc); + for (BioSource bioSource : bioSources) { + if (bioSource!=null) + createBioMatXteristicsSectionHeader(bioSource,dc); + } + } } - Sample sample = ExportHelper.getSample(extract, dc); - if (sample.getProtocol()!=null) - { - createParameterSectionHeaders(sample, dc ); - createProtocolHybSectionHeader(Tab2MageValidator.getSamplingProtocolCount(), Tab2MageConstants.protocol_treatment.getName()); - } - BioSource bioSource= ExportHelper.getBioSource(sample, dc); - if (bioSource!=null) - createBioMatXteristicsSectionHeader(bioSource,dc); } } } @@ -240,14 +256,13 @@ if (dc!=null) dc.close(); } - } /** + * @deprecated by lecorguille Gets the used annotation types (parameters) for an annotatable item and add it to a set of PARAMETER[AT] headers @param annotatable, an item that implements annotatable @param dc, the database control object */ - private void createParameterSectionHeaders(Annotatable anotatable, DbControl dc ) { ItemResultList<Annotation> annotations = anotatable.getAnnotationSet().getAnnotations().list(dc); @@ -258,7 +273,7 @@ } } - /** + /** @deprecated by lecorguille Gets the annotation types used as biomaterial characteristics for an annotatable item @param annotatable, an item that implements annotatable @param dc, the database control object @@ -297,6 +312,7 @@ } /** + * @deprecated initialises the maps required to manage tab2mage data @param map, the map to be intitialised @param isForParameter, TRUE if map is for parameters and FALSE otherwise @@ -326,6 +342,7 @@ } /** + * @deprecated get all the experimental factors for an experiments @param DcControl dc, the database control @param Experiment experiment, the experiment @@ -354,6 +371,7 @@ } /** + * @deprecated get all the experimental factors headers for an experiments @param DcControl dc, the database control @param Experiment experiment, the experiment @@ -414,18 +432,24 @@ return feProtocolCount; } - // get the parameter headers - public Set<String> getParameterHeaders() + /** @deprecated by lecorguille + * get the parameter headers + * */ + public Set<String> getParameterHead() { return parameterHeaders; } - // get the bio material characteristics headers + /** @deprecated by lecorguille + * get the bio material characteristics headers + * */ public Set<String> getBioMaterialXteristicsHeaders() { return bioMaterialXteristicsHeaders; } - - // get the factor values header used in the experiment + + /** @deprecated by lecorguille + * get the factor values header used in the experiment + * */ public static Set<String> getFactorValuesHybSectionHeader() { return factorValuesHybSectionHeader; Index: Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/Tab2MageHybridizationLine.java =================================================================== --- Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/Tab2MageHybridizationLine.java (revision 1186) +++ Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/ta2mageexport/Tab2MageHybridizationLine.java (working copy) @@ -36,6 +36,15 @@ This class models the a Tab2Mage Hybridization Row in a BASE experiment for a Tab2Mage Export File @author Dominic Oyeniran @email oye...@eb.../doy...@gm... + + + @author Gildas Le Corguillé + @email lec...@sb... + @version 1.01 + + ChangeLog : + 05/02/2010 - lecorguille : addition of scan methods + 05/02/2010 - lecorguille : deletion of number of line control which was limited by the comparison the channel number */ public class Tab2MageHybridizationLine { @@ -47,6 +56,7 @@ protected String labeledExtract; protected String dye; protected String hybridization; + protected String scan; protected Map<String, String> file = new HashMap<String, String>(); protected Map<String, String> protocol = new HashMap<String, String>(); protected Map<String, String> parameter = new HashMap<String, String>(); @@ -88,6 +98,19 @@ { this.hybridization = hybridization; } + + /* + Scan + */ + public String getScan() + { + return scan; + } + + public void setScan(String scan) + { + this.scan = scan; + } /* Data Files @@ -198,6 +221,13 @@ setHybridization((String)value); return; } + + // Scan + if (key == Tab2MageHybridization.SCAN) + { + setScan((String)value); + return; + } // Parameters if (key == Tab2MageHybridization.PARAMETER) @@ -263,16 +293,16 @@ } else { - if (lines.size()!= channelNumber) // check the the line numbers matches the channel number + /*if (lines.size()!= channelNumber) // check the the line numbers matches the channel number { log.error("The Hybridization " + name + " doesn't have the right number of lines!"); return false; } else - { + {*/ subLineSet.addAll(lines); return true; - } + //} } } Index: Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/Tab2MageExporter.java =================================================================== --- Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/Tab2MageExporter.java (revision 1186) +++ Tab2MageExporter/src/uk/ac/ebi/nugo/plugins/Tab2MageExporter.java (working copy) @@ -23,7 +23,6 @@ package uk.ac.ebi.nugo.plugins; -import java.io.Writer; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; @@ -34,7 +33,6 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import net.sf.basedb.core.Affymetrix; import net.sf.basedb.core.Annotatable; import net.sf.basedb.core.Annotation; import net.sf.basedb.core.AnnotationSet; @@ -79,6 +77,7 @@ import net.sf.basedb.util.Values; import uk.ac.ebi.nugo.common.Helper; import uk.ac.ebi.nugo.common.Tab2MageConstants; +import uk.ac.ebi.nugo.common.ValueFormatter; import uk.ac.ebi.nugo.plugins.ta2mageexport.ExportHelper; import uk.ac.ebi.nugo.plugins.ta2mageexport.Tab2MageFileWriter; import uk.ac.ebi.nugo.plugins.ta2mageexport.Tab2MageHybridization; @@ -91,6 +90,19 @@ @author Dominic Oyeniran @email oye...@eb... /doy...@gm... @version 1.0 + + + @author Gildas Le Corguillé + @email lec...@sb... + @version 1.01 + + ChangeLog : + 05/02/2010 - lecorguille : modification of a lot of things about pooling depending of the other class + now, lines are repeated if there are several files per RawBioAssay or pooling of Sample, Extract or LabeledExtract + Tab2Mage format doesn't support pooling like Base2 does : + - Base2 pool 2 Samples in a Ref Sample + - Tab2Mage format pool 2 BioSources in the Ref Sample + 08/02/2010 - lecorguille : addition of BioSourceDescription */ public class Tab2MageExporter extends AbstractPlugin @@ -276,247 +288,190 @@ Set<Protocol> protocols = new LinkedHashSet<Protocol>(); Set<String> hybSectionHeader= new LinkedHashSet<String>(); Set<String> protocolHybSectionHeader= new LinkedHashSet<String>(); - + + + + boolean overwrite = false; try { dc=sc.newDbControl(); User user = User.getById(dc, sc.getLoggedInUserId()); + + + /* -- output files -- */ if ((Boolean)job.getValue("overwrite") != null) overwrite = (Boolean)job.getValue("overwrite"); String p = (String)job.getValue("exportPath"); File file=Helper.processFilePath(user,overwrite, dc,p); String statusp=(String)job.getValue("statusPath"); File statusFile=Helper.processFilePath(user,overwrite, dc,statusp); + Tab2MageFileWriter.createFileWriters(file, statusFile); + + + /* --- Experiment --- */ Experiment experiment= (Experiment)job.getValue("experiment"); - experiment= Experiment.getById(dc,experiment.getId()); - - // check if the logged in user owned the experiment, if not the export exit with a message. + experiment= Experiment.getById(dc,experiment.getId()); - if (!(experiment.getOwner().equals(user))) - { + // check if the logged in user owned the experiment, if not the export exit with a message. + if (!(experiment.getOwner().equals(user))) { response.setError("[EXPORT FAILED: User - "+user.getName()+ " do not own this experiment or have permission to export it].", Arrays.asList(new Throwable())); return; } - if (experiment.getExperimentalFactors().list(dc).size()==0) - { + if (experiment.getExperimentalFactors().list(dc).size()==0) { response.setError("[EXPORT FAILED: Experimental factors have not been specified for this experiment].", Arrays.asList(new Throwable())); return; } - - // check that raw bio assays have been added to experiment, otherwise fails - + + + /* --- RawBioAssay --- */ ItemQuery<RawBioAssay> rawBioAssaysQuery = experiment.getRawBioAssays(); rawBioAssaysQuery.order(Orders.asc(Hql.property("name"))); ItemResultList<RawBioAssay> rawBioAssays= rawBioAssaysQuery.list(dc); - if (rawBioAssays==null || rawBioAssays.size()==0) - { + + // check that raw bio assays have been added to experiment, otherwise fails + if (rawBioAssays==null || rawBioAssays.size()==0) { response.setError("[EXPORT FAILED: Experiment - "+ experiment+ " do not have a rawbiosay specified].",Arrays.asList(new Throwable())); return; } - // create all the required writers for the status file and the export file - Tab2MageFileWriter.createFileWriters(file, statusFile); + // initialise, count resources used, create concurrentmap for all parameter and biomaterial headers + Tab2MageValidator validator = new Tab2MageValidator (rawBioAssays, sc, response); - //initialise, count resources used, create concurrentmap for all parameter and biomaterial headers - Tab2MageValidator validator = new Tab2MageValidator (experiment, sc, response); - //Tab2MageHybridization hybridization= new Tab2MageHybridization (); - for (RawBioAssay rba : rawBioAssays) { - // create the Tab2MageHybridization object - Tab2MageHybridization hybridization= new Tab2MageHybridization (); - // create the Tab2MageHybridizationLine object - Tab2MageHybridizationLine hybRow = new Tab2MageHybridizationLine(); - - // set the number of channels for the Hybridization - hybridization.setChannelNumber(validator.getChannelNumber()); // mainly useful during the writing stage - - /* - Experimental Factor Section - */ - AnnotationSet annotationSet =rba.isAnnotated() ? rba.getAnnotationSet() : null; - ItemQuery<AnnotationType> experimentalFactorsQuery= experiment.getExperimentalFactors(); - experimentalFactorsQuery.include(Include.MINE, Include.SHARED, Include.OTHERS, Include.IN_PROJECT, Include.NOT_REMOVED); - ItemResultList<AnnotationType> experimentalFactors = experimentalFactorsQuery.list(dc); - for (AnnotationType exprFactor :experimentalFactors) - { - if (!exprFactor.isRemoved()) + Set<Tab2MageHybridizationLine> hybRows = ExportHelper.getRawBioAssayFiles(rba, dc, response); + for (Tab2MageHybridizationLine hybRow : hybRows) { + + + /* --- Array design ---*/ + ArrayDesign arrayDesign = rba.getArrayDesign(); + hybRow.set("Array",Tab2MageConstants.array_accession.getName(),arrayDesign.getName()); + setProtocolAndParameterAtrributes(hybRow,rba,Tab2MageValidator.getFeProtocolCount(), Tab2MageConstants.protocol_featureextraction.getName(), response, dc); + + + /* --- Scan --- */ + Scan scan= rba.getScan(); + hybRow.set(Tab2MageConstants.scan.getName(), null,scan.getName()); + setProtocolAndParameterAtrributes(hybRow,scan,Tab2MageValidator.getScanningProtocolCount(), Tab2MageConstants.protocol_scanning.getName(),response, dc); + + + /* --- Experimental factor section --- */ + AnnotationSet annotationSet = rba.isAnnotated() ? rba.getAnnotationSet() : null; + ItemQuery<AnnotationType> experimentalFactorsQuery = experiment.getExperimentalFactors(); + experimentalFactorsQuery.include(Include.MINE, Include.SHARED, Include.OTHERS, Include.IN_PROJECT, Include.NOT_REMOVED); + ItemResultList<AnnotationType> experimentalFactors = experimentalFactorsQuery.list(dc); + for (AnnotationType exprFactor :experimentalFactors) { - if (annotationSet!=null) - { - Annotation an= annotationSet.findAnnotation(exprFactor); - /* - Please use the line below instead of the one above for base 2.5 API to get inherited annotation types. - Annotation an = annotationSet.findAnnotations(exprFactor); - List<Annotation> findAnnotations(dc, exprFactor, true); - Loop through the list.....needs more check - */ - - if (an!=null) //exprFacor has annotations - { - List<?> values= an.getValues(); - hybRow.set("FactorValue", exprFactor.getName(), values==null || values.size()==0 ? "" : Values.getString(values, ", ", true)); + if (!exprFactor.isRemoved()) { + if (annotationSet!=null) { + Annotation an= annotationSet.findAnnotation(exprFactor); + /* + Please use the line below instead of the one above for base 2.5 API to get inherited annotation types. + Annotation an = annotationSet.findAnnotations(exprFactor); + List<Annotation> findAnnotations(dc, exprFactor, true); + Loop through the list.....needs more check + */ + + if (an!=null) { //exprFacor has annotations + List<?> values= an.getValues(); + hybRow.set("FactorValue", exprFactor.getName(), values==null || values.size()==0 ? "" : Values.getString(values, ", ", true)); + } + else { // exprFactor has no annotations + hybRow.set("FactorValue", exprFactor.getName(), "" ); + } } - else // exprFactor has no annotations - { + else { //The raw bio assay is not annotated hybRow.set("FactorValue", exprFactor.getName(), "" ); } } - else //The raw bio assay is not annotated - { - hybRow.set("FactorValue", exprFactor.getName(), "" ); - } } - } - - //Array Design - ArrayDesign arrayDesign = null; - try - { - arrayDesign= rba.getArrayDesign(); - } - catch(Throwable tr) - { - response.setError("[EXPORT FAILED: All Array Design(s) must be provided in BASE to continue].",Arrays.asList(tr)); - } - // Populate the Array file map in HybLine - setArraysAttributes(hybRow, arrayDesign ); - - // Populate the Data file map in HybLine - setFileAttributes(hybRow, arrayDesign, rba, response); - - //Raw BioAssay protocol and parameter - setProtocolAndParameterAtrributes(hybRow,rba,Tab2MageValidator.getFeProtocolCount(), - Tab2MageConstants.protocol_featureextraction.getName(), response, dc); - - //Scanning Protocol and Parameters - Scan scan= rba.getScan(); - setProtocolAndParameterAtrributes(hybRow,scan,Tab2MageValidator.getScanningProtocolCount(), - Tab2MageConstants.protocol_scanning.getName(),response, dc); - - /* - Array Slide - */ - Hybridization hyb= scan.getHybridization(); - if (hyb.getArraySlide()==null) - { - response.setError("[Export Failed] please add an array slide for Hybridization:"+hyb.getName(), Arrays.asList(new Throwable())); - return; - } - else - { - hybRow.set("Array","serial", hyb.getArraySlide().getName()); - } - /* - Hybridization - */ - hybRow.set(Tab2MageConstants.hybridization.getName(), null,hyb.getName()); - BioMaterialEvent bioMaterialEvent= hyb.getCreationEvent(); // an event that created the hyridization - - // Hybridization protocol and parameter - setProtocolAndParameterAtrributes(hybRow,hyb,Tab2MageValidator.getHybridizationProtocolCount(), - Tab2MageConstants.protocol_hyb.getName(), response, dc); - - ItemQuery<LabeledExtract> labeledExtractQuery =(ItemQuery<LabeledExtract>) bioMaterialEvent.getSources(); // get all the labeled extract - ItemResultList<LabeledExtract> labeledExtracts= labeledExtractQuery .list(dc); - int size = labeledExtracts.size(); - - // create the Tab2MageSubHybLine object List - List<Tab2MageSubHybLine> subLines = new ArrayList<Tab2MageSubHybLine>(); - - int count=1; // initialise the count variable to 1 - // Loop through all the labeled extracts - for (LabeledExtract labeledExtract :labeledExtracts) // can have more than one labeled extract (e.g. 2 color experiments) - { - //create the new SubHyb Line - Tab2MageSubHybLine subLine = new Tab2MageSubHybLine(); - /* - labeled extract - */ - Protocol lbExtractProtocol= labeledExtract.getCreationEvent().getProtocol(); - subLine.set(Tab2MageConstants.labeledextract.getName(), null, labeledExtract.getName()); - - // labelling protocol and parameter - setProtocolAndParameterAtrributes(dc, subLine,labeledExtract,Tab2MageValidator.getLabelingProtocolCount(), - Tab2MageConstants.protocol_labeling.getName(),lbExtractProtocol, response); - /* - Label - */ - String labelName= labeledExtract.getLabel().getName(); // the name of the label - subLine.set(Tab2MageConstants.dye.getName(), null,labelName); - - /* - Extract - */ - - Extract extract= ExportHelper.getExtract(labeledExtract, dc); - if (extract!=null) - { - Protocol extractProtocol =extract.getCreationEvent().getProtocol(); //extract protocol - subLine.set(Tab2MageConstants.extract.getName(), null, extract.getName()); - // extraction protocol and parameter - setProtocolAndParameterAtrributes(dc, subLine,extract,Tab2MageValidator.getExtractProtocolCount(), - Tab2MageConstants.protocol_extraction.getName(), extractProtocol, response); - } + /* --- Hybridization --- */ + Hybridization hyb = scan.getHybridization(); + hybRow.set(Tab2MageConstants.hybridization.getName(), null,hyb.getName()); + setProtocolAndParameterAtrributes(hybRow,hyb,Tab2MageValidator.getHybridizationProtocolCount(), Tab2MageConstants.protocol_hyb.getName(), response, dc); - /* - Sample - */ + /* --- Array slide --- */ + hybRow.set("Array","serial", hyb.getArraySlide().getName()); - Sample sample= ExportHelper.getSample(extract, dc); - if (sample != null) - { - Protocol sampleProtocol=sample.getCreationEvent().getProtocol(); //sampling protocol - subLine.set(Tab2MageConstants.sample.getName(), null, sample.getName()); - - // sampling protocol and parameter - setProtocolAndParameterAtrributes(dc, subLine,sample,Tab2MageValidator.getSamplingProtocolCount(), - Tab2MageConstants.protocol_treatment.getName(),sampleProtocol, response ); - } + // create the Tab2MageSubHybLine object List + List<Tab2MageSubHybLine> subLines = new ArrayList<Tab2MageSubHybLine>(); - /* - Biosource - */ - - BioSource bioSource=ExportHelper.getBioSource(sample, dc); - if (bioSource != null) - { - subLine.set(Tab2MageConstants.biosource.getName(), null, bioSource.getName()); + /* --- labeled extract --- */ + BioMaterialEvent bioMaterialEvent= hyb.getCreationEvent(); // an event that created the hyridization + ItemQuery<LabeledExtract> labeledExtractQuery =(ItemQuery<LabeledExtract>) bioMaterialEvent.getSources(); // get all the labeled extract + ItemResultList<LabeledExtract> labeledExtracts= labeledExtractQuery.list(dc); + int size = labeledExtracts.size(); + for (LabeledExtract labeledExtract :labeledExtracts) { // can have more than one labeled extract (e.g. 2 color experiments) + + /* --- Label --- */ + String labelName = labeledExtract.getLabel().getName(); // the name of the label + - //section for biomaterial xterixtics - ItemQuery<Annotation> query = bioSource.getAnnotationSet().getAnnotations(); - query.include(Include.MINE, Include.NOT_REMOVED, Include.IN_PROJECT,Include.SHARED); - List<Annotation> annotations = query.list(dc); - for (Annotation annotation: annotations) - { - AnnotationType at=annotation.getAnnotationType(); - if(!at.isRemoved()) - { - List<?> values= annotation==null? null:annotation.getValues(); - subLine.set(Tab2MageConstants.bio_mat_charact.getName(), annotation.getAnnotationType().getName(), - values==null || values.size()==0 ? ExportHelper.getDefaultValue(at) : Values.getString(values, ", ", true)); + /* --- Extracts --- */ + Set<Extract> extracts = ExportHelper.getExtracts(labeledExtract, dc); + for (Extract extract : extracts) { + + /* --- Samples --- */ + Set<Sample> samples = ExportHelper.getSamples(extract, dc); + for (Sample sample : samples) { + + /* --- Biosources --- */ + Set<BioSource> bioSources = ExportHelper.getBioSources(sample, dc); + for (BioSource bioSource : bioSources) { + + //create the new SubHyb Line + Tab2MageSubHybLine subLine = new Tab2MageSubHybLine(); + + subLine.set(Tab2MageConstants.labeledextract.getName(), null, labeledExtract.getName()); + setProtocolAndParameterAtrributes(subLine,labeledExtract,Tab2MageValidator.getLabelingProtocolCount(), Tab2MageConstants.protocol_labeling.getName(),response, dc); + subLine.set(Tab2MageConstants.dye.getName(), null,labelName); + subLine.set(Tab2MageConstants.extract.getName(), null, extract.getName()); + setProtocolAndParameterAtrributes(subLine,extract,Tab2MageValidator.getExtractProtocolCount(), Tab2MageConstants.protocol_extraction.getName(), response, dc); + subLine.set(Tab2MageConstants.sample.getName(), null, sample.getName()); + setProtocolAndParameterAtrributes(subLine,sample,Tab2MageValidator.getSamplingProtocolCount(), Tab2MageConstants.protocol_treatment.getName(), response, dc); + subLine.set(Tab2MageConstants.biosource.getName(), null, bioSource.getName()); + subLine.set(Tab2MageConstants.biosourcedescription.getName(), null, ValueFormatter.getStringWithoutLineBreaker(bioSource.getDescription())); + + //section for biomaterial xterixtics + ItemQuery<Annotation> query = bioSource.getAnnotationSet().getAnnotations(); + query.include(Include.MINE, Include.NOT_REMOVED, Include.IN_PROJECT,Include.SHARED); + List<Annotation> annotations = query.list(dc); + for (Annotation annotation: annotations) + { + AnnotationType at=annotation.getAnnotationType(); + if(!at.isRemoved()) + { + List<?> values= annotation==null? null:annotation.getValues(); + subLine.set(Tab2MageConstants.bio_mat_charact.getName(), annotation.getAnnotationType().getName(), + values==null || values.size()==0 ? ExportHelper.getDefaultValue(at) : Values.getString(values, ", ", true)); + } + } + + + subLines.add(subLine); //make a list of subLines + } } } - } - - subLines.add(subLine); //make a list of subLines - count++; - } //end of labeled extract loop - - hybRow.addHybSubLines(size, hybRow.getName(), subLines); // add the subLines (i.e. Tab2MageSubHybLine objectc list to Tab2MageHybridizationLine Object + } //end of labeled extract loop + hybRow.addHybSubLines(size, hybRow.getName(), subLines); // add the subLines (i.e. Tab2MageSubHybLine object list to Tab2MageHybridizationLine Object + - hybridization.addLine(hybRow); // add Tab2MageHybridizationLine Object to Tab2MageHybridization object - if(!hybs.contains(hybridization)) - hybs.add(hybridization); // add Tab2MageHybridization Object to the List of Tab2MageHybridization object + // create the Tab2MageHybridization object + Tab2MageHybridization hybridization= new Tab2MageHybridization (); + // set the number of channels for the Hybridization + hybridization.setChannelNumber(validator.getChannelNumber()); // mainly useful during the writing stage + hybridization.addLine(hybRow); // add Tab2MageHybridizationLine Object to Tab2MageHybridization object + if(!hybs.contains(hybridization)) + hybs.add(hybridization); // add Tab2MageHybridization Object to the List of Tab2MageHybridization object + } }// end of raw biossay for loop - // create headers for biomaterial xteristics Set<String> bioMatHeaders = new LinkedHashSet<String>(); @@ -546,17 +501,14 @@ // get the headers for the experiment factor values and add to experimental factor values header set factorValueHeaders.addAll(ExportHelper.getHeaderWithValuesOnly(l.getFactorValues())); } - /* Create all the used protocols objects */ protocols = ExportHelper.createProtocols(rawBioAssays, dc); - /* create all used Tab2Mage Hybridization sections protocol headers */ protocolHybSectionHeader= Tab2MageValidator.getProtocolHybSectionHeader(); - /* Create Tab2Mage Hybridization Section Header */ @@ -569,64 +521,25 @@ Tab2MageFileWriter.writeTab2MageFile(experiment, protocols,hybs, hybSectionHeader,bioMatHeaders, protocolHybSectionHeader, paramHeaders,factorValueHeaders, job, response, dc); + Tab2MageFileWriter.getStatusOut().write("DONE\n"); + Tab2MageFileWriter.closeWriter(); - //statusOut.close(); - Writer out= Tab2MageFileWriter.getOut(); - out.flush(); - out.close(); dc.commit(); response.setDone("Experiment " + experiment.getName() + " exported successfully"); } catch (Throwable ex) { + Tab2MageFileWriter.closeWriter(); response.setError(ex.getMessage(), Arrays.asList(ex)); } finally { + Tab2MageFileWriter.closeWriter(); if (dc != null) dc.close(); } } - + /** - set the array attributes of the the <code>Tab2MageHybridizationLine</code> object - @param hybRow, the <code>Tab2MageHybridizationLine</code> object - @param arrayDesign, the Array Design - */ - private void setArraysAttributes (Tab2MageHybridizationLine hybRow, ArrayDesign arrayDesign ) - { - hybRow.set("Array",Tab2MageConstants.array_accession.getName(),arrayDesign.getName()); - } - - /** - set the file attributes of the the <code>Tab2MageHybridizationLine</code> object - @param hybRow, the Tab2MageHybridizationLine object - @param arrayDesign, the Array Design - @param rba, the raw bio assay - @param response, the response object to return errors in case of failure during the setting of file values - */ - private void setFileAttributes(Tab2MageHybridizationLine hybRow, ArrayDesign arrayDesign, RawBioAssay rba, Response response) - { - try - { - if (arrayDesign.isAffyChip()) - { - File cdfFile= Affymetrix.getCdfFile(arrayDesign); - File celFile=Affymetrix.getCelFile(rba); - hybRow.set("File", Tab2MageConstants.raw_file.getName(), celFile.getName()); - hybRow.set("File",Tab2MageConstants.cdf_file.getName(), cdfFile.getName()); - } - else - { - hybRow.set("File", Tab2MageConstants.raw_file.getName(), rba.getName()); - } - - } - catch(Throwable tr) - { - response.setError(tr.getMessage(), Arrays.asList(tr)); - } - } - /** set the protocol and parameters attributes/values for Labeling -to- Sampling protocol and parameters @param dc, the database control @param subLine, the <code>Tab2MageSubHybLine</code> object @@ -636,11 +549,11 @@ @param protocol, the protocol object @param response, the response object to return errors in case of failure during the setting of parameter values */ - private void setProtocolAndParameterAtrributes(DbControl dc,Tab2MageSubHybLine subLine, Annotatable anotatable, int prot... [truncated message content] |
From: Nicklas N. <ni...@th...> - 2010-02-05 10:43:42
|
On 2010-02-05 10:07, Gildas Le Corguillé wrote: > For the last point, I had to use the method RawBioAssay.setFileSet(). > Which is implement in a newer BASE2Core than Tab2Mage_exporter > previously used. > But I don't know from which version of Base, this method appear ? Then > if we propose my update, old version of base will show troubles. It appeared in BASE 2.5. We usually try to add a note in the javadoc for the api: http://base.thep.lu.se/chrome/site/latest/api/net/sf/basedb/core/RawBioAssay.html#getFileSet() Our policy for the "Required BASE version" for plug-ins is to specify the version that was used when testing. Even if it theoretically can be compiled against an older BASE version we really don't know if it works with that version. And since we don't have any resources to test with older BASE versions this usually means that all plug-ins will require the BASE version that was the current at the time the plug-in was released. If you, for example, tested your changes with BASE 2.14 it would mean that the new requirement is BASE 2.14. /Nicklas |
From: Jari H. <ja...@th...> - 2010-02-05 10:28:01
|
Hi Gildas, Great to see work done on the Tab2Mage exporter. The original author has left for other tasks and the Tab2Mage code is currently without a maintainer but lives under the GPL2 license so it is free to modify and improve. You can submit your patches to me and I make sure that they are committed to the repository. If you checked out the source from subversion then you can simply create a patch diff. Excerpt from http://base.thep.lu.se/wiki/DeveloperInformation: ... send an email to the developers list containing your log message and the output of svn diff (from the top of your Subversion working copy) ... Send the patch to me. For the new method usage we simply increase the BASE version requirement on the plug-in. I'll find out when the new method appeared in BASE. Changing the Tab2Mage plugin will not affect already installed servers but rather new users of the Tab2Mage plugin. Of course, users wanting to use your new features must of course upgrade their BASE if it is obsolete. Cheers, Jari On 2/5/10 10:07 AM, Gildas Le Corguillé wrote: > Dear colleagues, > > I had a problem with Tab2Mage exporter plugin about polling. > Then to know if it was my fault or its fault, I downloaded the sources > to study the pooling implications. > > And finally, I tried to fix what I thought be a bug. > > Now Tab2Mage_exporter : > - supports pooling > - creates a scan column in the output file > - uses the filemane name in the "File[raw]" column instead of the > RawBioAssay name > - supports several files per RawBioAssay > > > I hope I didn't add bug !? > And now, what is your policy about submiting an update ? Must I contact > the original author ? > > For the last point, I had to use the method RawBioAssay.setFileSet(). > Which is implement in a newer BASE2Core than Tab2Mage_exporter > previously used. > But I don't know from which version of Base, this method appear ? Then > if we propose my update, old version of base will show troubles. > > Thank you for your attention > > Best regards > > Gildas > > > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > basedb-devel mailing list > bas...@li... > https://lists.sourceforge.net/lists/listinfo/basedb-devel |
From: Gildas Le C. <lec...@sb...> - 2010-02-05 09:07:14
|
Dear colleagues, I had a problem with Tab2Mage exporter plugin about polling. Then to know if it was my fault or its fault, I downloaded the sources to study the pooling implications. And finally, I tried to fix what I thought be a bug. Now Tab2Mage_exporter : - supports pooling - creates a scan column in the output file - uses the filemane name in the "File[raw]" column instead of the RawBioAssay name - supports several files per RawBioAssay I hope I didn't add bug !? And now, what is your policy about submiting an update ? Must I contact the original author ? For the last point, I had to use the method RawBioAssay.setFileSet(). Which is implement in a newer BASE2Core than Tab2Mage_exporter previously used. But I don't know from which version of Base, this method appear ? Then if we propose my update, old version of base will show troubles. Thank you for your attention Best regards Gildas |
From: Woodbridge, M. R <m.w...@im...> - 2010-01-08 15:12:28
|
I have added a servlet to the BASE webapp that does the following: SessionControl sc = Application.newSessionControl("net.sf.basedb.clients.web", request.getRemoteAddr(), null); sc.login(username, password, null, false); DbControl dc = sc.newDbControl(); sc.setActiveProject(Project.getById(dc, projectId)); dc.close(); response.sendRedirect(String.format("/base/views/experiments/index.jsp?ID=%s&cmd=ViewItem&item_id=%s", sc.getId(), experimentId)); Haven't done much testing, but seems to work so far. I'm passing in the project ID because an experiment can be shared with more than one project (as previously discussed). I could make more of an effort to avoid creating unnecessary sessions, but not sure if this is worthwhile. Presumably I could avoid passing the user's password by putting the root password in the servlet and impersonating the real user. Thanks for all the help, Mark. ________________________________________ From: bas...@li... [bas...@li...] On Behalf Of Bob MacCallum [r.m...@im...] Sent: 08 January 2010 14:48 To: lef...@ya...; BASE dev Subject: Re: [basedb-devel] Setting active project via API A long time ago now, I remember having problems with experiments/projects. You would think it would be enough to add "Everyone" group to the project and then it would be visible, but as others have pointed out, the project has to be active before the expt is visible. We decided to just share all project items to Everyone and be done with it(*). You might get the granularity you need by sharing to groups instead. (* thanks to the BASE developers, we got a much increased max items limit in list view to make this easy to do) Olivier Lefevre writes: > >> Disregarding that, do you have any ideas about how to > >> link directly to an Experiment without getting the > >> 'permission denied' error caused by the wrong project > >> being selected? > > > > You can't link directly. You need to set the active > > project first. > > ?? AFAIK this is the first time this comes up. Why isn't > it enough to be logged and to have permission to view > the experiments in questions. Direct links to experiments > are possible: they have the form > http://localhost:8080/base2/views/experiments/index.jsp?ID=xxx&cmd=ViewItem&item_id=nnn > > -- O.L. > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > basedb-devel mailing list > bas...@li... > https://lists.sourceforge.net/lists/listinfo/basedb-devel -- Bob MacCallum | VectorBase Developer | Kafatos/Christophides Groups | Division of Cell and Molecular Biology | Imperial College London | Phone +442075941945 | Email r.m...@im... ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ basedb-devel mailing list bas...@li... https://lists.sourceforge.net/lists/listinfo/basedb-devel |
From: Bob M. <r.m...@im...> - 2010-01-08 14:48:12
|
A long time ago now, I remember having problems with experiments/projects. You would think it would be enough to add "Everyone" group to the project and then it would be visible, but as others have pointed out, the project has to be active before the expt is visible. We decided to just share all project items to Everyone and be done with it(*). You might get the granularity you need by sharing to groups instead. (* thanks to the BASE developers, we got a much increased max items limit in list view to make this easy to do) Olivier Lefevre writes: > >> Disregarding that, do you have any ideas about how to > >> link directly to an Experiment without getting the > >> 'permission denied' error caused by the wrong project > >> being selected? > > > > You can't link directly. You need to set the active > > project first. > > ?? AFAIK this is the first time this comes up. Why isn't > it enough to be logged and to have permission to view > the experiments in questions. Direct links to experiments > are possible: they have the form > http://localhost:8080/base2/views/experiments/index.jsp?ID=xxx&cmd=ViewItem&item_id=nnn > > -- O.L. > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > basedb-devel mailing list > bas...@li... > https://lists.sourceforge.net/lists/listinfo/basedb-devel -- Bob MacCallum | VectorBase Developer | Kafatos/Christophides Groups | Division of Cell and Molecular Biology | Imperial College London | Phone +442075941945 | Email r.m...@im... |
From: Nicklas N. <ni...@th...> - 2010-01-08 07:28:47
|
Olivier Lefevre wrote: >>> Disregarding that, do you have any ideas about how to >>> link directly to an Experiment without getting the >>> 'permission denied' error caused by the wrong project >>> being selected? >> You can't link directly. You need to set the active >> project first. > > ?? AFAIK this is the first time this comes up. Why isn't > it enough to be logged and to have permission to view > the experiments in questions. Direct links to experiments > are possible: they have the form > http://localhost:8080/base2/views/experiments/index.jsp?ID=xxx&cmd=ViewItem&item_id=nnn The permissions for a user a linked with the active project. Switching projects is more or less at the same level as logging out and then back as another user. The direct link offers no possibility to switch user nor any possibility to switch project. Both of these things has to be done before the view page is being accessed. /Nicklas |
From: Olivier L. <lef...@ya...> - 2010-01-07 21:51:12
|
>> Disregarding that, do you have any ideas about how to >> link directly to an Experiment without getting the >> 'permission denied' error caused by the wrong project >> being selected? > > You can't link directly. You need to set the active > project first. ?? AFAIK this is the first time this comes up. Why isn't it enough to be logged and to have permission to view the experiments in questions. Direct links to experiments are possible: they have the form http://localhost:8080/base2/views/experiments/index.jsp?ID=xxx&cmd=ViewItem&item_id=nnn -- O.L. |
From: Nicklas N. <ni...@th...> - 2010-01-07 17:46:18
|
Woodbridge, Mark R wrote: > I have tried adding a new servlet to the existing BASE web.xml file > but I got a strange error that seemed to imply that BASE defines its > own ClassLoader. Not in this context, but Tomcat does. http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html > Have you ever seen a problem like this? Like what? > I'm not > clear on the best way to invoke code that uses the native API. Using > the webservices API is easy because you just need the relevant jars. > > Disregarding that, do you have any ideas about how to link directly > to an Experiment without getting the 'permission denied' error caused > by the wrong project being selected? You can't link directly. You need to set the active project first. To do this you need code that is living in the BASE web application that calls SessionControl.setActiveProject(). You could for example create a servlet that takes four parameters: login, password, project ID and experiment ID. Then something rougly like this: // Create a new session and login SessionControl sc = Application.newSessionControl(....); sc.login(login, password, ....); // Then, active the project Project p = Project.getById(...); sc.setActiveProject(p); // redirect to the experiment page response.sendRedirect(....); > I'm assuming it would actually > be possible to write a servlet that automatically authenticates the > user, sets the active project, then redirects to the experiment? I'm > not sure of the best approach... Neither am I... you'll need to fill in a lot of blanks in the "code" above. The example above creates a new session every time. If you need something different, you'll probably need to mange the session id's in your own application and add that as a parameter to the servlet as well. The servlet should then first check for an existing session before creating a new one: Application.getSessionControl(...); /Nicklas |
From: Woodbridge, M. R <m.w...@im...> - 2010-01-07 16:53:25
|
Ok. I assumed session ids could be re-used because the SessionClient constructor allows you to pass one in. That explains why my approach isn't working. I have tried adding a new servlet to the existing BASE web.xml file but I got a strange error that seemed to imply that BASE defines its own ClassLoader. Have you ever seen a problem like this? I'm not clear on the best way to invoke code that uses the native API. Using the webservices API is easy because you just need the relevant jars. Disregarding that, do you have any ideas about how to link directly to an Experiment without getting the 'permission denied' error caused by the wrong project being selected? I'm assuming it would actually be possible to write a servlet that automatically authenticates the user, sets the active project, then redirects to the experiment? I'm not sure of the best approach... Mark. -----Original Message----- From: bas...@li... [mailto:bas...@li...] On Behalf Of Nicklas Nordborg Sent: 07 January 2010 16:37 To: BASE dev Subject: Re: [basedb-devel] Setting active project via API Woodbridge, Mark R wrote: > Thanks Nicklas. > > I know this issue has come up on the mailing list a couple of times, > but I'm not sure what the solution is. As I said, I'm linking > directly to Experiments in BASE from my Flex application. I'm doing > this by doing an HTTP POST to /login.jsp with a redirect to > views/experiments/index.jsp?cmd=ViewItem&item_id=...&ID=... > > This works fine but there are a couple of problems. The first is that > I call /login.jsp every time I link to an experiment. I'm using the > same ID every time to avoid creating a new session. Is this the > correct thing to do? No you can't reuse the same ID. It has to be unique for per user session. Strange things will happen if there are multiple sessions using the same ID. > The second problem is this issue with the active project. What is the > correct way to ensure that the link works i.e. avoiding linking to an > Experiment that isn't shared with the 'active' project? I have tried > the following: > > 1. Generate a session ID 2. Use the webservices API to set the active > project for this sessionID 3. Post to /login.jsp using this sessionID > > > But this doesn't seem to work. Is there a way to link directly to an > Experiment, ignoring whatever Project is currently active? Any help > would be gratefully received. No this will not work. From the BASE point of view your web service application is the client. The session ID it uses to set the active project can't be transfered to another client (eg. a web browser). You'll need to add code to the BASE web server application. Eg. add your own servlets, JSP:s, web services, etc. that does the hard work for you using the BASE core API directly. I don't think it can be done by using the current web service API or by calling the JSP scripts. /Nicklas ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ basedb-devel mailing list bas...@li... https://lists.sourceforge.net/lists/listinfo/basedb-devel |
From: Nicklas N. <ni...@th...> - 2010-01-07 16:37:09
|
Woodbridge, Mark R wrote: > Thanks Nicklas. > > I know this issue has come up on the mailing list a couple of times, > but I'm not sure what the solution is. As I said, I'm linking > directly to Experiments in BASE from my Flex application. I'm doing > this by doing an HTTP POST to /login.jsp with a redirect to > views/experiments/index.jsp?cmd=ViewItem&item_id=...&ID=... > > This works fine but there are a couple of problems. The first is that > I call /login.jsp every time I link to an experiment. I'm using the > same ID every time to avoid creating a new session. Is this the > correct thing to do? No you can't reuse the same ID. It has to be unique for per user session. Strange things will happen if there are multiple sessions using the same ID. > The second problem is this issue with the active project. What is the > correct way to ensure that the link works i.e. avoiding linking to an > Experiment that isn't shared with the 'active' project? I have tried > the following: > > 1. Generate a session ID 2. Use the webservices API to set the active > project for this sessionID 3. Post to /login.jsp using this sessionID > > > But this doesn't seem to work. Is there a way to link directly to an > Experiment, ignoring whatever Project is currently active? Any help > would be gratefully received. No this will not work. From the BASE point of view your web service application is the client. The session ID it uses to set the active project can't be transfered to another client (eg. a web browser). You'll need to add code to the BASE web server application. Eg. add your own servlets, JSP:s, web services, etc. that does the hard work for you using the BASE core API directly. I don't think it can be done by using the current web service API or by calling the JSP scripts. /Nicklas |