Changeset 519
- Timestamp:
- Dec 13, 2007, 3:41:15 PM (15 years ago)
- Location:
- branches/uk_ac_ebi_Tab2MageImporter
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/experiment.jsp
r513 r519 4 4 <%@ page import="java.util.*"%> 5 5 6 <jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope=" session"/>6 <jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope="application"/> 7 7 <!-- submits the form data back to the bean assuming that each form element is matched to a variable in the bean by the same name --> 8 8 <jsp:setProperty name="inputDataBean" property="*"/> -
branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/hybridizations.jsp
r518 r519 4 4 <%@ page import="java.util.*"%> 5 5 6 <jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope=" session" />6 <jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope="application" /> 7 7 <!-- submits the form data back to the bean assuming that each form element is matched to a variable in the bean by the same name --> 8 8 <jsp:setProperty name="inputDataBean" property="*" /> -
branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/protocols.jsp
r512 r519 5 5 <%@ page import="java.lang.*"%> 6 6 7 <jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope=" session" />7 <jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope="application" /> 8 8 <!-- submits the form data back to the bean assuming that each form element is matched to a variable in the bean by the same name --> 9 9 <jsp:setProperty name="inputDataBean" property="*" /> -
branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/Tab2MageImporter.java
r518 r519 382 382 // save the new subDir 383 383 dc.saveItem(subDir); 384 dc.commit();385 384 386 385 if(dc==null) … … 399 398 RawDataType rdt= experiment.getRawDataType(); // experiment platform 400 399 401 //write a log file in the same directory where the files were unzipped 402 // String statusFilePath = subDir.getPath().toString()+"/importerLog.txt"; 403 // System.out.println("statusFile path = "+ statusFilePath); 404 // File statusFile=Helper.processFilePath(user,true, sc,statusFilePath); 405 // statusFile = File.getById(dc, statusFile.getId()); 406 // System.out.println("statusFile = " +statusFile); 407 408 409 /////////////////////////////////////////////////////////////////////////////////////////////////// 410 411 //now write the tab2mage file to the user's home dir on the server so it can be consumed by the plugin 412 //this takes all the inputs provided by the user on the custom interface (input.jsp) 413 //give the file a unique name so we don't get any conflicts 414 Tab2MageWriter t2mWriter = new Tab2MageWriter(job, subDir,sc,paramNames); 415 t2mWriter.writeTab2MageFile(); 416 File statusFile = t2mWriter.makeStatusFile(); 417 System.out.println("statusFile = " +statusFile.getPath()); 418 419 ///////////////////////////////////////////////////////////////////////////////////////////////// 420 400 // String statusp=(String)job.getValue("statusPath"); 401 // File statusFile=Helper.processFilePath(user,overwrite, sc,statusp); 421 402 422 403 //FILE UNZIP MODULE: unzip the files into user specified directory … … 433 414 434 415 // -- end of file unzip module 416 417 /////////////////////////////////////////////////////////////////////////////////////////////////// 418 419 //now write the tab2mage file to the user's home dir on the server so it can be consumed by the plugin 420 //this takes all the inputs provided by the user on the custom interface (input.jsp) 421 //give the file a unique name so we don't get any conflicts 422 Tab2MageWriter t2mWriter = new Tab2MageWriter(job, dir,sc,paramNames); 423 t2mWriter.writeTab2MageFile(); 424 t2mWriter.writeStatusFile(); 425 File statusFile = File.getByPath(dc, new Path(dir.getPath()+"/statusReport.txt",Path.Type.FILE ), false); 426 System.out.println("statusFile = "+ statusFile.getPath()); 427 ///////////////////////////////////////////////////////////////////////////////////////////////// 428 429 435 430 436 431 //VALIDATION MODULE … … 467 462 return; 468 463 } 469 470 464 471 465 Map<ValidationConstants, Boolean> validations= validator.validateTab2MageFile(); 472 466 StringBuffer failureMessage = new StringBuffer(); … … 561 555 boolean writtenExp= expWriter.LoadExperiment(); 562 556 // -- end of experiment configuration and loading module 563 564 557 558 565 559 dc.commit(); 566 560 response.setDone("Import plugin ended successfully"); -
branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/Tab2MageWriter.java
r518 r519 8 8 import net.sf.basedb.core.DbControl; 9 9 import net.sf.basedb.core.Directory; 10 import net.sf.basedb.core.File;11 10 import net.sf.basedb.core.SessionControl; 12 11 import net.sf.basedb.core.plugin.ParameterValues; … … 77 76 public Tab2MageWriter() 78 77 { 79 } 80 81 78 initTestParamValues(); 79 } 82 80 83 81 // ===================================================methods================================================ … … 88 86 try 89 87 { 90 Tab2MageWriter writer = new Tab2MageWriter(); 91 92 Class cls = writer.getClass(); 93 //Class cls = Class.forName("uk.ac.ebi.nugo.plugins.Tab2MageWriter"); 94 88 Class cls = Class.forName("uk.ac.ebi.nugo.plugins.Tab2MageWriter"); 95 89 for (int i = 0; i < paramNames.length; i++) 96 90 { … … 98 92 field.set(this, job.getValue(paramNames[i])); 99 93 } 100 101 //chop off any potential commas at the end of the experimentalDesign String 102 //these arise because we string together values form multiple inputs in the web forms 103 if(experimentalDesign.endsWith(",")) 104 { 105 experimentalDesign = experimentalDesign.substring(0, experimentalDesign.length()-2); 106 } 107 } 94 } 108 95 catch (Exception e) 109 96 { … … 163 150 { "P-DIET-1", "P-EXTR-1", "P-LABL-1", "P-HYBR-1", "P-SCAN-1" }; 164 151 String[] names = new String[] 165 { " Treatment", "Extraction", "Labeling", "Hybridization", "Scanning" };152 { "treatment", "extraction", "labeling", "hybridization", "scanning" }; 166 153 String[] values = new String[] 167 154 { treatmentProtocol, extractionProtocol, labelingProtocol, hybridizationProtocol, scanningProtocol }; … … 170 157 hybridizationProtocolParams, scanningProtocolParams }; 171 158 String[] types = new String[] 172 { " Sampling", "Extraction", "Labeling", "Hybridization", "Scanning" };159 { "grow", "extraction", "labeling", "hybridization", "scanning" }; 173 160 174 161 // print header … … 193 180 194 181 // print column headers for the section 195 String [] colHeaders = new String [] {"File[raw]"," Array[accession]"," BioSource"," BioMaterialCharacteristics[Organism]"," BioMaterialCharacteristics[OrganismPart]"," BioMaterialCharacteristics[CellType]"," Sample"," Protocol[Sampling]"," Extract"," Protocol[Extraction]"," LabeledExtract"," Protocol[Labeling]"," Dye"," Hybridization"," Protocol[Hybridization]"," Scan"," Protocol[Scanning]","FactorValue[Treatment Type]"};182 String [] colHeaders = new String [] {"File[raw]","Array[accession]","BioSource","BioMaterialCharacteristics[Organism]","BioMaterialCharacteristics[OrganismPart]","BioMaterialCharacteristics[CellType]","Sample","Protocol[grow]","Extract","Protocol[extraction]","LabeledExtract","Protocol[labeling]","Dye","Hybridization","Protocol[hybridization]","Scan","Protocol[scanning]","FactorValue[Treatment Type]"}; 196 183 for (int i = 0; i < colHeaders.length; i++) 197 184 { … … 200 187 t2mContent += "\n"; 201 188 202 //the following is a direct translation of Philippe's Perl script code 189 190 // ////////////////////////////////////////////////////////////////////////////////////////////////////////// 191 192 203 193 int count = 1; 204 194 … … 222 212 223 213 // file count first 224 t2mContent += "file -" + count + ".gpr" + "\t" +214 t2mContent += "file" + count + ".gpr" + "\t" + 225 215 // accession no. i.e the array design 226 216 accession + "\t" + … … 264 254 265 255 // file count first 266 t2mContent += "file -" + count + ".gpr" + "\t" +256 t2mContent += "file" + count + ".gpr" + "\t" + 267 257 // accession no. i.e the array design 268 258 accession + "\t" + … … 290 280 "Cy5"+ "\t" + 291 281 // Hybridization 292 "h ybridization-" + count + "\t" +282 "h" + count + "\t" + 293 283 // Protocol[hybridization] 294 284 "P-HYBR-1" + "\t" + … … 306 296 } 307 297 } 308 } 298 } 299 300 301 // ////////////////////////////////////////////////////////////////////////////////////////////////////////// 302 309 303 } 310 304 … … 322 316 dc.saveItem(t2mFile); 323 317 318 if (dc == null) 319 dc = sc.newDbControl(); 320 324 321 Writer out = new BufferedWriter(new OutputStreamWriter(t2mFile.getUploadStream(false), "ISO-8859-1")); 325 322 … … 342 339 } 343 340 344 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 345 346 public File makeStatusFile() 347 {348 net.sf.basedb.core.File statusFile = null;341 342 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 343 344 public void writeStatusFile() 345 { 349 346 try 350 347 { 348 // set up a file writer 351 349 DbControl dc = sc.newDbControl(); 352 statusFile = net.sf.basedb.core.File.getNew(dc, dir); 353 statusFile.setName("importerLog.txt"); 354 dc.saveItem(statusFile); 350 net.sf.basedb.core.File t2mFile = net.sf.basedb.core.File.getNew(dc, dir); 351 System.out.println("dir for writing new tab2mage file = " + dir.getName()); 352 t2mFile.setName("statusReport.txt"); 353 dc.saveItem(t2mFile); 354 355 if (dc == null) 356 dc = sc.newDbControl(); 357 358 Writer out = new BufferedWriter(new OutputStreamWriter(t2mFile.getUploadStream(false), "ISO-8859-1")); 359 360 // write content to file 361 out.write("test String"); 362 363 // close writer 364 if (out != null) 365 out.close(); 366 355 367 dc.commit(); 356 368 if (dc != null) … … 361 373 e.printStackTrace(); 362 374 } 363 return statusFile; 364 } 365 366 375 } 367 376 368 377 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- … … 380 389 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 381 390 382 p ublicvoid initTestParamValues()391 private void initTestParamValues() 383 392 { 384 393 /* 385 * Philippe's hybs params for testing (rest is made up):386 *387 394 --org Homo_sapiens 388 395 --array Agilent1 … … 400 407 domain = "scri.ac.uk"; 401 408 accession = "Agilent1"; 402 qualityControl = "biological replicate ";403 experimentalDesign = " strain_or_line_design";409 qualityControl = "biological replicate,spike quality control"; 410 experimentalDesign = "cell_component_comparison_design,RNA_stability_design,family_history_design,"; 404 411 experimentName = "New experiment"; 405 412 description = "description goes here"; … … 430 437 431 438 //hybs 432 platform = " Genepix";433 organism = " Solanum tuberosum";439 platform = "Agilent"; 440 organism = "Homo_sapiens"; 434 441 numDesigns = "1"; 435 442 dyeSwap = "no"; 436 443 refSample = "yes"; 437 numTreatmentGroups = " 2";444 numTreatmentGroups = "6"; 438 445 expFactors = "compound(aspirin,ibuprofen);dose(none,medium,high) )"; 439 numReplicates = " 2";440 tissues = " stem";446 numReplicates = "4"; 447 tissues = "liver,heart,brain"; 441 448 pooling = "no"; 442 449 zipFile = "/home/michab/potato_small.zip"; -
branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/io/AnnotationTypesWriter.java
r417 r519 131 131 catch (Exception e) 132 132 { 133 if (dc!=null) 133 134 dc.close(); 134 135 return false; … … 136 137 finally 137 138 { 138 if ( !dc.isClosed())139 if (dc!=null && !dc.isClosed()) 139 140 dc.close(); 140 141 } -
branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/io/Tab2MageDataImportFactory.java
r417 r519 159 159 return success=false; 160 160 } 161 log.info("Using import configuration: "+ importConfig.getName());161 System.out.println("Using import configuration: "+ importConfig.getName()); 162 162 RawDataImport rawDataImport = new RawDataImport(sc, importConfig, progress, files, rawBioAssays); 163 163 boolean writtenRawData = rawDataImport.importRawData(); -
branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/validation/Tab2MageHybridizationValidation.java
r518 r519 182 182 */ 183 183 public static boolean validateHeader(ArrayList<String> header, Writer writer) 184 { 185 System.out.println("/////////////////////////////////////////////"); 186 System.out.println("hybs headers:"); 187 for (String string : header) 188 { 189 System.out.println(string); 190 } 191 System.out.println("/////////////////////////////////////////////"); 192 193 184 { 194 185 //[TODO] convert all headers to lowercase, to facilitate matching of hyb section header to Tab2mageConstants/Spec 195 186 //header= header2LowerCase(header); -
branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/validation/Tab2MageValidationFactory.java
r468 r519 314 314 List<File> gprFiles= Tab2MageHelper.getRawDataFiles(dir, dc, platform, filename); 315 315 GenePixFileValidation gprValidation= new GenePixFileValidation(gprFiles, dc); 316 if (!gprValidation.validate(statusOut))317 {318 log.error("Sorry the gpr files cannot be validated. Mandatory Columns are missing. Must be rectified to proceed. See the log file for more details");319 statusOut.write("Sorry the gpr files cannot be validated. Mandatory Columns are missing. Must be rectified to proceed.");320 doneGenepix =false;321 }316 // if (!gprValidation.validate(statusOut)) 317 // { 318 // log.error("Sorry the gpr files cannot be validated. Mandatory Columns are missing. Must be rectified to proceed. See the log file for more details"); 319 // statusOut.write("Sorry the gpr files cannot be validated. Mandatory Columns are missing. Must be rectified to proceed."); 320 // doneGenepix =false; 321 // } 322 322 GenePixValidation.validateRawFiles(hybs); 323 323 log.info("\n+++ Finished GenePix File validation +++\n");
Note: See TracChangeset
for help on using the changeset viewer.