Changeset 379
- Timestamp:
- Aug 8, 2007, 3:02:44 PM (16 years ago)
- Location:
- trunk/uk/ac/ebi/Tab2MageImporter
- Files:
-
- 5 added
- 2 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/uk/ac/ebi/Tab2MageImporter/README.txt
r373 r379 40 40 2. Create all the array design used in the experiment as the BASE administrator. Array Design must then be shared to everyone or a suitable group that all the target users belong. 41 41 3. Create tab2mage spreadsheet and zip it together with the raw data files that make up the experiment. Note: no cdf file. Upload this file to your account on BASE (go to View -> Files -> Upload File). Image files may be supplied by the user and contained in the zip file. 42 Note: The protocol section of your spreadsheet must have the protocol type specified. Please use the example files: tab2mage- agilent, tab2mage- genepix and tab2mage- affymetrix. You can use any of the file as your spreadsheet template. 42 43 4. To make sure you have all the required reporters and import configurations in place, import a single data file from the batch as a 43 44 test first. -
trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/Tab2MageImporter.java
r374 r379 47 47 import uk.ac.ebi.nugo.plugins.tab2mageimport.mail.Tab2MageEMessaging; 48 48 import uk.ac.ebi.nugo.plugins.tab2mageimport.validation.Tab2MageValidationFactory; 49 import uk.ac.ebi.nugo.plugins.util. Tab2MageHelper;49 import uk.ac.ebi.nugo.plugins.util.Helper; 50 50 import uk.ac.ebi.nugo.plugins.util.ZipUnpacker; 51 51 … … 205 205 Experiment exp = (Experiment)item; 206 206 RawDataType rawDataType = exp.getRawDataType(); 207 if (! Tab2MageHelper.supportedPlatforms(rawDataType.getId().toLowerCase()))207 if (!Helper.supportedPlatforms(rawDataType.getId().toLowerCase())) 208 208 { 209 209 message="This importer only supports Affymetrix, Agilent and Genepix Platforms. Your experiment's platform is :" + rawDataType.getId().toLowerCase(); … … 290 290 291 291 // validate files supplied to platform 292 validPlatform= Tab2MageHelper.validatePlatform(dir, dc, rdt);292 validPlatform=Helper.validatePlatform(dir, dc, rdt); 293 293 if (!validPlatform) 294 294 { … … 298 298 299 299 // validate image file 300 List<File> imageFiles= Tab2MageHelper.getImageFiles(dir, dc) ;300 List<File> imageFiles=Helper.getImageFiles(dir, dc) ; 301 301 if (!imageFiles.isEmpty()|| imageFiles==null) 302 302 { 303 validateImageFile= Tab2MageHelper.validateImages(imageFiles, rdt);303 validateImageFile= Helper.validateImages(imageFiles, rdt); 304 304 if (!validateImageFile) 305 305 { … … 364 364 365 365 // get raw data files 366 List<File> rawDataFiles= Tab2MageHelper.getRawDataFiles(dir, dc, rdt.getId(), tab2MageFileName);366 List<File> rawDataFiles= Helper.getRawDataFiles(dir, dc, rdt.getId(), tab2MageFileName); 367 367 368 368 // do data import -
trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/io/Base2Tab2MageFileReader.java
r374 r379 37 37 import uk.ac.ebi.nugo.plugins.util.ClassPreamble2; 38 38 import uk.ac.ebi.nugo.plugins.util.NutribasePluginException; 39 import uk.ac.ebi.nugo.plugins.util. Tab2MageHelper;39 import uk.ac.ebi.nugo.plugins.util.Helper; 40 40 41 41 import org.embl.cg.utilitytools.parser.csv.InvalidCSVSetUpException; … … 165 165 dc.saveItem(subDir); 166 166 } 167 Tab2MageHelper.write("The created sub directory is: "+ subDir.getPath());167 Helper.write("The created sub directory is: "+ subDir.getPath()); 168 168 createProtocolFile(); 169 169 createHybridizationFile(); … … 442 442 foundExprMandatoryFields.add(man.toString()); 443 443 testLine = input.substring(man.toString().length()+1); 444 Tab2MageHelper.write("header: " +man.toString()+ " = " +testLine);444 Helper.write("header: " +man.toString()+ " = " +testLine); 445 445 // sets the experiment object compulsory attributes : submitter, name and submitter email 446 446 experiment.add(man.toString(), testLine); … … 453 453 { 454 454 testLine = input.substring(opt.toString().length()+1); 455 Tab2MageHelper.write("header: " +opt.toString()+ " = " +testLine);455 Helper.write("header: " +opt.toString()+ " = " +testLine); 456 456 //sets the experiment object optional attributes : organisation, domain etc 457 457 experiment.add(opt.toString(), testLine); … … 493 493 } 494 494 // We can intialize the hyb row count here 495 Tab2MageHelper.write("NOTE: The number of TAB2MAGE Hyb rows i.e. lines length : "+ lines.length);495 Helper.write("NOTE: The number of TAB2MAGE Hyb rows i.e. lines length : "+ lines.length); 496 496 hybRowsCount = lines.length -1; 497 497 this.headers = lines[0].getRawcols(); … … 657 657 for(int j=0; j < headValues.size(); j++) 658 658 { // for every column of the cvs file 659 Tab2MageHelper.write("This protocol header value is : "+headValues.get(j).toString());659 Helper.write("This protocol header value is : "+headValues.get(j).toString()); 660 660 for(Object key : keys) 661 661 { // for every possible protocol column -
trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/io/Tab2MageDataImportFactory.java
r374 r379 24 24 import uk.ac.ebi.nugo.plugins.util.NutribasePluginException; 25 25 import uk.ac.ebi.nugo.plugins.util.PluginConfigDetector; 26 import uk.ac.ebi.nugo.plugins.util. Tab2MageHelper;26 import uk.ac.ebi.nugo.plugins.util.Helper; 27 27 /** 28 28 The class import raw data file into the database. Handles both 1 and multi-channel raw data types. … … 103 103 for(File file : files) 104 104 { 105 String ext= Tab2MageHelper.getFileExtension(file);105 String ext= Helper.getFileExtension(file); 106 106 // check if the file actually contain the extension we approved. 107 107 if (! ExperimentPlatformsLibrary.fromExtension(ext).getPlatformName().equalsIgnoreCase(platform)) -
trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/io/Tab2MageHybWriter.java
r374 r379 42 42 import org.embl.cg.bloader.models.Tab2MAGEHybridizationLine; 43 43 44 import uk.ac.ebi.nugo.plugins.util. Tab2MageHelper;44 import uk.ac.ebi.nugo.plugins.util.Helper; 45 45 /** 46 46 … … 176 176 //write Labeled Extract 177 177 String dye = hybLine.getDye(); 178 Label label = Tab2MageHelper.getLabel(dye, dc);178 Label label =Helper.getLabel(dye, dc); 179 179 LabeledExtract lextract= createLabeledExtract(hybLine.getLabeledExtract(), dye, label, extract, lExtracts, hybLine.getParameter(), protMap); 180 180 // add lextract to a list of labeled extracts … … 183 183 184 184 // get Array Design. This must have been created by the admin 185 String accession= Tab2MageHelper.findTab2MageAccessionOrSerial(hyb.getArrayInformation(), "accession");186 ArrayDesign arrayDesign = Tab2MageHelper.getArrayDesign(accession,dc);185 String accession=Helper.findTab2MageAccessionOrSerial(hyb.getArrayInformation(), "accession"); 186 ArrayDesign arrayDesign = Helper.getArrayDesign(accession,dc); 187 187 if (arrayDesign==null) 188 188 { … … 196 196 197 197 // Create Array Serial 198 String slide = Tab2MageHelper.findTab2MageAccessionOrSerial(hyb.getArrayInformation(), "serial");198 String slide =Helper.findTab2MageAccessionOrSerial(hyb.getArrayInformation(), "serial"); 199 199 ArraySlide arraySlide = getSlide(slide,ab, arrayDesign, i ); 200 200 … … 521 521 private ArraySlide getSlide (String slide, ArrayBatch ab, ArrayDesign arrayDesign, int i) 522 522 { 523 ArraySlide as = Tab2MageHelper.findArraySlide(dc, slide);523 ArraySlide as = Helper.findArraySlide(dc, slide); 524 524 if (as==null) // no matching array slide was found 525 525 { … … 540 540 { 541 541 String accession = arrayDesign.getName()+"-Batch#" + i; // accession is thename of the slide 542 ArrayBatch arrayBatch = Tab2MageHelper.findArrayBatch(dc, accession);542 ArrayBatch arrayBatch = Helper.findArrayBatch(dc, accession); 543 543 if (arrayBatch== null) 544 544 { … … 601 601 for (Map.Entry<String, String> an : annotationMap.entrySet()) 602 602 { 603 AnnotationType at = Tab2MageHelper.getAnnotationTypeByName(an.getKey(),dc);603 AnnotationType at =Helper.getAnnotationTypeByName(an.getKey(),dc); 604 604 if (at!=null) 605 605 { … … 654 654 for (Map.Entry<String, String> an : annotationMap.entrySet()) 655 655 { 656 AnnotationType at = Tab2MageHelper.getAnnotationTypeByName(an.getKey(),dc);656 AnnotationType at =Helper.getAnnotationTypeByName(an.getKey(),dc); 657 657 if (at!=null) 658 658 { -
trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/io/Tab2MageProtocolWriter.java
r374 r379 10 10 import org.embl.cg.bloader.models.Tab2MAGEProtocol; 11 11 12 import uk.ac.ebi.nugo.plugins.util. Tab2MageHelper;12 import uk.ac.ebi.nugo.plugins.util.Helper; 13 13 14 14 import net.sf.basedb.core.AnnotationType; … … 81 81 newProtocol.setDescription(protocol.getText()); 82 82 newProtocol.setProtocolType(protocolType); 83 List<String> result = Tab2MageHelper.getList(protocol.getParameters(),";");83 List<String> result =Helper.getList(protocol.getParameters(),";"); 84 84 for (String res : result) 85 85 { -
trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/io/Tab2MageWriterFactory.java
r374 r379 51 51 import uk.ac.ebi.nugo.plugins.tab2mageimport.validation.Tab2MageValidationFactory; 52 52 import uk.ac.ebi.nugo.plugins.util.NutribasePluginException; 53 import uk.ac.ebi.nugo.plugins.util. Tab2MageHelper;53 import uk.ac.ebi.nugo.plugins.util.Helper; 54 54 55 55 /** … … 144 144 try 145 145 { 146 Tab2MageHelper.write("WriterFactory: .... writing protocols and Hybridizations");146 Helper.write("WriterFactory: .... writing protocols and Hybridizations"); 147 147 //writeProtocol 148 148 Tab2MageProtocolWriter protocolWriter= new Tab2MageProtocolWriter(protocols); … … 199 199 if (dc == null || !dc.isConnected()|| dc.isClosed()) dc = sc.newDbControl(); 200 200 201 Tab2MageHelper.write("Entering the try loop");201 Helper.write("Entering the try loop"); 202 202 for (Map.Entry<String , List<String>> entry : sampleExtMap.entrySet()) 203 203 { 204 Tab2MageHelper.write("\n++ The sample extract from the SampleExractMap is : "+entry.getKey()+":"+ entry.getValue());204 Helper.write("\n++ The sample extract from the SampleExractMap is : "+entry.getKey()+":"+ entry.getValue()); 205 205 List<String> parents= entry.getValue(); 206 206 List<BasicItem> children = new ArrayList<BasicItem>(); 207 207 for (String parent : parents ) 208 208 { 209 Tab2MageHelper.write("++The current parent being checked is "+ parent);210 Sample p = Tab2MageHelper.findSample(dc, parent); // get the parent from the database209 Helper.write("++The current parent being checked is "+ parent); 210 Sample p = Helper.findSample(dc, parent); // get the parent from the database 211 211 ItemQuery<Extract> childrenQuery = p.getExtracts(); // get all the extracts ( children of parents -Sample) 212 212 childrenQuery.include(Include.MINE, Include.NOT_REMOVED); // include those children created by the loggedin user only … … 215 215 } 216 216 String childofParent = entry.getKey(); // in this example this is the extract 217 Tab2MageHelper.write("...The key from map is : " + childofParent );218 Extract e= Tab2MageHelper.findExtract(dc, childofParent);219 Tab2MageHelper.write("...the already created object fetched is : " + e.getName() );217 Helper.write("...The key from map is : " + childofParent ); 218 Extract e= Helper.findExtract(dc, childofParent); 219 Helper.write("...the already created object fetched is : " + e.getName() ); 220 220 dc.reattachItem(e); 221 221 e.setPooled(true); … … 256 256 for (Tab2MAGEProtocol protocol: protocols) 257 257 { 258 boolean foundType = Tab2MageHelper.checkIfProtocolTypesExist(protocol,localDc);258 boolean foundType =Helper.checkIfProtocolTypesExist(protocol,localDc); 259 259 if (!foundType) 260 260 { -
trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/validation/AgilentValidation.java
r374 r379 17 17 import uk.ac.ebi.nugo.plugins.tab2mageimport.AgilentDataColumns; 18 18 import uk.ac.ebi.nugo.plugins.tab2mageimport.io.parser.AgilentRDParser; 19 import uk.ac.ebi.nugo.plugins.util. Tab2MageHelper;19 import uk.ac.ebi.nugo.plugins.util.Helper; 20 20 21 21 /** … … 64 64 String [] headers= agParser.getHeaders(); 65 65 if (headers==null) continue; 66 List<String> headerList = Tab2MageHelper.arrayContentToLowercase(headers);66 List<String> headerList = Helper.arrayContentToLowercase(headers); 67 67 List<AgilentDataColumns> mandatoryColumns= Arrays.asList(AgilentDataColumns.values()); 68 68 for (AgilentDataColumns man :mandatoryColumns ) -
trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/validation/GenePixFileValidation.java
r374 r379 22 22 import uk.ac.ebi.nugo.plugins.tab2mageimport.GenePixDataColumns; 23 23 import uk.ac.ebi.nugo.plugins.tab2mageimport.io.parser.Base2GenePixRDParser; 24 import uk.ac.ebi.nugo.plugins.util. Tab2MageHelper;24 import uk.ac.ebi.nugo.plugins.util.Helper; 25 25 26 26 /** … … 71 71 Base2GenePixRDParser gParser= new Base2GenePixRDParser(gprFile, dc); 72 72 String [] headers= gParser.getHeaders(); 73 List<String> headerList = Tab2MageHelper.arrayContentToLowercase(headers);73 List<String> headerList = Helper.arrayContentToLowercase(headers); 74 74 List<GenePixDataColumns> mandatoryColumns= Arrays.asList(GenePixDataColumns.values()); 75 75 for (GenePixDataColumns man :mandatoryColumns ) -
trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/validation/Tab2MageImportValidatorUtils.java
r374 r379 30 30 import uk.ac.ebi.nugo.plugins.util.NutribasePluginException; 31 31 import uk.ac.ebi.nugo.plugins.util.Tab2MageConstants; 32 import uk.ac.ebi.nugo.plugins.util. Tab2MageHelper;32 import uk.ac.ebi.nugo.plugins.util.Helper; 33 33 34 34 /** -
trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/validation/Tab2MageValidationFactory.java
r374 r379 33 33 import uk.ac.ebi.nugo.plugins.tab2mageimport.io.Base2Tab2MageFileReader; 34 34 import uk.ac.ebi.nugo.plugins.util.NutribasePluginException; 35 import uk.ac.ebi.nugo.plugins.util. Tab2MageHelper;35 import uk.ac.ebi.nugo.plugins.util.Helper; 36 36 37 37 /** … … 260 260 { 261 261 log.info("Begin GenePix File validation"); 262 List<File> gprFiles= Tab2MageHelper.getRawDataFiles(dir, dc, platform, filename);262 List<File> gprFiles= Helper.getRawDataFiles(dir, dc, platform, filename); 263 263 GenePixFileValidation gprValidation= new GenePixFileValidation(gprFiles, dc); 264 264 if (!gprValidation.validate()) … … 279 279 // obtain and check if the headers is within the allowed range 280 280 log.info("Begin Agilent File validation"); 281 List<File> agFiles= Tab2MageHelper.getRawDataFiles(dir, dc, platform, filename);281 List<File> agFiles= Helper.getRawDataFiles(dir, dc, platform, filename); 282 282 AgilentValidation agValidation= new AgilentValidation(agFiles,dc); 283 283 if (!agValidation.validate())
Note: See TracChangeset
for help on using the changeset viewer.