Changeset 558
- Timestamp:
- Jan 28, 2008, 4:31:12 PM (15 years ago)
- Location:
- branches/uk_ac_ebi_Tab2MageImporter
- Files:
-
- 1 deleted
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/uk_ac_ebi_Tab2MageImporter/TODO.txt
r552 r558 10 10 - status report does not get written in all cases 11 11 - 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 12 17 13 18 … … 15 20 - 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) 16 21 - add support for users using their own name bases for samples and perhaps extracts 22 23 extension: support for BASE 2.5 + -
branches/uk_ac_ebi_Tab2MageImporter/build.xml
r515 r558 70 70 <target name="copyToServer" depends="build.plugin,copyJSPs"> 71 71 <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" /> 72 73 <!-- now restart tomcat to reload the application --> 73 74 <echo message="tomcat home = "/> -
branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/experiment.jsp
r552 r558 503 503 <td class="plainLabel" style="border-style: none;">Pubmed ID:</td> 504 504 <td class="input" style="border-style: none;"><input type="text" size="30" name="pubmedId" 505 value=" 505 value="" /></td> 506 506 <td style="border-style: none;"></td> 507 507 -
branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/hybridizations.jsp
r552 r558 158 158 <td class="input"> 159 159 <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> 162 162 <option onclick="showTwoChannelQuestions();">AIDA</option> 163 163 <option onclick="showTwoChannelQuestions();">BZScan</option> … … 178 178 <tr> 179 179 <td class="boldText">Experimental organism:<font color="red"><b> *</b></font></td> 180 <td class="input"><input type="text" size="50" name="organism" value="Ho rdeum vulgare"/></td>180 <td class="input"><input type="text" size="50" name="organism" value="Homo sapiens"/></td> 181 181 <td>The full scientific name of the experimental organism used.</td> 182 182 </tr> … … 194 194 <tr> 195 195 <td class="boldText">Number of treatment groups:<font color="red"><b> *</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> 197 197 <td>The number of discrete combinations of factor values, i.e. the product of the number of factor levels(values) from all factors. <p> 198 198 Example: an experiment with 2 factors and 3 factor values in each will have 6 treatment groups (2 X 3). … … 203 203 <tr> 204 204 <td class="boldText">Experimental factors:<font color="red"><b> *</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> 206 206 <td>Please list all experimental factors and value ranges using the following format (one per 207 207 line):<br> … … 217 217 <tr> 218 218 <td class="boldText">Number of subjects per group:<font color="red"><b> *</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> 220 220 <td>This is the number of biological replicates in each treatment group.</td> 221 221 </tr> … … 232 232 <tr> 233 233 <td class="boldText">Target tissues:<font color="red"><b> *</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> 235 235 <td>List all target tissues one per line, in no particular order (copy and paste from Excel works).</td> 236 236 </tr> … … 243 243 <table class="noBorder" cellpadding="4"> 244 244 <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> 246 246 <td class="noBorder">yes</td> 247 247 </tr> 248 248 249 249 <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> 251 251 <td class="noBorder">no</td> 252 252 </tr> -
branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/mappings.jsp
r552 r558 327 327 for (int j = 0; j < products[k].length; j++) 328 328 { 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 } 330 335 } 331 336 %> -
branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/submit.jsp
r552 r558 159 159 <input type="hidden"name="parameter:tissueList" value="<%=inputDataBean.getTissueList()%>" /> 160 160 <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()%>"/> 162 162 <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 164 167 <input type="hidden"name="parameter:mappingsMode" value="<%=inputDataBean.getMappingsMode()%>" /> 165 168 <input type="hidden"name="parameter:spreadSheetMappings" value="<%= inputDataBean.getSpreadSheetMappings()%>"/> -
branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/DataBean.java
r552 r558 545 545 this.poolingProtocolParams = poolingProtocolParams; 546 546 } 547 548 public String getCombinationList() 549 { 550 return combinationList; 551 } 552 553 public void setCombinationList(String combinationList) 554 { 555 this.combinationList = combinationList; 556 } 547 557 548 558 -
branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/HybridizationEntry.java
r552 r558 99 99 "P-SCAN-1" + "\t"; 100 100 101 //System.out.println("combinations[0].length = "+ combinations[0].length); 102 //System.out.println("combinations.length = " + combinations.length); 101 103 //now print all the factor values 102 104 // FactorValue[Treatment Type] 103 105 for(int factorNumber=0; factorNumber< combinations[0].length; factorNumber++) 104 106 { 107 //System.out.println("count = " + count); 108 //System.out.println("factorNumber = "+ factorNumber); 105 109 row +=combinations[count][factorNumber]+ "\t"; 106 110 } -
branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/Tab2MageImporter.java
r552 r558 516 516 // get raw data files 517 517 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); 518 521 519 522 // do data import 520 523 Tab2MageDataImportFactory dataImport = new Tab2MageDataImportFactory(sc,rdt.getId(),rawDataFiles, 521 524 hibernateItemsWriter.getRbas(), progress); 522 boolean writtenRawData = dataImport.importData( );525 boolean writtenRawData = dataImport.importData(exampleFile); 523 526 if (!writtenRawData) 524 527 { … … 538 541 // -- end of experiment configuration and loading module 539 542 540 541 //dc.commit();542 543 response.setDone("Import plugin ended successfully"); 543 544 } -
branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/Tab2MageWriter.java
r552 r558 235 235 for (int i = 0; i < allCombis.length; i++) 236 236 { 237 String [] combi = allCombis[i].split(" 237 String [] combi = allCombis[i].split(","); 238 238 combinations[i] = combi; 239 239 } -
branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/Tab2MageWriterTest.java
r552 r558 16 16 { 17 17 //org.junit.runner.JUnitCore.main("uk.ac.ebi.nugo.plugins.Tab2MageWriterTest"); 18 test0();18 //test0(); 19 19 //test1(); 20 20 //test2(); 21 //test3();21 test3(); 22 22 } 23 23 … … 93 93 94 94 //affy simple design, 1 factor, 6 files only 95 //auto generate required96 95 public static void test2() 97 96 { … … 113 112 114 113 System.out.println("======================START TEST2============================"); 115 writer.legacyData = " no";114 writer.legacyData = "yes"; 116 115 writer.platform = "Affymetrix"; 117 writer.organism = " Solanum tuberosum";116 writer.organism = "Mus musculus"; 118 117 writer.accession = "E-MEXP-939"; 119 118 writer.numDesigns = "1"; … … 123 122 writer.expFactors = "Genotype(wild type,PGC-1 beta transgenic)\n"; 124 123 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"; 126 129 writer.pooling = "no"; 130 writer.mappingsMode = "manualSelect"; 127 131 128 132 String hybSection = writer.makeHybridizationsSection(); … … 153 157 154 158 System.out.println("======================START TEST3============================"); 155 writer.legacyData = "no"; 159 156 160 writer.platform = "Agilent"; 157 161 writer.organism = "Home sapiens"; 158 162 writer.accession = "CacoVitE Inserm"; 163 164 writer.legacyData = "yes"; 165 writer.mappingsMode = "manualSelect"; 166 159 167 writer.numDesigns = "1"; 168 writer.numReplicates = "2"; 169 writer.numTreatmentGroups = "4"; 170 160 171 writer.dyeSwap = "yes"; 161 172 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";166 173 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 167 184 168 185 String hybSection = writer.makeHybridizationsSection(); -
branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/io/Tab2MageDataImportFactory.java
r519 r558 1 1 /* 2 3 4 5 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 6 6 */ 7 7 package uk.ac.ebi.nugo.plugins.tab2mageimport.io; … … 25 25 import uk.ac.ebi.nugo.plugins.tab2mageimport.ExperimentPlatformsLibrary; 26 26 import uk.ac.ebi.nugo.plugins.util.tab2mage.PluginConfigDetector; 27 27 28 /** 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 for30 hibernate objects which would be created first <code>Tab2MageWriterFactory</code>31 32 33 34 35 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 36 37 */ 37 public class Tab2MageDataImportFactory 38 public class Tab2MageDataImportFactory 38 39 { 39 40 /** 40 41 */ 42 protected static Logger log = Logger.getLogger(Tab2MageDataImportFactory.class);43 /** 44 45 */ 46 // private DbControl dc;47 /** 48 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 49 50 */ 50 51 private String platform; 51 52 /** 52 the raw data files53 * the raw data files 53 54 */ 54 55 private List<File> files = new ArrayList<File>(); 55 56 /** 56 57 */ 58 private List<RawBioAssay> rawBioAssays = new ArrayList<RawBioAssay>();59 60 /** 61 57 * the raw bio assays 58 */ 59 private List<RawBioAssay> rawBioAssays = new ArrayList<RawBioAssay>(); 60 61 /** 62 * the session control object 62 63 */ 63 64 private SessionControl sc; 64 65 /** 65 the detected import configuration66 * the detected import configuration 66 67 */ 67 68 PluginConfiguration importConfig = null; 68 69 /** 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) 86 92 { 87 93 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 120 122 { 121 123 log.info("\n+++ Begin Data Import +++\n"); 122 DbControl dc = null;123 boolean success = true;124 DbControl dc = null; 125 boolean success = true; 124 126 try 125 { 127 { // 1. import affy 126 128 // validate the raw data file to ensure it is the right platform again 127 // 128 checkFile s();129 // :) extra validation is good for all 130 checkFile(exampleFile); 129 131 log.debug("file check is successful"); 130 132 if (platform.equalsIgnoreCase("affymetrix")) 131 133 { 132 if (dc == null)134 if (dc == null) 133 135 dc = sc.newDbControl(); 134 136 log.debug("adding cel files to raw bioassays"); 135 for (RawBioAssay rbas :rawBioAssays)136 137 RawBioAssay rba = RawBioAssay.getById(dc,rbas.getId());138 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 object144 145 146 147 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(); 148 150 } 149 151 else if (!platform.equalsIgnoreCase("affymetrix"))// 2. import 2-channel -- include checkpoints and rollback points 150 152 { 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 { 158 159 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 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(); 164 165 if (!writtenRawData) 165 166 return success = false; 166 167 //dc.commit();168 167 } 169 170 } 171 catch (Throwable t)168 169 } 170 catch (Throwable t) 172 171 { 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); 176 175 } 177 176 finally 178 177 { 179 if (dc !=null)178 if (dc != null) 180 179 dc.close(); 181 if (file !=null)182 file =null;180 if (file != null) 181 file = null; 183 182 } 184 183 return success; 185 184 } 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 */ 192 193 private File getFile(String fileName, DbControl dc) 193 194 { 194 File foundFile = null;195 File foundFile = null; 195 196 if (!files.isEmpty()) 196 197 { … … 200 201 if (file.getName().equalsIgnoreCase(fileName)) 201 202 { 202 203 203 foundFile = file; 204 } 204 205 } 205 206 } 206 207 return foundFile; 207 208 } 208 209 public List<File> getFiles() 209 210 public List<File> getFiles() 210 211 { 211 212 return files; 212 213 } 213 214 214 public String getPlatform() 215 public String getPlatform() 215 216 { 216 217 return platform; 217 218 } 218 219 219 public void setFile(File file) 220 public void setFile(File file) 220 221 { 221 222 this.file = file; -
branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/util/tab2mage/PluginConfigDetector.java
r476 r558 85 85 public PluginConfiguration detectPluginConfig(File exampleFile) throws Exception 86 86 { 87 log.info("auto-detecting PluginConfiguration"); 87 System.out.println("auto-detecting PluginConfiguration"); 88 System.out.println("example file for config detect = " + exampleFile); 88 89 89 90 DbControl dc = sc.newDbControl(); … … 97 98 { 98 99 // 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"); 100 101 plugin = PluginDefinition.getByClassName(dc, "net.sf.basedb.plugins.RawDataFlatFileImporter"); 101 102 } … … 104 105 // get the plugin definition for nugo.plugin.CvAnnotationTypeImporter 105 106 // 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"); 107 108 plugin = PluginDefinition.getByClassName(dc, "uk.ac.ebi.nugo.plugins.AnnotationTypeCvImporter"); 108 109 } … … 116 117 List<PluginConfiguration> configList = getConfigs(plugin,dc,exampleFile); 117 118 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()); 119 120 //the configList object will contain the PluginConfigurations we are after 120 121 //just use the first one available … … 174 175 { 175 176 configs.add(config); 176 log.info("Found plugin configuration : "+config.getName());177 System.out.println("Found plugin configuration : "+config.getName()); 177 178 } 178 179 } … … 185 186 { 186 187 configs.add(config); 187 log.info("Found plugin configuration : "+config.getName());188 System.out.println("Found plugin configuration : "+config.getName()); 188 189 } 189 190 } -
branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/util/tab2mage/Tab2MageHelper.java
r476 r558 51 51 return validPlatform; 52 52 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()); 54 54 String agilent= ExperimentPlatformsLibrary.TXT.getPlatformName(); 55 55 for (File file: fileList)
Note: See TracChangeset
for help on using the changeset viewer.