Changeset 558


Ignore:
Timestamp:
Jan 28, 2008, 4:31:12 PM (15 years ago)
Author:
mbayer
Message:

have fixed several bugs after testing whole imports, notably a problem with the auto detect function for the plugin configs

Location:
branches/uk_ac_ebi_Tab2MageImporter
Files:
1 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • branches/uk_ac_ebi_Tab2MageImporter/TODO.txt

    r552 r558  
    1010- status report does not get written in all cases
    1111- error handling
     12- fix "about" text problem / updating of plugin
     13- replace spaces in tissue names with underscores for writing of file
     14- when doing manual mappings, have page return straight away until zip file is unzipped -- can take some time
     15- job progress bar does not report job progress but import progress for each individual file
     16- handle special characters in UI input, such as mu etc
    1217
    1318
     
    1520- enable tab2mage autogenerate only mode where file gets written to account (in new folder as before) but then there is no data import or object creation (users then import their data later together with the file they created here)
    1621- add support for users using their own name bases for samples and perhaps extracts
     22
     23extension: support for BASE 2.5 +
  • branches/uk_ac_ebi_Tab2MageImporter/build.xml

    r515 r558  
    7070  <target name="copyToServer" depends="build.plugin,copyJSPs">
    7171    <copy file="${plugin.name}.jar" todir="${tomcat.home}\webapps\base\WEB-INF\lib" verbose="true" />
     72    <copy file="${utils.name}.jar" todir="${tomcat.home}\webapps\base\WEB-INF\lib" verbose="true" />
    7273    <!-- now restart tomcat to reload the application -->
    7374    <echo message="tomcat home = "/>
  • branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/experiment.jsp

    r552 r558  
    503503      <td class="plainLabel" style="border-style: none;">Pubmed ID:</td>
    504504      <td class="input" style="border-style: none;"><input type="text" size="30" name="pubmedId"
    505         value=" " /></td>
     505        value="" /></td>
    506506      <td style="border-style: none;"></td>
    507507
  • branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/hybridizations.jsp

    r552 r558  
    158158    <td class="input">
    159159    <select name="platform">
    160     <option onclick="hideTwoChannelQuestions();" selected="selected" >Affymetrix</option>
    161     <option onclick="showTwoChannelQuestions();">Agilent</option>
     160    <option onclick="hideTwoChannelQuestions();">Affymetrix</option>
     161    <option onclick="showTwoChannelQuestions();"  selected="selected" >Agilent</option>
    162162    <option onclick="showTwoChannelQuestions();">AIDA</option>
    163163    <option onclick="showTwoChannelQuestions();">BZScan</option>
     
    178178  <tr>
    179179    <td class="boldText">Experimental organism:<font color="red"><b>&nbsp;*</b></font></td>
    180     <td class="input"><input type="text" size="50" name="organism" value="Hordeum vulgare"/></td>
     180    <td class="input"><input type="text" size="50" name="organism" value="Homo sapiens"/></td>
    181181    <td>The full scientific name of the experimental organism used.</td>
    182182  </tr>
     
    194194  <tr>
    195195    <td class="boldText">Number of treatment groups:<font color="red"><b>&nbsp;*</b></font></td>
    196     <td class="input"><input type="text" size="3" name="numTreatmentGroups" value="2"/></td>
     196    <td class="input"><input type="text" size="3" name="numTreatmentGroups" value="4"/></td>
    197197    <td>The number of discrete combinations of factor values, i.e. the product of the number of factor levels(values) from all factors. <p>
    198198    Example: an experiment with 2 factors and 3 factor values in each will have 6 treatment groups (2 X 3).
     
    203203  <tr>
    204204    <td class="boldText">Experimental factors:<font color="red"><b>&nbsp;*</b></font> </td>
    205     <td class="input"><textarea rows="7" cols="32" name="expFactors">Strain(mutant,wildtype)</textarea></td>
     205    <td class="input"><textarea rows="7" cols="32" name="expFactors">Genotype(wild type,PGC-1 beta transgenic)</textarea></td>
    206206    <td>Please list all experimental factors and value ranges using the following format (one per
    207207    line):<br>
     
    217217  <tr>
    218218    <td class="boldText">Number of subjects per group:<font color="red"><b>&nbsp;*</b></font></td>
    219     <td class="input"><input type="text" size="3" name="numReplicates" value=""/></td>
     219    <td class="input"><input type="text" size="3" name="numReplicates" value="2"/></td>
    220220    <td>This is the number of biological replicates in each treatment group.</td>
    221221  </tr>
     
    232232  <tr>
    233233    <td class="boldText">Target tissues:<font color="red"><b>&nbsp;*</b></font></td>
    234     <td class="input"><textarea rows="4" cols="32" name="tissues">stem</textarea></td>
     234    <td class="input"><textarea rows="4" cols="32" name="tissues">enterocyte</textarea></td>
    235235    <td>List all target tissues one per line, in no particular order (copy and paste from Excel works).</td>
    236236  </tr>
     
    243243    <table class="noBorder" cellpadding="4">
    244244      <tr>
    245         <td class="noBorder"><input type="radio" name="dyeSwap" id="dyeSwapYes" value="yes" onchange="checkRefSampleLogic();"/></td>
     245        <td class="noBorder"><input type="radio" name="dyeSwap" id="dyeSwapYes" value="yes"  checked="checked"  onchange="checkRefSampleLogic();"/></td>
    246246        <td class="noBorder">yes</td>
    247247      </tr>
    248248
    249249      <tr>
    250         <td class="noBorder"><input type="radio" name="dyeSwap" id="dyeSwapNo" value="no" checked="checked"  onchange="checkRefSampleLogic();"/></td>
     250        <td class="noBorder"><input type="radio" name="dyeSwap" id="dyeSwapNo" value="no" onchange="checkRefSampleLogic();"/></td>
    251251        <td class="noBorder">no</td>
    252252      </tr>
  • branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/mappings.jsp

    r552 r558  
    327327          for (int j = 0; j < products[k].length; j++)
    328328          {
    329             combi += products[k][j] + " ";
     329            combi += products[k][j];
     330            //add a comma to separate the factor values but do not add one after the last value
     331            if(!( j == (products[k].length -1)))
     332            {
     333              combi += ",";
     334            }
    330335          }
    331336      %>
  • branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/submit.jsp

    r552 r558  
    159159<input type="hidden"name="parameter:tissueList" value="<%=inputDataBean.getTissueList()%>" />
    160160<input type="hidden"name="parameter:dyeList" value="<%=inputDataBean.getDyeList()%>"/>
    161 <input type="hidden"name="parameter:combinationList" value=""/>
     161<input type="hidden"name="parameter:combinationList" value="<%=inputDataBean.getCombinationList()%>"/>
    162162<input type="hidden"name="parameter:useWizard" value="<%=inputDataBean.getUseWizard()%>" />
    163 <input type="hidden"name="parameter:legacyData" value="<%=inputDataBean.getLegacyData()%>" />
     163
     164<!-- hard code this parameter for now because we are currently not supporting autogenerate for non-legacy data yet -->
     165<input type="hidden"name="parameter:legacyData" value="yes" />
     166
    164167<input type="hidden"name="parameter:mappingsMode" value="<%=inputDataBean.getMappingsMode()%>" />
    165168<input type="hidden"name="parameter:spreadSheetMappings" value="<%= inputDataBean.getSpreadSheetMappings()%>"/>
  • branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/DataBean.java

    r552 r558  
    545545    this.poolingProtocolParams = poolingProtocolParams;
    546546  }
     547
     548  public String getCombinationList()
     549  {
     550    return combinationList;
     551  }
     552
     553  public void setCombinationList(String combinationList)
     554  {
     555    this.combinationList = combinationList;
     556  }
    547557 
    548558 
  • branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/HybridizationEntry.java

    r552 r558  
    9999    "P-SCAN-1" + "\t";
    100100
     101    //System.out.println("combinations[0].length = "+ combinations[0].length);
     102    //System.out.println("combinations.length = " + combinations.length);
    101103    //now print all the factor values
    102104    // FactorValue[Treatment Type]
    103105    for(int factorNumber=0; factorNumber< combinations[0].length; factorNumber++)
    104106    {
     107      //System.out.println("count = " + count);
     108      //System.out.println("factorNumber = "+ factorNumber);
    105109      row +=combinations[count][factorNumber]+ "\t";
    106110    }
  • branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/Tab2MageImporter.java

    r552 r558  
    516516      // get raw data files
    517517      List<File> rawDataFiles= Tab2MageHelper.getRawDataFiles(dir, dc, rdt.getId(), tab2MageFileName);
     518      //use the first data file found to check the data type and find a suitable plugin config
     519      //all the data files must be the same type
     520      File exampleFile = rawDataFiles.get(0);
    518521
    519522      // do data import
    520523      Tab2MageDataImportFactory dataImport = new Tab2MageDataImportFactory(sc,rdt.getId(),rawDataFiles,
    521524              hibernateItemsWriter.getRbas(), progress);
    522       boolean writtenRawData = dataImport.importData();
     525      boolean writtenRawData = dataImport.importData(exampleFile);
    523526      if (!writtenRawData)
    524527      {
     
    538541      // -- end of experiment configuration and loading module
    539542
    540 
    541       //dc.commit();
    542543      response.setDone("Import plugin ended successfully");
    543544    }
  • branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/Tab2MageWriter.java

    r552 r558  
    235235      for (int i = 0; i < allCombis.length; i++)
    236236      {
    237         String [] combi = allCombis[i].split(" ");
     237        String [] combi = allCombis[i].split(",");
    238238        combinations[i] = combi;
    239239      }
  • branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/Tab2MageWriterTest.java

    r552 r558  
    1616  {
    1717    //org.junit.runner.JUnitCore.main("uk.ac.ebi.nugo.plugins.Tab2MageWriterTest");
    18     test0();
     18    //test0();
    1919    //test1();
    2020    //test2();
    21     //test3();
     21    test3();
    2222  }
    2323
     
    9393
    9494  //affy simple design, 1 factor, 6 files only
    95   //auto generate required
    9695  public static void test2()
    9796  {
     
    113112
    114113    System.out.println("======================START TEST2============================");
    115     writer.legacyData = "no";
     114    writer.legacyData = "yes";
    116115    writer.platform = "Affymetrix";
    117     writer.organism = "Solanum tuberosum";
     116    writer.organism = "Mus musculus";
    118117    writer.accession = "E-MEXP-939";
    119118    writer.numDesigns = "1";
     
    123122    writer.expFactors = "Genotype(wild type,PGC-1 beta transgenic)\n";
    124123    writer.numReplicates = "3";
    125     writer.tissues = "skeletal_muscle";
     124    writer.tissueList = "skeletal_muscle\tskeletal_muscle\tskeletal_muscle\tskeletal_muscle\tskeletal_muscle\tskeletal_muscle";
     125    writer.fileList = "E-MEXP-939-raw-cel-1353140153.cel\tE-MEXP-939-raw-cel-1353140189.cel\tE-MEXP-939-raw-cel-1353140261.cel\tE-MEXP-939-raw-cel-1353140117.cel\tE-MEXP-939-raw-cel-1353140081.cel\tE-MEXP-939-raw-cel-1353140225.cel\t";
     126    writer.combinationList = "wild_type\tPGC-1 beta transgenic\twild_type\tPGC-1 beta transgenic\twild_type\tPGC-1 beta transgenic\t";
     127    writer.dyeList = "biotin\tbiotin\tbiotin\tbiotin\tbiotin\tbiotin";
     128    writer.subjectList = "wt3\ttg-1\ttg-3\twt2\twt1\ttg-2\t";
    126129    writer.pooling = "no";
     130    writer.mappingsMode = "manualSelect";
    127131
    128132    String hybSection = writer.makeHybridizationsSection();
     
    153157
    154158    System.out.println("======================START TEST3============================");
    155     writer.legacyData = "no";
     159
    156160    writer.platform = "Agilent";
    157161    writer.organism = "Home sapiens";
    158162    writer.accession = "CacoVitE Inserm";
     163   
     164    writer.legacyData = "yes"; 
     165    writer.mappingsMode = "manualSelect";
     166   
    159167    writer.numDesigns = "1";
     168    writer.numReplicates = "2";
     169    writer.numTreatmentGroups = "4";
     170   
    160171    writer.dyeSwap = "yes";
    161172    writer.refSample = "no";
    162     writer.numTreatmentGroups = "4";
    163     writer.expFactors = "Dose(90microM,physiological concentration)\nCompound(alpha-tocopherol,gamma-tocopheral)";
    164     writer.numReplicates = "2";
    165     writer.tissues = "enterocyte_cell_culture";
    166173    writer.pooling = "no";
     174
     175   
     176    writer.expFactors = "Compound(alpha-tocopherol,gamma-tocopheral)\nDose(90microM,physiological concentration)\n";
     177
     178    writer.tissueList = "enterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\t";
     179    writer.fileList = "US22502631_251485012409_S01_GE2-v5_91_0806_1_2.txt\tUS22502631_251485012409_S01_GE2-v5_91_0806_1_2.txt\tUS22502631_251485012409_S01_GE2-v5_91_0806_1_3.txt\tUS22502631_251485012409_S01_GE2-v5_91_0806_1_3.txt\tUS22502631_251485012409_S01_GE2-v5_91_0806_1_4.txt\tUS22502631_251485012409_S01_GE2-v5_91_0806_1_4.txt\tUS22502631_251485012407_S01_GE2-v5_91_0806_1_1.txt\tUS22502631_251485012407_S01_GE2-v5_91_0806_1_1.txt\tUS22502631_251485012408_S01_GE2-v5_91_0806_1_2.txt\tUS22502631_251485012408_S01_GE2-v5_91_0806_1_2.txt\tUS22502631_251485012408_S01_GE2-v5_91_0806_1_1.txt\tUS22502631_251485012408_S01_GE2-v5_91_0806_1_1.txt\tUS22502631_251485012408_S01_GE2-v5_91_0806_1_4.txt\tUS22502631_251485012408_S01_GE2-v5_91_0806_1_4.txt\tUS22502631_251485012408_S01_GE2-v5_91_0806_1_3.txt\tUS22502631_251485012408_S01_GE2-v5_91_0806_1_3.txt\t";
     180    writer.combinationList = "micelle control,physiological concentration\tmicelle alpha tocopherol,90µM\tmicelle control,physiological concentration\tmicelle alpha tocopherol,90µM\tmicelle control,physiological concentration\tmicelle gamma tocopherol,90µM\tmicelle control,physiological concentration\tmicelle gamma tocopherol,90µM\tmicelle control,physiological concentration\tmicelle alpha tocopherol,90µM\tmicelle control,physiological concentration\tmicelle alpha tocopherol,90µM\tmicelle control,physiological concentration\tmicelle gamma tocopherol,90µM\tmicelle control,physiological concentration\tmicelle gamma tocopherol,90µM\t";
     181    writer.dyeList ="Cy3\tCy5\tCy5\tCy3\tCy3\tCy5\tCy5\tCy3\tCy3\tCy5\tCy5\tCy3\tCy3\tCy5\tCy5\tCy3\t";
     182    writer.subjectList = "culture1\tculture2\tculture1\tculture2\tculture3\tculture4\tculture3\tculture4\tculture5\tculture6\tculture5\tculture6\tculture7\tculture8\tculture7\tculture8\t";
     183   
    167184
    168185    String hybSection = writer.makeHybridizationsSection();
  • branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/io/Tab2MageDataImportFactory.java

    r519 r558  
    11/*
    2   This file is for NutriBASE - Nutrigenomics BioArray Software Environment.
    3   A customisation of the BASE SOFTWARE.
    4   Developed at the EBI,  MicroArray Informatics Team, Cambridge.
    5   Author: Dominic Oyeniran: oad74@yahoo.com
     2 This file is for NutriBASE - Nutrigenomics BioArray Software Environment.
     3 A customisation of the BASE SOFTWARE.
     4 Developed at the EBI,  MicroArray Informatics Team, Cambridge.
     5 Author: Dominic Oyeniran: oad74@yahoo.com
    66 */
    77package uk.ac.ebi.nugo.plugins.tab2mageimport.io;
     
    2525import uk.ac.ebi.nugo.plugins.tab2mageimport.ExperimentPlatformsLibrary;
    2626import uk.ac.ebi.nugo.plugins.util.tab2mage.PluginConfigDetector;
     27
    2728/**
    28   The class import raw data file into the database. Handles both 1 and multi-channel raw data types.
    29   This should use one single db control which could be rolled back if import of data fails. Another db control is required for
    30   hibernate objects which would be created first <code>Tab2MageWriterFactory</code>
    31     @author Dominic Oyeniran
    32   @email oyeniran@ebi.ac.uk
    33   @version 1.0
    34   @see Tab2MageWriterFactory
    35   @see RawDataImport
     29 * The class import raw data file into the database. Handles both 1 and multi-channel raw data types. This should use one single db control which could be rolled back if import of data fails. Another
     30 * db control is required for hibernate objects which would be created first <code>Tab2MageWriterFactory</code>
     31 *
     32 * @author Dominic Oyeniran
     33 * @email oyeniran@ebi.ac.uk
     34 * @version 1.0
     35 * @see Tab2MageWriterFactory
     36 * @see RawDataImport
    3637 */
    37 public class Tab2MageDataImportFactory 
     38public class Tab2MageDataImportFactory
    3839{
    3940  /**
    40     the logger
    41    */
    42   protected static Logger log= Logger.getLogger(Tab2MageDataImportFactory.class);
    43   /**
    44     the database control
    45    */
    46   //private DbControl dc;
    47   /**
    48     the experiment platform
     41   * the logger
     42   */
     43  protected static Logger log = Logger.getLogger(Tab2MageDataImportFactory.class);
     44  /**
     45   * the database control
     46   */
     47  // private DbControl dc;
     48  /**
     49   * the experiment platform
    4950   */
    5051  private String platform;
    5152  /**
    52     the raw data files
     53   * the raw data files
    5354   */
    5455  private List<File> files = new ArrayList<File>();
    5556  /**
    56     the raw bio assays
    57    */
    58   private List<RawBioAssay> rawBioAssays= new ArrayList<RawBioAssay>();
    59  
    60   /**
    61     the session control object
     57   * the raw bio assays
     58   */
     59  private List<RawBioAssay> rawBioAssays = new ArrayList<RawBioAssay>();
     60
     61  /**
     62   * the session control object
    6263   */
    6364  private SessionControl sc;
    6465  /**
    65     the detected import configuration
     66   * the detected import configuration
    6667   */
    6768  PluginConfiguration importConfig = null;
    6869  /**
    69     progress reporter
    70    */
    71   ProgressReporter progress=null;
    72   /**
    73     A multi-channel file thats checked if file its importable
    74    */
    75   File file =null;
    76  
    77   /**
    78     creates  a new raw data import
    79     @param sc, session control
    80     @param platform, the experiment platform
    81     @param rawDataFiles, raw data file
    82     @param rbas, list of raw bio assays  to create.
    83    */
    84   public Tab2MageDataImportFactory(SessionControl sc, String platform, List<File> rawDataFiles,
    85                 List<RawBioAssay> rbas, ProgressReporter progress)
     70   * progress reporter
     71   */
     72  ProgressReporter progress = null;
     73  /**
     74   * A multi-channel file thats checked if file its importable
     75   */
     76  File file = null;
     77
     78  /**
     79   * creates a new raw data import
     80   *
     81   * @param sc,
     82   *                session control
     83   * @param platform,
     84   *                the experiment platform
     85   * @param rawDataFiles,
     86   *                raw data file
     87   * @param rbas,
     88   *                list of raw bio assays to create.
     89   */
     90  public Tab2MageDataImportFactory(SessionControl sc, String platform, List<File> rawDataFiles,
     91          List<RawBioAssay> rbas, ProgressReporter progress)
    8692  {
    8793    this.platform = platform;
    88     if (rawDataFiles!=null) this.files =rawDataFiles;
    89     if (rbas!=null) rawBioAssays= rbas;
    90     this.sc= sc;
    91     this.progress= progress;
    92   }
    93  
    94  
    95   /**
    96     check the raw data file that it matches the platform
    97     @throws NutribasePluginException
    98    */
    99   public void checkFiles() throws NutribasePluginException
    100   {
    101     if (files.isEmpty() || files==null)
    102       return;
    103     for(File file : files)
    104     {
    105       String ext= Helper.getFileExtension(file);
    106       // check if the file actually contain the extension we approved.
    107       if (! ExperimentPlatformsLibrary.fromExtension(ext).getPlatformName().equalsIgnoreCase(platform))
    108         throw new NutribasePluginException("data file [" + file.getName() + "] do not match platform ["+ platform + "] specified");
    109       this.file =file;
    110     }
    111     log.debug("++Raw Data File already set is : "+ file.getName());
    112   }
    113  
    114   /**
    115     do raw data import.
    116     supports both affymetrix, genepix and  agilent
    117       @return true if successful and false otherwise
    118    */
    119   public boolean importData()
     94    if (rawDataFiles != null)
     95      this.files = rawDataFiles;
     96    if (rbas != null)
     97      rawBioAssays = rbas;
     98    this.sc = sc;
     99    this.progress = progress;
     100  }
     101
     102  /**
     103   * check the raw data file that it matches the platform
     104   *
     105   * @throws NutribasePluginException
     106   */
     107  public void checkFile(File file) throws NutribasePluginException
     108  {
     109    String ext = Helper.getFileExtension(file);
     110    // check if the file actually contains the extension we approved.
     111    if (!ExperimentPlatformsLibrary.fromExtension(ext).getPlatformName().equalsIgnoreCase(platform))
     112      throw new NutribasePluginException("data file [" + file.getName() + "] do not match platform [" + platform + "] specified");
     113    this.file = file;
     114  }
     115
     116  /**
     117   * do raw data import
     118   *
     119   * @return true if successful and false otherwise
     120   */
     121  public boolean importData(File exampleFile) throws Exception
    120122  {
    121123    log.info("\n+++ Begin Data Import +++\n");
    122     DbControl dc =null;
    123     boolean success= true;
     124    DbControl dc = null;
     125    boolean success = true;
    124126    try
    125     {   // 1. import affy
     127    { // 1. import affy
    126128      // validate the raw data file to ensure it is the right platform again
    127       //  :) extra validation is good for all
    128       checkFiles();
     129      // :) extra validation is good for all
     130      checkFile(exampleFile);
    129131      log.debug("file check is successful");
    130132      if (platform.equalsIgnoreCase("affymetrix"))
    131133      {
    132         if (dc ==null)
     134        if (dc == null)
    133135          dc = sc.newDbControl();
    134136        log.debug("adding cel files to raw bioassays");
    135             for (RawBioAssay rbas  :rawBioAssays )
    136             {
    137               RawBioAssay rba = RawBioAssay.getById(dc,rbas.getId());
    138                 // get the file using file name. the file name is the raw bio assay name
    139               File file = getFile(rba.getName(),dc);
    140               if (file!=null)
    141               {
    142                log.info("The file is: " + file.getName() );
    143                // need to attach the cel file to the bioassay object
    144                Affymetrix.setCelFile(rba, file);
    145               }
    146             }
    147             dc.commit();
     137        for (RawBioAssay rbas : rawBioAssays)
     138        {
     139          RawBioAssay rba = RawBioAssay.getById(dc, rbas.getId());
     140          // get the file using file name. the file name is the raw bio assay name
     141          File file = getFile(rba.getName(), dc);
     142          if (file != null)
     143          {
     144            log.info("The file is: " + file.getName());
     145            // need to attach the cel file to the bioassay object
     146            Affymetrix.setCelFile(rba, file);
     147          }
     148        }
     149        dc.commit();
    148150      }
    149151      else if (!platform.equalsIgnoreCase("affymetrix"))// 2. import 2-channel -- include checkpoints and rollback points
    150152      {
    151         log.info(".......beginning ["+platform + "] data loading");
    152         //if (dc ==null)
    153         //  dc = sc.newDbControl();
    154         PluginConfigDetector detector = new PluginConfigDetector(sc,DetectablePluginTypes.RAWDATA);
    155           importConfig = detector.detectPluginConfig(file);
    156           if (importConfig==null)
    157           {
     153        log.info(".......beginning [" + platform + "] data loading");
     154        checkFile(exampleFile);
     155        PluginConfigDetector detector = new PluginConfigDetector(sc, DetectablePluginTypes.RAWDATA);
     156        importConfig = detector.detectPluginConfig(exampleFile);
     157        if (importConfig == null)
     158        {
    158159          log.error("No suitable plugin configuration found for this plugin in the BASE. If plugin configuration exists, check that it has been shared to you");
    159           return success=false;
    160           }
    161           System.out.println("Using import configuration: "+ importConfig.getName());
    162           RawDataImport rawDataImport = new RawDataImport(sc, importConfig, progress, files, rawBioAssays);
    163         boolean writtenRawData = rawDataImport.importRawData(); 
     160          return success = false;
     161        }
     162        System.out.println("Using import configuration: " + importConfig.getName());
     163        RawDataImport rawDataImport = new RawDataImport(sc, importConfig, progress, files, rawBioAssays);
     164        boolean writtenRawData = rawDataImport.importRawData();
    164165        if (!writtenRawData)
    165166          return success = false;
    166        
    167         //dc.commit();
    168167      }
    169      
    170     }
    171     catch(Throwable t)
     168
     169    }
     170    catch (Throwable t)
    172171    {
    173       success= false;
    174       log.error("DataImport: writing raw data failed", t);
    175       dc.close();
     172      success = false;
     173      System.out.println("DataImport: writing raw data failed");
     174      throw new Exception(t);
    176175    }
    177176    finally
    178177    {
    179       if (dc!=null)
     178      if (dc != null)
    180179        dc.close();
    181       if (file!=null)
    182         file=null;
     180      if (file != null)
     181        file = null;
    183182    }
    184183    return success;
    185184  }
    186    
    187    /**
    188     gets a raw data file for the list given its file name.
    189       @param fileName, the name of the file
    190     @return File
    191     */
     185
     186  /**
     187   * gets a raw data file for the list given its file name.
     188   *
     189   * @param fileName,
     190   *                the name of the file
     191   * @return File
     192   */
    192193  private File getFile(String fileName, DbControl dc)
    193194  {
    194     File foundFile =null;
     195    File foundFile = null;
    195196    if (!files.isEmpty())
    196197    {
     
    200201        if (file.getName().equalsIgnoreCase(fileName))
    201202        {
    202             foundFile = file;
    203           }
     203          foundFile = file;
     204        }
    204205      }
    205206    }
    206207    return foundFile;
    207208  }
    208  
    209   public List<File> getFiles() 
     209
     210  public List<File> getFiles()
    210211  {
    211212    return files;
    212213  }
    213214
    214   public String getPlatform() 
     215  public String getPlatform()
    215216  {
    216217    return platform;
    217218  }
    218219
    219   public void setFile(File file) 
     220  public void setFile(File file)
    220221  {
    221222    this.file = file;
  • branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/util/tab2mage/PluginConfigDetector.java

    r476 r558  
    8585    public PluginConfiguration detectPluginConfig(File exampleFile) throws Exception
    8686    {   
    87       log.info("auto-detecting PluginConfiguration");
     87      System.out.println("auto-detecting PluginConfiguration");
     88      System.out.println("example file for config detect = " + exampleFile);
    8889 
    8990      DbControl dc = sc.newDbControl();
     
    9798          {
    9899            //  get the plugin definition for net.sf.basedb.plugins.RawDataFlatFileImporter
    99             log.info("getting  raw data configuration");
     100            System.out.println("getting  raw data configuration");
    100101                plugin = PluginDefinition.getByClassName(dc, "net.sf.basedb.plugins.RawDataFlatFileImporter");
    101102          }
     
    104105            // get the plugin definition for nugo.plugin.CvAnnotationTypeImporter
    105106            // plugin must be shared to everyone by the administrator
    106             log.info("getting  annotation type and cv configuration");
     107            System.out.println("getting  annotation type and cv configuration");
    107108            plugin = PluginDefinition.getByClassName(dc, "uk.ac.ebi.nugo.plugins.AnnotationTypeCvImporter");
    108109          }
     
    116117        List<PluginConfiguration> configList = getConfigs(plugin,dc,exampleFile);
    117118       
    118        log.info("size of the returned config list is: "+ configList.size());
     119       System.out.println("size of the returned config list is: "+ configList.size());
    119120        //the configList object will contain the PluginConfigurations we are after
    120121        //just use the first one available
     
    174175              {
    175176                configs.add(config);
    176                 log.info("Found plugin configuration : "+config.getName());
     177                System.out.println("Found plugin configuration : "+config.getName());
    177178              }
    178179            }
     
    185186              {
    186187                configs.add(config);
    187                 log.info("Found plugin configuration : "+config.getName());
     188                System.out.println("Found plugin configuration : "+config.getName());
    188189              }
    189190            } 
  • branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/util/tab2mage/Tab2MageHelper.java

    r476 r558  
    5151         return validPlatform;
    5252       ItemResultList<File> fileList = fileQuery.list(dc);
    53        //System.out.println("The number of files in Dir : " + directory.getPath()+ " is : " +fileList.size());
     53       System.out.println("The number of files in Dir : " + directory.getPath()+ " is : " +fileList.size());
    5454       String agilent= ExperimentPlatformsLibrary.TXT.getPlatformName();
    5555       for (File file: fileList)
Note: See TracChangeset for help on using the changeset viewer.