Changeset 5765
- Timestamp:
- Sep 27, 2011, 3:38:36 PM (11 years ago)
- Location:
- trunk/src/test/net/sf/basedb/test
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/test/net/sf/basedb/test/PluginUtil.java
r4514 r5765 75 75 ParameterType stringType = new StringParameterType(); 76 76 ParameterType intType = new IntegerParameterType(); 77 ParameterType boolType = new BooleanParameterType(); 77 78 for (Map.Entry<String, Object> param : parameters.entrySet()) 78 79 { … … 86 87 { 87 88 config.setParameterValues(param.getKey(), intType, values); 89 } 90 else if (value instanceof Boolean) 91 { 92 config.setParameterValues(param.getKey(), boolType, values); 88 93 } 89 94 else -
trunk/src/test/net/sf/basedb/test/roles/AdminTest.java
r5699 r5765 52 52 import net.sf.basedb.test.MouseData; 53 53 import net.sf.basedb.test.PluginUtil; 54 import net.sf.basedb.test.SequenceData; 54 55 import net.sf.basedb.test.TestUtil; 55 56 … … 118 119 "Reporters from Affymetrix annotations file", 119 120 "net.sf.basedb.plugins.ReporterFlatFileImporter", AffymetrixData.getReporterParameters()); 121 122 PluginConfiguration gtfReporterImporter = PluginUtil.createPluginConfiguration(dc, 123 "Reporters from GTF file", 124 "net.sf.basedb.plugins.gtf.GtfReporterImporter", SequenceData.getGtfReporterParameters()); 120 125 dc.commit(); 121 126 … … 124 129 File reporters = FileUtil.uploadFile(dc, "/mouse", "plates_and_reporters.mouse.v4.37k.txt", File.PLATE); 125 130 File affyReporters = FileUtil.uploadFile(dc, "/affymetrix/annotations", "MG_U74Av2_annot.csv.tar.bz2", File.REPORTER); 131 File gtfReporters = FileUtil.uploadFile(dc, "/sequencing", "refseq_CDS_fasta-hg19.gtf.tar.bz2", File.REPORTER); 126 132 dc.commit(); 127 133 128 134 //Import reporters 129 135 PluginUtil.importReporters(reporterImporter, reporters, "Importing reporters for project A"); 130 PluginUtil.importReporters(affyReporterImporter, affyReporters, "Importing Affymetrix reporter for project A"); 136 PluginUtil.importReporters(affyReporterImporter, affyReporters, "Importing Affymetrix reporters for project A"); 137 PluginUtil.importReporters(gtfReporterImporter, gtfReporters, "Importing GTF reporters for project A"); 131 138 TestUtil.logout(); 132 139 } -
trunk/src/test/net/sf/basedb/test/roles/PowerUserTest.java
r5751 r5765 49 49 import net.sf.basedb.core.PlateType; 50 50 import net.sf.basedb.core.Platform; 51 import net.sf.basedb.core.PlatformVariant; 51 52 import net.sf.basedb.core.PluginConfiguration; 52 53 import net.sf.basedb.core.PluginDefinition; … … 64 65 import net.sf.basedb.test.MouseData; 65 66 import net.sf.basedb.test.PluginUtil; 67 import net.sf.basedb.test.SequenceData; 66 68 import net.sf.basedb.test.TestUtil; 67 69 … … 171 173 PluginDefinition printMapImporter = PluginDefinition.getByClassName(dc, "net.sf.basedb.plugins.PrintMapFlatFileImporter"); 172 174 175 PluginConfiguration gtfFeatureImporter = PluginUtil.createPluginConfiguration(dc, 176 "GTF feature for project A", "net.sf.basedb.plugins.gtf.GtfReporterMapImporter", 177 SequenceData.getGtfFeatureParameters()); 178 173 179 PluginConfiguration rawDataImporter = PluginUtil.createPluginConfiguration(dc, "Raw data for project A", 174 180 "net.sf.basedb.plugins.RawDataFlatFileImporter", MouseData.getGenePixRawDataParameters(false)); … … 190 196 File printMap = FileUtil.uploadFile(dc, "/mouse", "printmap.mouse.v4.37k.tam", File.PRINT_MAP); 191 197 File cdfFile = FileUtil.uploadFile(dc, "/affymetrix/cdf", "MG_U74Av2.cdf.tar.bz2", File.REPORTER_MAP); 192 // TODO (#1613) - When we have a RefSeq test file 193 // File refSeqFile = FileUtil.uploadFile(dc, "/illumina", "refseq.txt", File.REPORTER_MAP); 198 File refSeqFile = FileUtil.uploadFile(dc, "/sequencing", "refseq_CDS_fasta-hg19.gtf.tar.bz2", File.REPORTER_MAP); 194 199 File batchImportFile_ArrayBatch = null; 195 200 File batchImportFile_ArrayDesign = null; … … 211 216 Platform genericPlatform = Platform.getByExternalId(dc, Platform.GENERIC); 212 217 Platform affymetrixPlatform = Platform.getByExternalId(dc, Platform.AFFYMETRIX); 218 PlatformVariant seqPlatform = PlatformVariant.getByExternalId(dc, PlatformVariant.SEQUENCING_EXPRESSION); 213 219 if (!useBatchImporters) 214 220 { … … 217 223 affyDesign = createArrayDesign(dc, affymetrixPlatform, "Affymetrix A", null); 218 224 FileUtil.addDataFile(dc, affyDesign, DataFileType.AFFYMETRIX_CDF, cdfFile, true); 219 // TODO (#1613) - use different platform when it has been defined by #1153 220 refSeqDesign = createArrayDesign(dc, genericPlatform, "RefSeqDesign A", null); 221 // TODO (#1613) - when a ref-seq file type has been defined by #1153 222 // and we have a test data set -- DO NOT FORGET TO ADD TO THE BATCH IMPORTER FILES 223 //FileUtil.addDataFile(dc, refSeqDesign, DataFileType.REF_SEQ, refSeqFile, true); 225 refSeqDesign = createArrayDesign(dc, seqPlatform, "RefSeqDesign A", null); 226 FileUtil.addDataFile(dc, refSeqDesign, DataFileType.REF_SEQ_GTF, refSeqFile, true); 224 227 } 225 228 else … … 234 237 235 238 importFeatures(printMapImporter, printMap, design); 236 // TODO (#1613) - when we have the importer, data file, etc. 237 // importFeatures(refSeqImporter, refSeqFile, refSeqDesign); 239 importFeatures(gtfFeatureImporter, refSeqFile, refSeqDesign); 238 240 239 241 dc = TestUtil.getDbControl(); … … 461 463 462 464 /** 465 Create an array design. 466 */ 467 public static ArrayDesign createArrayDesign(DbControl dc, PlatformVariant variant, String name, String linkToPlatesPattern) 468 { 469 TestUtil.write("--Creating array design: " + name + "\n"); 470 ArrayDesign design = ArrayDesign.getNew(dc, variant); 471 design.setName(name); 472 473 if (linkToPlatesPattern != null) 474 { 475 List<Plate> plates = Util.findPlates(dc, linkToPlatesPattern); 476 design.setPlateList(plates); 477 } 478 479 dc.saveItem(design); 480 return design; 481 } 482 483 /** 463 484 Create an array batch. 464 485 */ … … 537 558 } 538 559 } 560 561 /** 562 Import features. 563 */ 564 public static void importFeatures(PluginConfiguration config, File file, ArrayDesign design) 565 throws Exception 566 { 567 TestUtil.write("--Importing features from file: " + file.getName() + "\n"); 568 DbControl dc = TestUtil.getDbControl(); 569 try 570 { 571 config = PluginConfiguration.getById(dc, config.getId()); 572 Job job = Job.getNew(dc, config.getPluginDefinition(), config, null); 573 job.setName("Importing features to array design: " + design.getName()); 574 job.setParameterValue("file", new FileParameterType(), file); 575 job.setParameterValue("arrayDesign", 576 new ItemParameterType<ArrayDesign>(ArrayDesign.class, null), design); 577 dc.saveItem(job); 578 dc.commit(); 579 PluginUtil.executeJob(job); 580 } 581 finally 582 { 583 if (dc != null) dc.close(); 584 } 585 } 586 539 587 540 588 public static void importArrayBatches(PluginDefinition batchImporter, File file) … … 588 636 job.setParameterValue("numArraysColumnMapping", new StringParameterType(), "\\Arrays/slide\\"); 589 637 job.setParameterValue("platformColumnMapping", new StringParameterType(), "\\Platform\\"); 638 job.setParameterValue("variantColumnMapping", new StringParameterType(), "\\Variant\\"); 590 639 job.setParameterValue("fileTypeColumnMapping", new StringParameterType(), "\\File type\\"); 591 640 job.setParameterValue("fileColumnMapping", new StringParameterType(), "\\File\\"); -
trunk/src/test/net/sf/basedb/test/roles/Util.java
r5751 r5765 198 198 } 199 199 query.order(Orders.asc(Hql.property("name"))); 200 System.out.println("Find plates: " + query.toQl(dc));201 200 return query.list(dc); 202 201 }
Note: See TracChangeset
for help on using the changeset viewer.