Changeset 566


Ignore:
Timestamp:
Feb 1, 2008, 10:59:44 AM (13 years ago)
Author:
Nicklas Nordborg
Message:

References #89: Installation program and documentation

Added rest of the plug-ins to automatic installation. Cleaned up some parts of the installation.

Location:
trunk/net/sf/basedb/illumina
Files:
3 edited

Legend:

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

    r565 r566  
    66    <hasconfigurations/>
    77    </pluginclass>
     8  <pluginclass classname="net.sf.basedb.illumina.plugins.BgxReporterImporter">
     9    <minbaseversion>2.6</minbaseversion>
     10    <hasconfigurations>yes</hasconfigurations>
     11    </pluginclass>
    812  <pluginclass classname="net.sf.basedb.illumina.plugins.BgxFeatureImporter">
     13    <minbaseversion>2.6</minbaseversion>
     14    <hasconfigurations>yes</hasconfigurations>
     15    </pluginclass>
     16  <pluginclass classname="net.sf.basedb.illumina.plugins.ScanDataImporter">
    917    <minbaseversion>2.6</minbaseversion>
    1018    <hasconfigurations>yes</hasconfigurations>
  • trunk/net/sf/basedb/illumina/src/net/sf/basedb/illumina/Illumina.java

    r560 r566  
    11/**
    2   $Id$
     2  $Id$
    33
    44  Copyright (C) 2006 Nicklas Nordborg
     
    6060  public static final String PLATFORM_ID = "illumina";
    6161 
     62 
     63  /**
     64    The ID for the Illumina SNP platform variant. Use
     65    <code>PlatformVariant.getByExternalId(dc, Illumina.SNP_VARIANT_ID)<code>
     66    to load this item.
     67  */
     68  public static final String SNP_VARIANT_ID = "illumina.snp";
     69 
    6270  /**
    6371    The ID of the raw data type used to hold scandata raw data.
  • trunk/net/sf/basedb/illumina/src/net/sf/basedb/illumina/install/Install.java

    r556 r566  
    11/**
    2   $Id$
     2  $Id$
    33
    44  Copyright (C) 2006 Nicklas Nordborg
     
    4141import net.sf.basedb.core.ProgressReporter;
    4242import net.sf.basedb.core.RawDataType;
    43 import net.sf.basedb.core.RawDataTypes;
    4443import net.sf.basedb.core.RequestInformation;
    4544import net.sf.basedb.core.StringParameterType;
     
    6160import java.util.Collections;
    6261import java.util.EnumSet;
     62import java.util.HashMap;
    6363import java.util.HashSet;
    6464import java.util.Iterator;
    6565import java.util.List;
     66import java.util.Map;
    6667import java.util.Set;
    6768
     
    201202        String alreadyExistingItem = (String)job.getValue("alreadyInstalledError");
    202203
    203         HashSet<Integer> expressionTypes = new HashSet<Integer>();
     204        Set<Integer> expressionTypes = new HashSet<Integer>();
    204205        if (installExp1) expressionTypes.add(1);
    205206        if (installExp2) expressionTypes.add(2);
     
    237238      {
    238239        message = "Can only be used when this is the selected plug-in.";
     240      }
     241      RawDataType scanDataType = Illumina.getScanDataType();
     242      if (scanDataType == null)
     243      {
     244        throw new InvalidDataException("The '" + Illumina.SCANDATA_ID + "' raw data type is " +
     245            "missing. This must exist before the items can be installed, see the " +
     246            "Illumina plug-in manual.");
    239247      }
    240248    }
     
    299307    @throws ItemAlreadyExistsException If ignoreInstalledItems = FALSE and one of the
    300308   */
    301   public void installIlluminaItems(boolean installSNP, HashSet<Integer> expressionTypes, boolean ignoreExistingItems, ProgressReporter progress)
     309  public void installIlluminaItems(boolean installSNP, Set<Integer> expressionTypes, boolean ignoreExistingItems, ProgressReporter progress)
    302310    throws ItemAlreadyExistsException
    303311  {   
    304     RawDataType illuminaRawDataType = RawDataTypes.getRawDataType("illumina_scandata");
    305     if (illuminaRawDataType == null)
    306     {
    307       throw new InvalidDataException("Raw data type[illumina.scandata] is missing. " +
    308           "This must exist before the items can be installed, see the Illumina plug-in manual.");
     312    RawDataType scanDataType = Illumina.getScanDataType();
     313    if (scanDataType == null)
     314    {
     315      throw new InvalidDataException("Raw data type[" + Illumina.SCANDATA_ID + "] is " +
     316          "missing. This must exist before the items can be installed, see the " +
     317          "Illumina plug-in manual.");
    309318    }
    310319    DbControl dc = null;
    311320    int largestNumOfStrips = 0;
    312321    //external ids.
    313     String illuminaPlatformExternalId = "illumina";
    314     String snpVariantExternalId = "illumina.snp";
     322    //String snpVariantExternalId = "illumina.snp";
    315323    String expExternalIdPrefix = "illumina.exp";
    316324    String scandataFileTypePrefix = "illlumina.scandata.";
    317     String bgxFileTypeId = "illumina.bgx";
    318325   
    319326    FileType reporterMapType = null;
     
    333340      reporterMapType = FileType.getById(dc, SystemItems.getId("net.sf.basedb.core.FileType.REPORTER_MAP"));
    334341      rawDataType = FileType.getById(dc, SystemItems.getId("net.sf.basedb.core.FileType.RAW_DATA"));
    335      
    336       List<DataFileType> expressionDataFileTypes = new ArrayList<DataFileType>();
    337       DataFileType dft = createDataFileType(dc, bgxFileTypeId, "BGX file", Item.ARRAYDESIGN, BGX_FILEYTPE_EXTENSION, ignoreExistingItems);
    338       if (dft.getDescription() == null || dft.getDescription().equals(""))dft.setDescription("Illumina BGX file");
    339       if (dft.getGenericType() == null) dft.setGenericType(reporterMapType);
    340       expressionDataFileTypes.add(dft);
     342
     343      Map<String, DataFileType> dataFileTypes = new HashMap<String, DataFileType>();
     344     
     345      DataFileType bgx = createDataFileType(dc,
     346        Illumina.BGX_FILE_ID, "BGX file", "Illumina BGX file",
     347        Item.ARRAYDESIGN, BGX_FILEYTPE_EXTENSION, reporterMapType, ignoreExistingItems);
    341348
    342349      for (int i = 1; i <= largestNumOfStrips; i++ )
    343350      {
    344351        String name = "Scandata " + i; 
    345         dft = createDataFileType(dc, scandataFileTypePrefix + i, name, Item.RAWBIOASSAY, SCANDATA_FILETYPE_EXTENSION, ignoreExistingItems);
    346         if (dft.getGenericType() == null) dft.setGenericType(rawDataType);
    347         if (dft.getDescription() == null || dft.getDescription().equals("")) dft.setDescription("Illumina scandata file for strip #" + i + " in the array.");
    348         expressionDataFileTypes.add(dft);
     352        DataFileType dft = createDataFileType(dc,
     353          scandataFileTypePrefix + i, name, "Illumina scandata file for strip #" + i + " in the array.",
     354          Item.RAWBIOASSAY, SCANDATA_FILETYPE_EXTENSION, rawDataType, ignoreExistingItems);
     355        dataFileTypes.put(dft.getExternalId(), dft);
    349356      }
    350357      //TODO Create data file type for SNP filer.
    351358     
    352       dc.commit();
    353      
    354       dc = sc.newDbControl();
    355       Platform illuminaPlatform = createPlatform(dc, illuminaPlatformExternalId, "Illumina", ignoreExistingItems);
    356       if (illuminaPlatform.getDescription() == null || illuminaPlatform.getDescription().equals("")) illuminaPlatform.setDescription("Illumina platform.");
     359      Platform illuminaPlatform = createPlatform(dc, Illumina.PLATFORM_ID, "Illumina", ignoreExistingItems);
     360      if (illuminaPlatform.getDescription() == null || illuminaPlatform.getDescription().equals(""))
     361      {
     362        illuminaPlatform.setDescription("Illumina platform.");
     363      }
    357364           
    358365      List<PlatformVariant> platformVariants = new ArrayList<PlatformVariant>();     
     
    361368      {
    362369        PlatformVariant pfv = createPlatformVariant(dc, expExternalIdPrefix + type, namePrefix + type,
    363             illuminaPlatform, illuminaRawDataType, ignoreExistingItems);
     370            illuminaPlatform, scanDataType, ignoreExistingItems);
    364371        if (pfv.getDescription() == null || pfv.getDescription().equals("")) pfv.setDescription("Platform variant to use with Illumina expression containing " + type + " strip(s)/array");
    365         pfv.addFileType(DataFileType.getByExternalId(dc, bgxFileTypeId), true);
     372        pfv.addFileType(bgx, true);
    366373        for (int i = 1; i <= type; i++)
    367374        {
    368           pfv.addFileType(DataFileType.getByExternalId(dc, scandataFileTypePrefix+i), true);
     375          pfv.addFileType(dataFileTypes.get(scandataFileTypePrefix+i), true);
    369376        }
    370377        platformVariants.add(pfv);       
     
    372379      if (installSNP)
    373380      {
    374         PlatformVariant pfv = createPlatformVariant(dc, snpVariantExternalId, "Illumina SNP", illuminaPlatform, 2, ignoreExistingItems);
    375         if (pfv.getDescription() == null || pfv.getDescription().equals("")) pfv.setDescription("Platform variant to be used with Illumina SNP data.");
     381        PlatformVariant pfv = createPlatformVariant(dc, Illumina.SNP_VARIANT_ID,
     382            "Illumina SNP", illuminaPlatform, 2, ignoreExistingItems);
     383        if (pfv.getDescription() == null || pfv.getDescription().equals(""))
     384        {
     385          pfv.setDescription("Platform variant to be used with Illumina SNP data.");
     386        }
    376387        //TODO Add data file types to the SNP variant.
    377388        platformVariants.add(pfv);       
     
    411422 
    412423  private DataFileType createDataFileType(DbControl dc, String externalId, String name,
    413         Item itemType, String extension, boolean ignoreExistingItem)
     424    String description, Item itemType, String extension, FileType genericType, boolean ignoreExistingItem)
    414425    throws ItemAlreadyExistsException
    415426  {
     
    436447      dft.setName(name);
    437448      dft.setExtension(extension);
     449      dft.setDescription(description);
     450      dft.setGenericType(genericType);
    438451    }
    439452    return dft;
Note: See TracChangeset for help on using the changeset viewer.