Changeset 1385


Ignore:
Timestamp:
Sep 2, 2011, 3:39:29 PM (10 years ago)
Author:
Martin Svensson
Message:

References #311 The Illumina plugin package can now be build with base3-jars and install in BASE3.0

Location:
plugins/base2/net.sf.basedb.illumina/trunk
Files:
6 added
3 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • plugins/base2/net.sf.basedb.illumina/trunk/META-INF/extensions.xml

    r1267 r1385  
    2828    <name>Illumina extensions</name>
    2929    <version>1.7pre</version>
    30     <copyright>BASE 2 development team</copyright>
     30    <copyright>BASE development team</copyright>
    3131    <email>basedb-users@lists.sourceforge.net</email>
    32     <url>http://baseplugins.thep.lu.se/wiki/net.sf.basedb.illumina</url>
     32    <url>http://baseplugins.thep.lu.se/wiki/net.sf.basedb.illumina</url> 
     33    <minbaserversion>3.0</minbaserversion> 
    3334  </about>
     35  <plugin-definition id="Installer">
     36    <about>
     37      <name>Illumina plug-in package installer</name>
     38      <description>
     39        This plug-in will install required platforms, data files types, etc. that
     40        are required to use the Illumina plug-ins. Start the installation by selecting this
     41        plug-in from the list at Administrate -> Plugins -> Definitions. Then click on the
     42        'Run plugin' button.
     43      </description>     
     44    </about>   
     45    <plugin-class>net.sf.basedb.illumina.install.Install</plugin-class>
     46  </plugin-definition>
     47  <plugin-definition id="ExpressionBackgroundCorrection">
     48    <about>
     49      <name>Illumina expression background correction</name>
     50      <description>   
     51        This plug-in will remove a per-slide global background from all
     52        spots. The background is calculated from a set of negative control
     53        spots on the array.\n\n
     54        Each assay is treated separately, i.e., no samples are combined
     55        together. All calculations are made on the current bioassay data
     56        implying that this plug-in should be used early in analysis and before
     57        background spots are removed.\n\n
     58        A spot is considered to be a negative control spot if it has an
     59        ''Control group name'' exactly matching the string ''negative''.\n\n
     60        There is one parameter to set that specifies how background
     61        intensities should be calculated. Allowed values are median or mean,
     62        i.e. the background is either the median or the mean of the negative
     63        control spots on the array.\n\n
     64        The expression of the background probes is optionally saved to a
     65        file. The default is not to save the expression matrix but this can be
     66        changed during job configuration.   
     67      </description>     
     68    </about>   
     69    <plugin-class>net.sf.basedb.illumina.plugins.BackgroundCorrection</plugin-class>
     70  </plugin-definition>
     71  <plugin-definition id="BeadSummaryImporter">
     72    <about>
     73      <name>Illumina Bead Summary importer</name>
     74      <description>
     75        Raw data importer for Illumina bead summary files. This plug-in can import data from one
     76        or more related bead summary files that are part of the same array but different stripes.
     77      </description>     
     78    </about>   
     79    <plugin-class>net.sf.basedb.illumina.plugins.BeadSummaryImporter</plugin-class>
     80  </plugin-definition>
     81  <plugin-definition id="BgxFeatureImporter">
     82    <about>
     83      <name>Illumina BGX feature importer</name>
     84      <description>
     85        Plugin that imports features from a Illumina BGX-file.
     86        Both compressed(gzip) and uncompressed files are supported.
     87        None of the mappings for the [Controls] section are configurable.
     88        These are set like follows:\n
     89        Identify features by->FEATURE_ID\nReporter ID->\\Probe_Id\\\nFeature ID->\\Array_Address_Id\\\n
     90        Reg exp for data header is preconfigured to 'Probe_Id\\tArray_Address_Id.*'
     91      </description>
     92    </about>
     93    <plugin-class>net.sf.basedb.illumina.plugins.BgxFeatureImporter</plugin-class>
     94  </plugin-definition>
     95  <plugin-definition id="BgxReporterImporter">
     96    <about>
     97      <name>Illumina BGX reporter importer</name>
     98      <description>
     99        Imports reporter annotation from Illumina BGX files. This importer is
     100        based on the regular reporter importer and has the same features and functions.
     101        It supports both compressed and uncompressed BGX files. File format configurations
     102        made for this plug-in applies to the [Probes] section only. Column mappings for the
     103        [Controls] section can't be configured. Some controls appear more than one time
     104        in the [Controls] section. If the they have different values for the any of the
     105        Reporter_Group_Name, Reporter_Group_Id and/or Reporter_Composite_Map columns the values
     106        are merged with a ; as separator.
     107      </description>
     108    </about>   
     109    <plugin-class>net.sf.basedb.illumina.plugins.BgxReporterImporter</plugin-class>
     110  </plugin-definition> 
     111  <plugin-definition id="DetectionPvalueCalculation">
     112    <about>
     113      <name>Illumina detection P-value calculation</name>
     114      <description>
     115        This plug-in implements BeadStudio like detection P-value calculations
     116        for Illumina expression data.\n\n
     117        The plug-in will _always_ base the detection P-value calculation on
     118        raw data values, i.e., the mean raw intensity for the different
     119        signals. By default the calculations are based on negative controls
     120        available in the root bioassay set for the current analysis
     121        branch. The user may change this to only use negative controls in the
     122        current bioassay set.\n\n
     123        The detection P-value plug-in does not filter the assays, it provides
     124        the detection P-values usable in a filter step after running this
     125        plug-in.\n\n
     126        Parameters\n
     127        - The plug-in requires input of array type since detection P-value are
     128        calculated differently depending on array type.\n
     129        - Users may select to use negative controls in the current bioassay set
     130        only. The default behaviour is to use all negative controls in the
     131        root bioassay set for the current bioassay set.\n
     132        - A cut off parameter is available to exclude outliers within
     133        the negative controls. The `cutoff` defines the acceptable negative
     134        control signal range
     135        $median-MAD*cutoff &lt; I &lt; median+MAD*cutoff$
     136        where $MAD$ is the median absolute deviation.\n\n
     137        Implementation details\n\n
     138        Each assay is treated separately, i.e., no samples are combined
     139        together. All calculations are made on the raw bead-type level data,
     140        i.e., on the average expression value for each bead type and raw data
     141        is always used irrespective when in analysis the detection P-value is
     142        calculated.\n\n
     143        Pvalue calculation for whole genome arrays:\n
     144        For all signals $i$ calculate the detection P-value as
     145        $Pvalue = 1-R/N$ where $R$ is the rank of the signal $i$ relative to the
     146        negative controls and $N$ is the number of negative controls.\n\n
     147        Pvalue calculation for others array types (DASL, miRNA, VeraCode DASL,
     148        and Focused Arrays):\n
     149        For all signals $i$ calculate the detection P-value as
     150        $Pvalue = 1/2 - 1/2 * erf( [i-AvgControl]/StdControl/sqrt(2) )$ where
     151        $AvgControl$ is the average intensity of the negative controls,
     152        $StdControl$ is the standard deviation of the the negative controls,
     153        and $erf$ is the error function
     154        (http://mathworld.wolfram.com/Erf.html). The error function is used
     155        for arguments within the range (-4,4). To save CPU cycles, the function
     156        value for arguments outside this range is set to -1 and 1,
     157        respectively.\n\n
     158        More details about this plug-in is found at the URL
     159        \n\n Please send feedback to the email-address
     160      </description>
     161    </about>   
     162    <plugin-class>net.sf.basedb.illumina.plugins.DetectionPValue</plugin-class>
     163  </plugin-definition>
     164  <plugin-definition id="SnpRootBioAssaysetCreator">
     165    <about>
     166      <name>Illumina SNP root bioassayset creator</name>
     167      <description>
     168        Creates a root bioassay set from Illumina SNP data. This plug-in works
     169        only if all raw bioassays has the same array design and SNP split data files
     170        are present. The root bioassayset is created by copying values from the data files
     171        as follows:\n
     172         * Channel 1 = GType (AA = 1.0, AB = 0.0, BB = -1.0, NC = null\n
     173         * Channel 2 = Log R Ratio\n
     174         * Channel 3 = B Allele Freq
     175      </description>
     176    </about>
     177    <plugin-class>net.sf.basedb.illumina.plugins.SnpIntensityCalculator</plugin-class>
     178  </plugin-definition>
     179  <plugin-definition id="SnpRawDataImporter">
     180    <about>
     181      <name>Illumina SNP raw data importer</name>
     182      <description>
     183        This plug-in is used to import raw data for Illumina SNP from a tab separated text file. The plug-in can be
     184        executed both from the list of raw bioassays and from within an experiment. In the
     185        last case the imported data will be associated with the experiment
     186      </description>
     187    </about> 
     188    <plugin-class>net.sf.basedb.illumina.plugins.SnpRawDataImporter</plugin-class>
     189  </plugin-definition>
     190  <plugin-definition id="SnpReporterImporter">
     191    <about>
     192      <name>Illumina SNP reporter importer</name>
     193      <description>
     194        Imports reporters from SNP manifest files. This importer works exactly
     195        as the regular reporter importer and has the same features.
     196      </description>
     197    </about>
     198    <plugin-class>net.sf.basedb.illumina.plugins.SnpReporterImporter</plugin-class>
     199  </plugin-definition>
    34200  <extension
    35201    id="net.sf.basedb.illumina.extensions.overviewplots.illuminaPlots"
  • plugins/base2/net.sf.basedb.illumina/trunk/build.xml

    r1293 r1385  
    1515  <property name="name" value="illumina-plugins" />
    1616  <property name="version" value="1.7pre" />
    17   <property name="minbaseversion" value="2.17"
     17  <property name="minbaseversion" value="3.0"
    1818    description="Minimal BASE version required by the plug-ins" />
    1919  <property name="src" location="src" description="Location of source files" />
     
    2626  <property name="javac.encoding" value="UTF-8" />
    2727  <property name="depend.jars"
    28     value="http://base2.thep.lu.se/base/jars/2.17.0"
     28    value="http://base2.thep.lu.se/base/jars/"
    2929    description="The location of the BASE core JARs that we depend on"
    3030  />
     
    113113    <copy todir="${build}">
    114114      <fileset dir="." includes="META-INF/*"/>
    115     </copy>
    116     <replace token="%%plugins.jar%%" value="${jar}" file="${build}/META-INF/base-plugins.xml" />
     115    </copy>   
    117116    <jar
    118117      jarfile="${dist}/${jar}"
     
    140139      encoding="UTF-8"
    141140    />
    142    
    143     <echo>base-plugins.xml</echo>
    144     <replaceregexp
    145       file="META-INF/base-plugins.xml"
    146       match="&lt;minbaseversion&gt;.*&lt;/minbaseversion&gt;"
    147       replace="&lt;minbaseversion&gt;${minbaseversion}&lt;/minbaseversion&gt;"
    148       encoding="UTF-8"
    149       flags="g"
    150     />
     141       
    151142    <echo>Don't forget to commit the changes to the subversion repository!</echo>
    152143  </target>
     
    154145  <target
    155146    name="checkjar"
    156     description="Checks that the BASE2Core.jar, BASE2Webclient, BASE2CorePlugins.jar and BASE2WSClient.jar exists."
     147    description="Checks that the base-core-3.0.0.jar, base-webclient-3.0.0.jar, base-coreplugins-3.0.0.jar and base-webclient-3.0.0.jar exists."
    157148    >
    158149    <available classname="net.sf.basedb.core.Application"
    159       classpathref="classpath" property="base2core" />
     150      classpathref="classpath" property="base3core" />
    160151    <available classname="net.sf.basedb.plugins.ReporterFlatFileImporter"
    161       classpathref="classpath" property="base2coreplugins" />
     152      classpathref="classpath" property="base3coreplugins" />
    162153    <available classname="net.sf.basedb.ws.client.SessionClient"
    163       classpathref="classpath" property="base2wsclient" />
     154      classpathref="classpath" property="base3wsclient" />
    164155    <available classname="net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory"
    165       classpathref="classpath" property="base2web" />
    166     <fail unless="base2core" message="Can't find BASE2Core.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
    167     <fail unless="base2coreplugins" message="Can't find BASE2CorePlugins.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
    168     <fail unless="base2wsclient" message="Can't find BASE2WSClient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
    169     <fail unless="base2web" message="Can't find BASE2Webclient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
    170     <echo>Found BASE2Core.jar, BASE2CorePlugins.jar, BASE2Webclient.jar and BASE2WSClient.jar.</echo>
     156      classpathref="classpath" property="base3web" />
     157    <fail unless="base3core" message="Can't find base-core-3.0.0.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
     158    <fail unless="base3coreplugins" message="Can't find base-coreplugins-3.0.0.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
     159    <fail unless="base3wsclient" message="Can't find base-webservices-client-3.0.0.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
     160    <fail unless="base3web" message="Can't find base-webclient-3.0.0.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
     161    <echo>Found base-core-3.0.0.jar, base-coreplugins-3.0.0.jar, base-webservices-client-3.0.0.jar and base-webclient-3.0.0.jar.</echo>
    171162  </target>
    172163
    173164    <target
    174165    name="download-lib"
    175     description="Download BASE2Core.jar, BASE2CorePlugins.jar and BASE2WSClient.jar."
     166    description="Download base-webclient-3.0.0.jar, base-core-3.0.0.jar, base-coreplugins-3.0.0.jar and base-webservices-client-3.0.0.jar"
    176167    >
    177168    <echo>
     
    182173-------------------------------------------------------
    183174    </echo>
    184     <download-lib file="BASE2Core.jar" />
    185     <download-lib file="BASE2CorePlugins.jar" />
    186     <download-lib file="BASE2WSClient.jar" />
    187     <download-lib file="BASE2Webclient.jar" />
     175    <download-lib file="base-core-3.0.0.jar" />
     176    <download-lib file="base-coreplugins-3.0.0.jar" />
     177    <download-lib file="base-webservices-client-3.0.0.jar" />
     178    <download-lib file="base-webclient-3.0.0.jar" />
    188179  </target>
    189180 
  • plugins/base2/net.sf.basedb.illumina/trunk/lib/compile

    • Property svn:ignore
      •  

        old new  
        33BASE2WSClient.jar
        44BASE2Webclient.jar
         5base-core-3.0.0.jar
         6base-coreplugins-3.0.0.jar
         7base-webclient-3.0.0.jar
         8base-webservices-client-3.0.0.jar
  • plugins/base2/net.sf.basedb.illumina/trunk/src/net/sf/basedb/illumina/Illumina.java

    r1267 r1385  
    2323package net.sf.basedb.illumina;
    2424
     25import net.sf.basedb.core.FileStoreEnabled;
     26import net.sf.basedb.core.InvalidUseOfNullException;
     27import net.sf.basedb.core.Platform;
    2528import net.sf.basedb.core.RawDataType;
    2629import net.sf.basedb.core.RawDataTypes;
     
    3235
    3336  /**
    34     The current version of this plug-in package.
    35   */
    36   public static final String VERSION = "1.7pre";
    37  
    38   /**
    3937    The URL where more information about this plug-in package can
    4038    be found.
    4139  */
    4240  public static final String URL = "http://baseplugins.thep.lu.se/wiki/net.sf.basedb.illumina";
    43  
    44   /**
    45     The copyright holders of the plug-ins.
    46   */
    47   public static final String COPYRIGHT = "BASE 2 development team";
    48  
    49   /**
    50     The email address to use for support and more information.
    51   */
    52   public static final String EMAIL = "basedb-users@lists.sourceforge.net";
    53  
     41
    5442  /**
    5543    The ID for the main Illumina platform item. Use
     
    145133  }
    146134 
     135  /**
     136    Check if the item is using the Illumina-platform. 
     137    @param item Item to check. Null is not allowed.
     138    @return TRUE if platform is used, FALSE otherwise
     139  */
     140  public static boolean isIllumina(FileStoreEnabled item)
     141  {
     142    if (item == null) throw new InvalidUseOfNullException("item");
     143    Platform platform = item.getPlatform();
     144    if(platform == null || !Illumina.PLATFORM_ID.equals(platform.getExternalId()))
     145    {
     146      return false;     
     147    }
     148    return true;
     149  }
    147150}
  • plugins/base2/net.sf.basedb.illumina/trunk/src/net/sf/basedb/illumina/install/Install.java

    r1237 r1385  
    2222*/
    2323package net.sf.basedb.illumina.install;
    24 
    25 import net.sf.basedb.core.BaseException;
    26 import net.sf.basedb.core.Coloring;
    27 import net.sf.basedb.core.DataFileType;
    28 import net.sf.basedb.core.DbControl;
    29 import net.sf.basedb.core.ExtraValueType;
    30 import net.sf.basedb.core.FileType;
    31 import net.sf.basedb.core.Formula;
    32 import net.sf.basedb.core.Hardware;
    33 import net.sf.basedb.core.HardwareType;
    34 import net.sf.basedb.core.InvalidDataException;
    35 import net.sf.basedb.core.Item;
    36 import net.sf.basedb.core.ItemAlreadyExistsException;
    37 import net.sf.basedb.core.ItemNotFoundException;
    38 import net.sf.basedb.core.Job;
    39 import net.sf.basedb.core.Permission;
    40 import net.sf.basedb.core.Platform;
    41 import net.sf.basedb.core.PlatformVariant;
    42 import net.sf.basedb.core.PluginDefinition;
    43 import net.sf.basedb.core.PluginParameter;
    44 import net.sf.basedb.core.ProgressReporter;
    45 import net.sf.basedb.core.RawDataType;
    46 import net.sf.basedb.core.RequestInformation;
    47 import net.sf.basedb.core.Software;
    48 import net.sf.basedb.core.SoftwareType;
    49 import net.sf.basedb.core.StringParameterType;
    50 import net.sf.basedb.core.SystemItems;
    51 import net.sf.basedb.core.Type;
    52 import net.sf.basedb.core.plugin.About;
    53 import net.sf.basedb.core.plugin.AboutImpl;
    54 import net.sf.basedb.core.plugin.AbstractPlugin;
    55 import net.sf.basedb.core.plugin.GuiContext;
    56 import net.sf.basedb.core.plugin.InteractivePlugin;
    57 import net.sf.basedb.core.plugin.Permissions;
    58 import net.sf.basedb.core.plugin.Plugin;
    59 import net.sf.basedb.core.plugin.Request;
    60 import net.sf.basedb.core.plugin.Response;
    61 import net.sf.basedb.illumina.Illumina;
    6224
    6325import java.util.ArrayList;
     
    7234import java.util.Map;
    7335import java.util.Set;
     36
     37import net.sf.basedb.core.BaseException;
     38import net.sf.basedb.core.Coloring;
     39import net.sf.basedb.core.DataFileType;
     40import net.sf.basedb.core.DbControl;
     41import net.sf.basedb.core.ExtraValueType;
     42import net.sf.basedb.core.File;
     43import net.sf.basedb.core.Formula;
     44import net.sf.basedb.core.Hardware;
     45import net.sf.basedb.core.InvalidDataException;
     46import net.sf.basedb.core.Item;
     47import net.sf.basedb.core.ItemAlreadyExistsException;
     48import net.sf.basedb.core.ItemNotFoundException;
     49import net.sf.basedb.core.ItemSubtype;
     50import net.sf.basedb.core.Job;
     51import net.sf.basedb.core.Permission;
     52import net.sf.basedb.core.Platform;
     53import net.sf.basedb.core.PlatformVariant;
     54import net.sf.basedb.core.PluginDefinition;
     55import net.sf.basedb.core.PluginParameter;
     56import net.sf.basedb.core.ProgressReporter;
     57import net.sf.basedb.core.RawDataType;
     58import net.sf.basedb.core.RequestInformation;
     59import net.sf.basedb.core.Software;
     60import net.sf.basedb.core.StringParameterType;
     61import net.sf.basedb.core.SystemItems;
     62import net.sf.basedb.core.Type;
     63import net.sf.basedb.core.plugin.AbstractPlugin;
     64import net.sf.basedb.core.plugin.GuiContext;
     65import net.sf.basedb.core.plugin.InteractivePlugin;
     66import net.sf.basedb.core.plugin.Permissions;
     67import net.sf.basedb.core.plugin.Plugin;
     68import net.sf.basedb.core.plugin.Request;
     69import net.sf.basedb.core.plugin.Response;
     70import net.sf.basedb.illumina.Illumina;
    7471
    7572/**
     
    114111  implements InteractivePlugin
    115112{
    116   private static final About about = new AboutImpl(
    117     "Illumina plug-in package installer",
    118     "This plug-in will install required platforms, data files types, etc. that " +
    119     "are required to use the Illumina plug-ins. Start the installation by selecting this " +
    120     "plug-in from the list at Administrate -> Plugins -> Definitions. Then click on the " +
    121     "'Run plugin' button.",
    122     Illumina.VERSION,
    123     Illumina.COPYRIGHT,
    124     null,
    125     Illumina.EMAIL,
    126     Illumina.URL
    127   );
    128113 
    129114  private static final Set<GuiContext> guiContexts =
     
    210195    -------------------------------------------
    211196  */
    212   public About getAbout()
    213   {
    214     return about;
    215   }
    216197  @Override
    217198  public Collection<Permissions> getPermissions()
     
    223204      permissions.add(new Permissions(Item.EXTRAVALUETYPE, null, EnumSet.of(Permission.CREATE)));
    224205      permissions.add(new Permissions(Item.PLUGINDEFINITION, null, EnumSet.of(Permission.READ)));
    225       permissions.add(new Permissions(Item.FILETYPE, null, EnumSet.of(Permission.READ)));
    226       permissions.add(new Permissions(Item.HARDWARETYPE, null, EnumSet.of(Permission.USE)));
    227       permissions.add(new Permissions(Item.HARDWARE, null, EnumSet.of(Permission.CREATE)));
    228       permissions.add(new Permissions(Item.SOFTWARETYPE, null, EnumSet.of(Permission.USE)));
     206      permissions.add(new Permissions(Item.ITEMSUBTYPE, null, EnumSet.of(Permission.READ)));     
     207      permissions.add(new Permissions(Item.HARDWARE, null, EnumSet.of(Permission.CREATE)));     
    229208      permissions.add(new Permissions(Item.SOFTWARE, null, EnumSet.of(Permission.CREATE)));
    230209      permissions.add(new Permissions(Item.FORMULA, null, EnumSet.of(Permission.CREATE)));
     
    455434    String beadSummaryTypePrefix = "illlumina.ibs.";
    456435   
    457     FileType reporterMapType = null;
    458     FileType rawDataType = null;
     436    ItemSubtype reporterMapType = null;
     437    ItemSubtype rawDataType = null;
    459438   
    460439    Iterator<Integer> expressionTypeIterator = expressionTypes.iterator();
     
    465444    }
    466445   
    467     reporterMapType = FileType.getById(dc, SystemItems.getId("net.sf.basedb.core.FileType.REPORTER_MAP"));
    468     rawDataType = FileType.getById(dc, SystemItems.getId("net.sf.basedb.core.FileType.RAW_DATA"));
     446    reporterMapType = ItemSubtype.getById(dc, SystemItems.getId(File.REPORTER_MAP));
     447    rawDataType = ItemSubtype.getById(dc, SystemItems.getId(File.RAW_DATA));
    469448
    470449    //Data file types
     
    771750  */
    772751  private DataFileType createDataFileType(DbControl dc, String externalId, String name,
    773       String description, Item itemType, String extension, FileType genericType,
     752      String description, Item itemType, String extension, ItemSubtype genericType,
    774753      String validatorClass, String metadataReaderClass, String jarPath,  boolean ignoreExistingItem)
    775754    throws ItemAlreadyExistsException
     
    786765      if (extension != null && !extension.equals(dft.getExtension())) message += dft.getName() + " has invalid extension.\n";
    787766      if (!itemType.equals(dft.getItemType())) message += dft.getName() + " has invalid item type.\n";
    788       if (validatorClass != null && !validatorClass.equals(dft.getValidatorClass())) message += "Validator class used: " + dft.getValidatorClass() + ", expected: " + validatorClass;
    789       if (metadataReaderClass != null && !metadataReaderClass.equals(dft.getMetadataReaderClass())) message += "Metadata class used: " + dft.getMetadataReaderClass() + ", expected: " + metadataReaderClass;
     767//      if (validatorClass != null && !validatorClass.equals(dft.getValidatorClass())) message += "Validator class used: " + dft.getValidatorClass() + ", expected: " + validatorClass;
     768//      if (metadataReaderClass != null && !metadataReaderClass.equals(dft.getMetadataReaderClass())) message += "Metadata class used: " + dft.getMetadataReaderClass() + ", expected: " + metadataReaderClass;
     769     
    790770      if (message != null) throw new ItemAlreadyExistsException(message + " The existing datafiletype, '" + dft.getName() + "' can not be used.");
    791771     
     
    793773      if (jarPath != null)
    794774      {
    795         dft.setMetadataReaderJarPath(jarPath);
    796         dft.setValidatorJarPath(jarPath);
     775//        dft.setMetadataReaderJarPath(jarPath);
     776//        dft.setValidatorJarPath(jarPath);
    797777      }
    798778    }
     
    805785      dft.setDescription(description);
    806786      dft.setGenericType(genericType);
    807       dft.setValidatorClass(validatorClass);
    808       dft.setValidatorJarPath(jarPath);
    809       dft.setMetadataReaderClass(metadataReaderClass);
    810       dft.setMetadataReaderJarPath(jarPath);
     787//      dft.setValidatorClass(validatorClass);
     788//      dft.setValidatorJarPath(jarPath);
     789//      dft.setMetadataReaderClass(metadataReaderClass);
     790//      dft.setMetadataReaderJarPath(jarPath);
    811791    }
    812792    return dft;
     
    904884  public Hardware createScanner(DbControl dc, String name, String version, String description)
    905885  {
    906     HardwareType scannerType = HardwareType.getById(dc, SystemItems.getId(HardwareType.SCANNER));
    907     Hardware scanner = Hardware.getNew(dc, scannerType);
     886    ItemSubtype scannerType = ItemSubtype.getById(dc, SystemItems.getId(Hardware.SCANNER));
     887    Hardware scanner = Hardware.getNew(dc);
     888    scanner.setItemSubtype(scannerType);
    908889    scanner.setName(name);
    909890    scanner.setVersionString(version);
     
    915896  public Software createSoftware(DbControl dc, String name, String version, String description)
    916897  {
    917     SoftwareType featureExtraction = SoftwareType.getById(dc, SystemItems.getId(SoftwareType.FEATURE_EXTRACTION));
    918     Software software = Software.getNew(dc, featureExtraction);
     898    ItemSubtype featureExtraction = ItemSubtype.getById(dc, SystemItems.getId(Software.FEATURE_EXTRACTION));
     899    Software software = Software.getNew(dc);
     900    software.setItemSubtype(featureExtraction);
    919901    software.setName(name);
    920902    software.setVersionString(version);
  • plugins/base2/net.sf.basedb.illumina/trunk/src/net/sf/basedb/illumina/plugins/BackgroundCorrection.java

    r1293 r1385  
    2323
    2424package net.sf.basedb.illumina.plugins;
     25
     26import java.io.PrintWriter;
     27import java.sql.SQLException;
     28import java.util.ArrayList;
     29import java.util.Arrays;
     30import java.util.Collection;
     31import java.util.EnumSet;
     32import java.util.HashMap;
     33import java.util.HashSet;
     34import java.util.Iterator;
     35import java.util.List;
     36import java.util.Set;
     37import java.util.TreeSet;
     38import java.util.Vector;
    2539
    2640import net.sf.basedb.core.AnyToAny;
     
    4862import net.sf.basedb.core.Type;
    4963import net.sf.basedb.core.VirtualColumn;
    50 import net.sf.basedb.core.plugin.About;
    51 import net.sf.basedb.core.plugin.AboutImpl;
    5264import net.sf.basedb.core.plugin.AbstractAnalysisPlugin;
    5365import net.sf.basedb.core.plugin.GuiContext;
     
    7284import net.sf.basedb.util.Values;
    7385
    74 import java.io.PrintWriter;
    75 import java.sql.SQLException;
    76 import java.util.ArrayList;
    77 import java.util.Arrays;
    78 import java.util.Collection;
    79 import java.util.EnumSet;
    80 import java.util.HashMap;
    81 import java.util.HashSet;
    82 import java.util.Iterator;
    83 import java.util.List;
    84 import java.util.Set;
    85 import java.util.TreeSet;
    86 import java.util.Vector;
    87 
    8886
    8987/**
     
    10098{
    10199
    102   private static final About about = new AboutImpl
    103     ( "Illumina expression background correction",
    104       "This plug-in will remove a per-slide global background from all " +
    105       "spots. The background is calculated from a set of negative control " +
    106       "spots on the array.\n\n" +
    107       "Each assay is treated separately, i.e., no samples are combined " +
    108       "together. All calculations are made on the current bioassay data " +
    109       "implying that this plug-in should be used early in analysis and before " +
    110       "background spots are removed.\n\n" +
    111       "A spot is considered to be a negative control spot if it has an " +
    112       "''Control group name'' exactly matching the string ''negative''.\n\n" +
    113       "There is one parameter to set that specifies how background " +
    114       "intensities should be calculated. Allowed values are median or mean, " +
    115       "i.e. the background is either the median or the mean of the negative " +
    116       "control spots on the array.\n\n" +
    117       "The expression of the background probes is optionally saved to a " +
    118       "file. The default is not to save the expression matrix but this can be " +
    119       "changed during job configuration.\n\n" +
    120       "Please send feedback to " +
    121       Illumina.EMAIL,
    122       Illumina.VERSION,
    123       Illumina.COPYRIGHT,
    124       null,
    125       Illumina.EMAIL,
    126       Illumina.URL
    127       );
     100  private static final String pluginName = "Illumina expression background correction";
    128101
    129102  /**
     
    297270
    298271  // From the Plugin interface
    299   @Override
    300   public About getAbout()
    301   {
    302     return about;
    303   }
    304 
    305 
    306272  private RequestInformation getConfigureJobParameters()
    307273  {
     
    500466      // Create Transformation
    501467      Transformation t = source.newTransformation(thisJob);
    502       t.setName(about.getName());
     468      t.setName(pluginName);
    503469      dc.saveItem(t);
    504470
     
    541507        Directory expDir=source.getExperiment().getDirectory();
    542508        File bgData=File.getFile(dc, expDir,
    543                                  about.getName() + "_backgroundProbes_" +
     509                                 pluginName + "_backgroundProbes_" +
    544510                                 thisJob.getId() + ".txt", true);
    545511        bgData.setLocation(Location.PRIMARY);
     
    554520
    555521        bgWriter = new PrintWriter(bgData.getUploadStream(false,true));
    556         bgWriter.println("# File generated by plug-in: " + about.getName());
     522        bgWriter.println("# File generated by plug-in: " + pluginName);
    557523        bgWriter.println("#\n# Background based on " +
    558524                         ( method.equals("Illumina BeadStudio median") ?
  • plugins/base2/net.sf.basedb.illumina/trunk/src/net/sf/basedb/illumina/plugins/BeadSummaryImporter.java

    r1293 r1385  
    6868import net.sf.basedb.core.StringParameterType;
    6969import net.sf.basedb.core.data.RawData;
    70 import net.sf.basedb.core.plugin.About;
    71 import net.sf.basedb.core.plugin.AboutImpl;
    7270import net.sf.basedb.core.plugin.AbstractPlugin;
    7371import net.sf.basedb.core.plugin.GuiContext;
     
    119117  implements InteractivePlugin, SignalTarget
    120118{
    121 
    122   private static final About about = new AboutImpl(
    123     "Illumina Bead Summary importer",
    124     "Raw data importer for Illumina bead summary files. This plug-in can import data from one " +
    125     "or more related bead summary files that are part of the same array but different stripes.",
    126     Illumina.VERSION,
    127     Illumina.COPYRIGHT,
    128     null,
    129     Illumina.EMAIL,
    130     Illumina.URL
    131   );
    132119 
    133120  private static final Set<GuiContext> guiContexts =
     
    194181    -------------------------------------------
    195182  */
    196   @Override
    197   public About getAbout()
    198   {
    199     return about;
    200   }
    201   @Override
     183  @Override
    202184  public boolean requiresConfiguration()
    203185  {
     
    551533          int id = currentRaw == null ? sc.getCurrentContext(Item.RAWBIOASSAY).getId() : currentRaw.getId();
    552534          if (id != 0) currentRaw = RawBioAssay.getById(dc, id);
    553           addRawBioAssayParameters(dc, currentRaw, parameters);
     535          addRawBioAssayParameters(dc, currentRaw, parameters, true);
    554536        }
    555537        else
     
    595577  }
    596578 
    597   private void addRawBioAssayParameters(DbControl dc, RawBioAssay currentRaw, List<PluginParameter<?>> parameters)
     579  private void addRawBioAssayParameters(DbControl dc, RawBioAssay currentRaw, List<PluginParameter<?>> parameters, boolean requireValid)
    598580  {
    599581    // Parameter for getting the current raw bioassay
     
    614596    {
    615597      DataFileType dft = pft.getDataFileType();
    616       File f = FileStoreUtil.getDataFile(dc, currentRaw, dft.getExternalId());
     598      File f = FileStoreUtil.getDataFile(dc, currentRaw, dft.getExternalId(), requireValid);
    617599     
    618600      PluginParameter<File> fileParameter = new PluginParameter<File>(
  • plugins/base2/net.sf.basedb.illumina/trunk/src/net/sf/basedb/illumina/plugins/BgxFeatureImporter.java

    r1293 r1385  
    2222*/
    2323package net.sf.basedb.illumina.plugins;
     24
     25import java.io.IOException;
     26import java.io.InputStream;
     27import java.io.PushbackInputStream;
     28import java.util.HashMap;
     29import java.util.List;
     30import java.util.Map;
     31import java.util.regex.Pattern;
     32import java.util.zip.GZIPInputStream;
    2433
    2534import net.sf.basedb.core.ArrayDesign;
     
    3443import net.sf.basedb.core.PluginDefinition;
    3544import net.sf.basedb.core.SessionControl;
    36 import net.sf.basedb.core.plugin.About;
    37 import net.sf.basedb.core.plugin.AboutImpl;
    3845import net.sf.basedb.core.plugin.GuiContext;
    3946import net.sf.basedb.core.plugin.InteractivePlugin;
     
    4148import net.sf.basedb.core.plugin.Request;
    4249import net.sf.basedb.core.plugin.Response;
    43 import net.sf.basedb.illumina.Illumina;
    4450import net.sf.basedb.plugins.ReporterMapFlatFileImporter;
    4551import net.sf.basedb.util.FileUtil;
    4652import net.sf.basedb.util.InputStreamTracker;
    4753import net.sf.basedb.util.parser.FlatFileParser;
     54import net.sf.basedb.util.parser.FlatFileParser.Line;
    4855import net.sf.basedb.util.parser.Mapper;
    4956import net.sf.basedb.util.parser.WrappedConfigureByExample;
    50 import net.sf.basedb.util.parser.FlatFileParser.Line;
    51 
    52 import java.io.IOException;
    53 import java.io.InputStream;
    54 import java.io.PushbackInputStream;
    55 import java.util.HashMap;
    56 import java.util.List;
    57 import java.util.Map;
    58 import java.util.regex.Pattern;
    59 import java.util.zip.GZIPInputStream;
    6057
    6158/**
     
    7572{
    7673
    77   private static final About about = new AboutImpl(
    78     "Illumina BGX feature importer",
    79     "Plugin that imports features from a Illumina BGX-file. " +
    80     "Both compressed(gzip) and uncompressed files are supported. " +
    81     "None of the mappings for the [Controls] section are configurable. " +
    82     "These are set like follows:\n" +
    83     "Identify features by->FEATURE_ID\nReporter ID->\\Probe_Id\\\nFeature ID->\\Array_Address_Id\\\n" +
    84     "Reg exp for data header is preconfigured to 'Probe_Id\\tArray_Address_Id.*'",
    85     Illumina.VERSION,
    86     Illumina.COPYRIGHT,
    87     null,
    88     Illumina.EMAIL,
    89     Illumina.URL
    90   );
    9174  /**
    9275    Needed for progress reporting when reading from a compressed
     
    11497    -------------------------------------------
    11598  */
    116   @Override
    117   public About getAbout()
    118   {
    119     return about;
    120   }
    12199  @Override
    122100  public void init(SessionControl sc, ParameterValues configuration, ParameterValues job)
  • plugins/base2/net.sf.basedb.illumina/trunk/src/net/sf/basedb/illumina/plugins/BgxReporterImporter.java

    r1187 r1385  
    4141import net.sf.basedb.core.PluginDefinition;
    4242import net.sf.basedb.core.SessionControl;
    43 import net.sf.basedb.core.plugin.About;
    44 import net.sf.basedb.core.plugin.AboutImpl;
    4543import net.sf.basedb.core.plugin.InteractivePlugin;
    4644import net.sf.basedb.core.plugin.ParameterValues;
    47 import net.sf.basedb.illumina.Illumina;
    4845import net.sf.basedb.plugins.ReporterFlatFileImporter;
    4946import net.sf.basedb.util.FileUtil;
    5047import net.sf.basedb.util.InputStreamTracker;
    5148import net.sf.basedb.util.parser.FlatFileParser;
     49import net.sf.basedb.util.parser.FlatFileParser.Line;
    5250import net.sf.basedb.util.parser.WrappedConfigureByExample;
    53 import net.sf.basedb.util.parser.FlatFileParser.Line;
    5451
    5552/**
     
    7673  implements InteractivePlugin, WrappedConfigureByExample
    7774{
    78 
    79   private static final About about = new AboutImpl(
    80     "Illumina BGX reporter importer",
    81     "Imports reporter annotation from Illumina BGX files. This importer is " +
    82     "based on the regular reporter importer and has the same features and functions. " +
    83     "It supports both compressed and uncompressed BGX files. File format configurations " +
    84     "made for this plug-in applies to the [Probes] section only. Column mappings for the " +
    85     "[Controls] section can't be configured. Some controls appear more than one time " +
    86     "in the [Controls] section. If the they have different values for the any of the " +
    87     "Reporter_Group_Name, Reporter_Group_Id and/or Reporter_Composite_Map columns the values " +
    88     "are merged with a ; as separator.",
    89     Illumina.VERSION,
    90     Illumina.COPYRIGHT,
    91     null,
    92     Illumina.EMAIL,
    93     Illumina.URL
    94   );
    9575 
    9676  /**
     
    11999    -------------------------------------------
    120100  */
    121   @Override
    122   public About getAbout()
    123   {
    124     return about;
    125   }
    126101  @Override
    127102  public void init(SessionControl sc, ParameterValues configuration, ParameterValues job)
  • plugins/base2/net.sf.basedb.illumina/trunk/src/net/sf/basedb/illumina/plugins/DetectionPValue.java

    r1293 r1385  
    2323
    2424package net.sf.basedb.illumina.plugins;
     25
     26import java.sql.SQLException;
     27import java.util.ArrayList;
     28import java.util.Arrays;
     29import java.util.Collection;
     30import java.util.EnumSet;
     31import java.util.HashSet;
     32import java.util.List;
     33import java.util.Set;
    2534
    2635import net.sf.basedb.core.BaseException;
     
    4554import net.sf.basedb.core.Type;
    4655import net.sf.basedb.core.VirtualColumn;
    47 import net.sf.basedb.core.plugin.About;
    48 import net.sf.basedb.core.plugin.AboutImpl;
    4956import net.sf.basedb.core.plugin.AbstractAnalysisPlugin;
    5057import net.sf.basedb.core.plugin.GuiContext;
     
    7178import org.apache.commons.math.special.Erf;
    7279
    73 import java.sql.SQLException;
    74 import java.util.ArrayList;
    75 import java.util.Arrays;
    76 import java.util.Collection;
    77 import java.util.EnumSet;
    78 import java.util.HashSet;
    79 import java.util.List;
    80 import java.util.Set;
    81 
    8280
    8381/**
     
    9492{
    9593
    96   private static final About about = new AboutImpl
    97     ( "Illumina detection P-value calculation",
    98       "This plug-in implements BeadStudio like detection P-value calculations " +
    99       "for Illumina expression data.\n\n" +
    100       "The plug-in will _always_ base the detection P-value calculation on " +
    101       "raw data values, i.e., the mean raw intensity for the different " +
    102       "signals. By default the calculations are based on negative controls " +
    103       "available in the root bioassay set for the current analysis " +
    104       "branch. The user may change this to only use negative controls in the " +
    105       "current bioassay set.\n\n" +
    106       "The detection P-value plug-in does not filter the assays, it provides " +
    107       "the detection P-values usable in a filter step after running this " +
    108       "plug-in.\n\n" +
    109       "Parameters\n" +
    110       "- The plug-in requires input of array type since detection P-value are " +
    111       "calculated differently depending on array type.\n" +
    112       "- Users may select to use negative controls in the current bioassay set " +
    113       "only. The default behaviour is to use all negative controls in the " +
    114       "root bioassay set for the current bioassay set.\n" +
    115       "- A cut off parameter is available to exclude outliers within " +
    116       "the negative controls. The `cutoff` defines the acceptable negative " +
    117       "control signal range " +
    118       "$median-MAD*cutoff < I < median+MAD*cutoff$ " +
    119       "where $MAD$ is the median absolute deviation.\n\n" +
    120       "Implementation details\n\n" +
    121       "Each assay is treated separately, i.e., no samples are combined " +
    122       "together. All calculations are made on the raw bead-type level data, " +
    123       "i.e., on the average expression value for each bead type and raw data " +
    124       "is always used irrespective when in analysis the detection P-value is " +
    125       "calculated.\n\n" +
    126       "Pvalue calculation for whole genome arrays:\n" +
    127       "For all signals $i$ calculate the detection P-value as " +
    128       "$Pvalue = 1-R/N$ where $R$ is the rank of the signal $i$ relative to the " +
    129       "negative controls and $N$ is the number of negative controls.\n\n" +
    130       "Pvalue calculation for others array types (DASL, miRNA, VeraCode DASL, " +
    131       "and Focused Arrays):\n" +
    132       "For all signals $i$ calculate the detection P-value as " +
    133       "$Pvalue = 1/2 - 1/2 * erf( [i-AvgControl]/StdControl/sqrt(2) )$ where " +
    134       "$AvgControl$ is the average intensity of the negative controls, " +
    135       "$StdControl$ is the standard deviation of the the negative controls, " +
    136       "and $erf$ is the error function " +
    137       "(http://mathworld.wolfram.com/Erf.html). The error function is used " +
    138       "for arguments within the range (-4,4). To save CPU cycles, the function " +
    139       "value for arguments outside this range is set to -1 and 1, " +
    140       "respectively.\n\n" +
    141       "More details about this plug-in is found at " + Illumina.URL +
    142       "\n\n Please send feedback to " + Illumina.EMAIL,
    143       Illumina.VERSION,
    144       Illumina.COPYRIGHT,
    145       null,
    146       Illumina.EMAIL,
    147       Illumina.URL
    148       );
    149 
     94  private static final String pluginName = "Illumina detection P-value calculation";
     95 
    15096  /**
    15197    Configuration parameters
     
    276222
    277223  // From the Plugin interface
    278   @Override
    279   public About getAbout()
    280   {
    281     return about;
    282   }
    283 
    284 
    285224  private RequestInformation getConfigureJobParameters()
    286225  {
     
    466405      // Create Transformation
    467406      Transformation t = source.newTransformation(thisJob);
    468       t.setName(about.getName());
     407      t.setName(pluginName);
    469408      dc.saveItem(t);
    470409
  • plugins/base2/net.sf.basedb.illumina/trunk/src/net/sf/basedb/illumina/plugins/SnpIntensityCalculator.java

    r1293 r1385  
    6868import net.sf.basedb.core.Transformation;
    6969import net.sf.basedb.core.data.ReporterData;
    70 import net.sf.basedb.core.plugin.About;
    71 import net.sf.basedb.core.plugin.AboutImpl;
    7270import net.sf.basedb.core.plugin.AbstractPlugin;
    7371import net.sf.basedb.core.plugin.GuiContext;
     
    8886import net.sf.basedb.util.NumberFormatUtil;
    8987import net.sf.basedb.util.parser.FlatFileParser;
     88import net.sf.basedb.util.parser.FlatFileParser.Data;
    9089import net.sf.basedb.util.parser.Mapper;
    91 import net.sf.basedb.util.parser.FlatFileParser.Data;
    9290
    9391/**
     
    106104
    107105{
    108   private static final About about = new AboutImpl(
    109       "Illumina SNP root biassayset creator",
    110       "Creates a root bioassay set from Illumina SNP data. This plug-in works " +
    111       "only if all raw bioassays has the same array design and SNP split data files " +
    112       "are present. The root bioassayset is created by copying values from the data files " +
    113       "as follows:\n" +
    114       " * Channel 1 = GType (AA = 1.0, AB = 0.0, BB = -1.0, NC = null\n" +
    115       " * Channel 2 = Log R Ratio\n" +
    116       " * Channel 3 = B Allele Freq",
    117       Illumina.VERSION,
    118       Illumina.COPYRIGHT,
    119       null,
    120       Illumina.EMAIL,
    121       Illumina.URL
    122     );
    123 
    124106  private static final Set<GuiContext> guiContexts =
    125107    Collections.singleton(new GuiContext(Item.BIOASSAYSET, GuiContext.Type.LIST));
     
    154136    -------------------------------------------
    155137  */
    156   public About getAbout()
    157   {
    158     return about;
    159   }
    160138  public Plugin.MainType getMainType()
    161139  {
     
    242220      for (RawBioAssay rba : sources)
    243221      {
    244         numInserted += insertSpotData(dc, rba, rootBas, spotBatcher, skipped, simpleProgress);
     222        numInserted += insertSpotData(dc, rba, rootBas, spotBatcher, skipped, true, simpleProgress);
    245223      }
    246224      spotBatcher.close();     
     
    473451  }
    474452 
    475   private File getManifestFile(DbControl dc, ArrayDesign design)
    476   {
    477     File manifest = FileStoreUtil.getDataFile(dc, design, Illumina.SNP_MANIFEST_FILE_ID);
     453  private File getManifestFile(DbControl dc, ArrayDesign design, boolean requireValid)
     454  {
     455    File manifest = FileStoreUtil.getDataFile(dc, design, Illumina.SNP_MANIFEST_FILE_ID, requireValid);
    478456    if (manifest == null)
    479457    {
     
    501479
    502480  private int insertSpotData(DbControl dc, RawBioAssay rba, BioAssaySet root,
    503     SpotBatcher spotBatcher, Set<Integer> skipped, SimpleAbsoluteProgressReporter progress)
     481    SpotBatcher spotBatcher, Set<Integer> skipped, boolean requireValid, SimpleAbsoluteProgressReporter progress)
    504482    throws IOException
    505483  {
    506     File dataFile = FileStoreUtil.getDataFile(dc, rba, Illumina.SNP_SPLITDATA_FILE_ID);
     484    File dataFile = FileStoreUtil.getDataFile(dc, rba, Illumina.SNP_SPLITDATA_FILE_ID, requireValid);
    507485    if (dataFile == null)
    508486    {
     
    614592   
    615593    // Scan the file and create proxies for all reporters
    616     File manifest = getManifestFile(dc, design);
     594    File manifest = getManifestFile(dc, design, true);
    617595    String mfFilename = manifest.getName();
    618596    FlatFileParser ffp = getManifestParser(manifest);
  • plugins/base2/net.sf.basedb.illumina/trunk/src/net/sf/basedb/illumina/plugins/SnpRawDataImporter.java

    r1293 r1385  
    2323package net.sf.basedb.illumina.plugins;
    2424
     25import java.io.BufferedWriter;
     26import java.io.IOException;
     27import java.io.OutputStreamWriter;
     28import java.util.ArrayList;
     29import java.util.Arrays;
     30import java.util.Collections;
     31import java.util.HashMap;
     32import java.util.HashSet;
     33import java.util.LinkedList;
     34import java.util.List;
     35import java.util.Map;
     36import java.util.Set;
     37import java.util.regex.Pattern;
     38
    2539import net.sf.basedb.core.ArrayDesign;
    2640import net.sf.basedb.core.BaseException;
     
    2842import net.sf.basedb.core.DataFileType;
    2943import net.sf.basedb.core.DbControl;
     44import net.sf.basedb.core.DerivedBioAssay;
    3045import net.sf.basedb.core.Directory;
    3146import net.sf.basedb.core.Experiment;
    3247import net.sf.basedb.core.File;
    33 import net.sf.basedb.core.FileType;
    3448import net.sf.basedb.core.Include;
    3549import net.sf.basedb.core.InvalidDataException;
     
    3953import net.sf.basedb.core.ItemParameterType;
    4054import net.sf.basedb.core.ItemQuery;
     55import net.sf.basedb.core.ItemSubtype;
    4156import net.sf.basedb.core.Job;
    4257import net.sf.basedb.core.Location;
     
    4762import net.sf.basedb.core.PluginParameter;
    4863import net.sf.basedb.core.Protocol;
    49 import net.sf.basedb.core.ProtocolType;
    5064import net.sf.basedb.core.RawBioAssay;
    5165import net.sf.basedb.core.RawDataType;
    5266import net.sf.basedb.core.RawDataTypes;
    5367import net.sf.basedb.core.RequestInformation;
    54 import net.sf.basedb.core.Scan;
    5568import net.sf.basedb.core.Software;
    56 import net.sf.basedb.core.SoftwareType;
    5769import net.sf.basedb.core.SystemItems;
    58 import net.sf.basedb.core.plugin.About;
    59 import net.sf.basedb.core.plugin.AboutImpl;
    6070import net.sf.basedb.core.plugin.GuiContext;
    6171import net.sf.basedb.core.plugin.InteractivePlugin;
     
    7282import net.sf.basedb.util.parser.ColumnMapper;
    7383import net.sf.basedb.util.parser.FlatFileParser;
    74 import net.sf.basedb.util.parser.Mapper;
    7584import net.sf.basedb.util.parser.FlatFileParser.Data;
    7685import net.sf.basedb.util.parser.FlatFileParser.LineType;
    77 
    78 import java.io.BufferedWriter;
    79 import java.io.IOException;
    80 import java.io.OutputStreamWriter;
    81 import java.util.ArrayList;
    82 import java.util.Arrays;
    83 import java.util.Collections;
    84 import java.util.HashMap;
    85 import java.util.HashSet;
    86 import java.util.LinkedList;
    87 import java.util.List;
    88 import java.util.Map;
    89 import java.util.Set;
    90 import java.util.regex.Pattern;
     86import net.sf.basedb.util.parser.Mapper;
    9187
    9288/**
     
    107103{
    108104 
    109   private static final About about = new AboutImpl
    110   (
    111       "Illumina SNP raw data importer",
    112       "This plug-in is used to import raw data for Illumina SNP from a tab separated text file. The plug-in can be " +
    113       "executed both from the list of raw bioassays and from within an experiment. In the " +
    114       "last case the imported data will be associated with the experiment",
    115       Illumina.VERSION,
    116       Illumina.COPYRIGHT,
    117       null,
    118       Illumina.EMAIL,
    119       Illumina.URL
    120   ); 
    121105  private static final Set<GuiContext> guiContexts =
    122106    Collections.unmodifiableSet(new HashSet<GuiContext>(
     
    176160 
    177161  //Scan associated with the raw bioassays
    178   private Scan scan;
     162  private DerivedBioAssay derivedBioAssay;
    179163 
    180164  //Software associated with the raw bioassays
     
    191175    -------------------------------------------
    192176  */
    193   public About getAbout()
    194   {
    195     return about;
    196   }
    197177  public boolean supportsConfigurations()
    198178  {
     
    262242        storeValue(job, request, ri.getParameter("experiment"));
    263243        storeValue(job, request, ri.getParameter("arrayDesign"));
    264         storeValue(job, request, ri.getParameter("scan"));
     244        storeValue(job, request, ri.getParameter("derivedBioAssay"));
    265245        storeValue(job, request, ri.getParameter("protocol"));
    266246        storeValue(job, request, ri.getParameter("software"));
     
    388368    this.experiment = (Experiment)job.getValue("experiment");
    389369    this.design = (ArrayDesign)job.getValue("arrayDesign");
    390     this.scan = (Scan)job.getValue("scan");
     370    this.derivedBioAssay = (DerivedBioAssay)job.getValue("derivedBioAssay");
    391371    this.protocol = (Protocol)job.getValue("protocol");
    392372    this.software = (Software)job.getValue("software");
     
    530510       
    531511        dc = sc.newDbControl();
    532         List<Scan> scans = getItems(dc, Scan.getQuery());
     512        List<DerivedBioAssay> derivedBioAssays = getItems(dc, DerivedBioAssay.getQuery());
    533513        List<Protocol> protocols = getItems(dc, Protocol.getQuery(),
    534514            Restrictions.eq(
    535515              Hql.property("protocolType.id"),
    536               Expressions.integer(SystemItems.getId(ProtocolType.FEATURE_EXTRACTION))
     516              Expressions.integer(SystemItems.getId(Protocol.FEATURE_EXTRACTION))
    537517            )
    538518          );
     
    540520          Restrictions.eq(
    541521              Hql.property("softwareType.id"),
    542               Expressions.integer(SystemItems.getId(SoftwareType.FEATURE_EXTRACTION))
     522              Expressions.integer(SystemItems.getId(Software.FEATURE_EXTRACTION))
    543523            )
    544524          );
     
    551531       
    552532        boolean hasAssociations =
    553           context.getItem() == Item.EXPERIMENT || scans.size() > 0 ||
     533          context.getItem() == Item.EXPERIMENT || derivedBioAssays.size() > 0 ||
    554534          protocols.size() > 0 || software.size() > 0 || designs.size() > 0;
    555535       
     
    576556            ));
    577557          }
    578           if (!scans.isEmpty())
     558          if (!derivedBioAssays.isEmpty())
    579559          {
    580             parameters.add(new PluginParameter<Scan>(
    581               "scan",
    582               "Scan",
    583               "The imported raw bioassays will be linked to the selected scan.",
    584               new ItemParameterType<Scan>(Scan.class, null, false, 1, scans)
     560            parameters.add(new PluginParameter<DerivedBioAssay>(
     561              "derivedBioAssay",
     562              "DerivedBioAssay",
     563              "The imported raw bioassays is derived from this.",
     564              new ItemParameterType<DerivedBioAssay>(DerivedBioAssay.class, null, false, 1, derivedBioAssays)
    585565            ));
    586566          }
     
    659639      File splitFile = File.getFile(dc, splitFilesDirectory, entry.getKey()+".split", true);
    660640      splitFile.setLocation(Location.PRIMARY);
    661       splitFile.setFileType(FileType.getById(dc, SystemItems.getId(FileType.RAW_DATA)));
     641      splitFile.setItemSubtype(ItemSubtype.getById(dc, SystemItems.getId(File.RAW_DATA)));
    662642      splitFile.setMimeType("text/plain");
    663643      dc.saveItem(splitFile);
     
    666646      rba.setName(entry.getKey());
    667647      if (design != null) rba.setArrayDesign(design);
    668       if (scan != null) rba.setScan(scan);
     648      if (derivedBioAssay != null) rba.setParentBioAssay(derivedBioAssay);
    669649      if (protocol != null) rba.setProtocol(protocol);
    670650      if (software != null) rba.setSoftware(software);
  • plugins/base2/net.sf.basedb.illumina/trunk/src/net/sf/basedb/illumina/plugins/SnpReporterImporter.java

    r941 r1385  
    2424package net.sf.basedb.illumina.plugins;
    2525
    26 import net.sf.basedb.core.plugin.About;
    27 import net.sf.basedb.core.plugin.AboutImpl;
    28 import net.sf.basedb.illumina.Illumina;
    2926import net.sf.basedb.plugins.ReporterFlatFileImporter;
    3027
     
    4239  extends ReporterFlatFileImporter
    4340{
    44  
    45   private static final About about = new AboutImpl(
    46       "Illumina SNP reporter importer",
    47       "Imports reporters from SNP manifest files. This importer works exactly " +
    48       "as the regular reporter importer and has the same features.",
    49       Illumina.VERSION,
    50       Illumina.COPYRIGHT,
    51       null,
    52       Illumina.EMAIL,
    53       Illumina.URL
    54     );
    55 
    5641  public SnpReporterImporter()
    5742  {}
    58  
    59   public About getAbout()
    60   {
    61     return about;
    62   }
    63  
    6443}
Note: See TracChangeset for help on using the changeset viewer.