Changeset 379 for trunk/uk/ac


Ignore:
Timestamp:
Aug 8, 2007, 3:02:44 PM (15 years ago)
Author:
dominic
Message:
 
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  
    4040  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.
    4141  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.
    4243  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
    4344  test first. 
  • trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/Tab2MageImporter.java

    r374 r379  
    4747import uk.ac.ebi.nugo.plugins.tab2mageimport.mail.Tab2MageEMessaging;
    4848import uk.ac.ebi.nugo.plugins.tab2mageimport.validation.Tab2MageValidationFactory;
    49 import uk.ac.ebi.nugo.plugins.util.Tab2MageHelper;
     49import uk.ac.ebi.nugo.plugins.util.Helper;
    5050import uk.ac.ebi.nugo.plugins.util.ZipUnpacker;
    5151
     
    205205      Experiment exp = (Experiment)item;
    206206      RawDataType rawDataType = exp.getRawDataType();
    207       if (!Tab2MageHelper.supportedPlatforms(rawDataType.getId().toLowerCase()))
     207      if (!Helper.supportedPlatforms(rawDataType.getId().toLowerCase()))
    208208      {
    209209        message="This importer only supports Affymetrix, Agilent and Genepix Platforms. Your experiment's platform is :" + rawDataType.getId().toLowerCase();
     
    290290     
    291291        // validate files supplied to platform
    292       validPlatform=Tab2MageHelper.validatePlatform(dir, dc, rdt);
     292      validPlatform=Helper.validatePlatform(dir, dc, rdt);
    293293      if (!validPlatform)
    294294            {
     
    298298     
    299299        // validate image file
    300       List<File> imageFiles=Tab2MageHelper.getImageFiles(dir, dc) ;
     300      List<File> imageFiles=Helper.getImageFiles(dir, dc) ;
    301301      if (!imageFiles.isEmpty()|| imageFiles==null)
    302302      {
    303         validateImageFile= Tab2MageHelper.validateImages(imageFiles, rdt);
     303        validateImageFile= Helper.validateImages(imageFiles, rdt);
    304304        if (!validateImageFile)
    305305        {
     
    364364     
    365365        // 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);
    367367       
    368368        // do data import
  • trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/io/Base2Tab2MageFileReader.java

    r374 r379  
    3737import uk.ac.ebi.nugo.plugins.util.ClassPreamble2;
    3838import uk.ac.ebi.nugo.plugins.util.NutribasePluginException;
    39 import uk.ac.ebi.nugo.plugins.util.Tab2MageHelper;
     39import uk.ac.ebi.nugo.plugins.util.Helper;
    4040
    4141import org.embl.cg.utilitytools.parser.csv.InvalidCSVSetUpException;
     
    165165        dc.saveItem(subDir);
    166166      }
    167       Tab2MageHelper.write("The created sub directory is: "+ subDir.getPath());
     167      Helper.write("The created sub directory is: "+ subDir.getPath());
    168168      createProtocolFile();
    169169      createHybridizationFile();
     
    442442            foundExprMandatoryFields.add(man.toString());
    443443            testLine = input.substring(man.toString().length()+1);
    444             Tab2MageHelper.write("header: " +man.toString()+ " = " +testLine);
     444            Helper.write("header: " +man.toString()+ " = " +testLine);
    445445            // sets the experiment object compulsory attributes : submitter, name and submitter email
    446446            experiment.add(man.toString(), testLine);
     
    453453          {
    454454            testLine = input.substring(opt.toString().length()+1);
    455             Tab2MageHelper.write("header: " +opt.toString()+ " = " +testLine);
     455            Helper.write("header: " +opt.toString()+ " = " +testLine);
    456456            //sets the experiment object optional attributes : organisation, domain etc
    457457            experiment.add(opt.toString(), testLine);
     
    493493      }
    494494      //  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);
    496496      hybRowsCount = lines.length -1;
    497497      this.headers = lines[0].getRawcols();
     
    657657        for(int j=0; j < headValues.size(); j++)
    658658        {     // 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());
    660660          for(Object key : keys)
    661661          {   // for every possible protocol column
  • trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/io/Tab2MageDataImportFactory.java

    r374 r379  
    2424import uk.ac.ebi.nugo.plugins.util.NutribasePluginException;
    2525import uk.ac.ebi.nugo.plugins.util.PluginConfigDetector;
    26 import uk.ac.ebi.nugo.plugins.util.Tab2MageHelper;
     26import uk.ac.ebi.nugo.plugins.util.Helper;
    2727/**
    2828  The class import raw data file into the database. Handles both 1 and multi-channel raw data types.
     
    103103    for(File file : files)
    104104    {
    105       String ext= Tab2MageHelper.getFileExtension(file);
     105      String ext= Helper.getFileExtension(file);
    106106      // check if the file actually contain the extension we approved.
    107107      if (! ExperimentPlatformsLibrary.fromExtension(ext).getPlatformName().equalsIgnoreCase(platform))
  • trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/io/Tab2MageHybWriter.java

    r374 r379  
    4242import org.embl.cg.bloader.models.Tab2MAGEHybridizationLine;
    4343
    44 import uk.ac.ebi.nugo.plugins.util.Tab2MageHelper;
     44import uk.ac.ebi.nugo.plugins.util.Helper;
    4545/**
    4646 
     
    176176                //write Labeled Extract
    177177                String dye = hybLine.getDye();
    178                 Label label =Tab2MageHelper.getLabel(dye, dc);
     178                Label label =Helper.getLabel(dye, dc);
    179179                LabeledExtract lextract= createLabeledExtract(hybLine.getLabeledExtract(), dye, label, extract, lExtracts, hybLine.getParameter(), protMap);
    180180                // add lextract to a list of labeled extracts
     
    183183
    184184          // 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);
    187187              if (arrayDesign==null)
    188188              {
     
    196196             
    197197              // Create Array Serial
    198               String slide =Tab2MageHelper.findTab2MageAccessionOrSerial(hyb.getArrayInformation(), "serial");
     198              String slide =Helper.findTab2MageAccessionOrSerial(hyb.getArrayInformation(), "serial");
    199199              ArraySlide arraySlide = getSlide(slide,ab, arrayDesign, i );
    200200             
     
    521521  private ArraySlide getSlide (String slide, ArrayBatch ab, ArrayDesign arrayDesign, int i)
    522522  {
    523     ArraySlide as = Tab2MageHelper.findArraySlide(dc, slide);
     523    ArraySlide as = Helper.findArraySlide(dc, slide);
    524524    if (as==null) // no matching array slide  was found
    525525    {
     
    540540  {
    541541    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);
    543543    if (arrayBatch== null)
    544544    {
     
    601601    for (Map.Entry<String, String> an : annotationMap.entrySet())
    602602    {
    603       AnnotationType at =Tab2MageHelper.getAnnotationTypeByName(an.getKey(),dc);
     603      AnnotationType at =Helper.getAnnotationTypeByName(an.getKey(),dc);
    604604      if (at!=null)
    605605      {
     
    654654    for (Map.Entry<String, String> an : annotationMap.entrySet())
    655655    {
    656       AnnotationType at =Tab2MageHelper.getAnnotationTypeByName(an.getKey(),dc);
     656      AnnotationType at =Helper.getAnnotationTypeByName(an.getKey(),dc);
    657657      if (at!=null)
    658658      {
  • trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/io/Tab2MageProtocolWriter.java

    r374 r379  
    1010import org.embl.cg.bloader.models.Tab2MAGEProtocol;
    1111
    12 import uk.ac.ebi.nugo.plugins.util.Tab2MageHelper;
     12import uk.ac.ebi.nugo.plugins.util.Helper;
    1313
    1414import net.sf.basedb.core.AnnotationType;
     
    8181          newProtocol.setDescription(protocol.getText());
    8282          newProtocol.setProtocolType(protocolType);
    83           List<String> result =Tab2MageHelper.getList(protocol.getParameters(),";");
     83          List<String> result =Helper.getList(protocol.getParameters(),";");
    8484          for (String res : result)
    8585          {
  • trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/io/Tab2MageWriterFactory.java

    r374 r379  
    5151import uk.ac.ebi.nugo.plugins.tab2mageimport.validation.Tab2MageValidationFactory;
    5252import uk.ac.ebi.nugo.plugins.util.NutribasePluginException;
    53 import uk.ac.ebi.nugo.plugins.util.Tab2MageHelper;
     53import uk.ac.ebi.nugo.plugins.util.Helper;
    5454
    5555/**
     
    144144    try
    145145    {
    146       Tab2MageHelper.write("WriterFactory: .... writing protocols and Hybridizations");
     146      Helper.write("WriterFactory: .... writing protocols and Hybridizations");
    147147      //writeProtocol
    148148      Tab2MageProtocolWriter protocolWriter= new Tab2MageProtocolWriter(protocols);
     
    199199      if (dc == null || !dc.isConnected()|| dc.isClosed()) dc = sc.newDbControl();
    200200   
    201       Tab2MageHelper.write("Entering the try loop");
     201      Helper.write("Entering the try loop");
    202202      for (Map.Entry<String , List<String>> entry : sampleExtMap.entrySet())
    203203      {
    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());
    205205        List<String> parents= entry.getValue();
    206206        List<BasicItem> children = new ArrayList<BasicItem>();
    207207        for (String parent : parents )
    208208        {
    209           Tab2MageHelper.write("++The current parent being checked is "+ parent);
    210           Sample p = Tab2MageHelper.findSample(dc, parent); // get the parent from the database
     209          Helper.write("++The current parent being checked is "+ parent);
     210          Sample p = Helper.findSample(dc, parent); // get the parent from the database
    211211          ItemQuery<Extract> childrenQuery  = p.getExtracts(); // get all the extracts ( children of parents -Sample)
    212212          childrenQuery.include(Include.MINE, Include.NOT_REMOVED); // include those children created by the loggedin user only
     
    215215        }
    216216        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() );
    220220        dc.reattachItem(e);
    221221        e.setPooled(true);
     
    256256      for (Tab2MAGEProtocol protocol: protocols)
    257257      {
    258         boolean foundType =Tab2MageHelper.checkIfProtocolTypesExist(protocol,localDc);
     258        boolean foundType =Helper.checkIfProtocolTypesExist(protocol,localDc);
    259259        if (!foundType)
    260260        {
  • trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/validation/AgilentValidation.java

    r374 r379  
    1717import uk.ac.ebi.nugo.plugins.tab2mageimport.AgilentDataColumns;
    1818import uk.ac.ebi.nugo.plugins.tab2mageimport.io.parser.AgilentRDParser;
    19 import uk.ac.ebi.nugo.plugins.util.Tab2MageHelper;
     19import uk.ac.ebi.nugo.plugins.util.Helper;
    2020
    2121  /**
     
    6464        String [] headers= agParser.getHeaders();
    6565        if (headers==null) continue;
    66         List<String> headerList = Tab2MageHelper.arrayContentToLowercase(headers);
     66        List<String> headerList = Helper.arrayContentToLowercase(headers);
    6767        List<AgilentDataColumns> mandatoryColumns= Arrays.asList(AgilentDataColumns.values());
    6868        for (AgilentDataColumns man :mandatoryColumns )
  • trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/validation/GenePixFileValidation.java

    r374 r379  
    2222import uk.ac.ebi.nugo.plugins.tab2mageimport.GenePixDataColumns;
    2323import uk.ac.ebi.nugo.plugins.tab2mageimport.io.parser.Base2GenePixRDParser;
    24 import uk.ac.ebi.nugo.plugins.util.Tab2MageHelper;
     24import uk.ac.ebi.nugo.plugins.util.Helper;
    2525
    2626/**
     
    7171        Base2GenePixRDParser gParser= new Base2GenePixRDParser(gprFile, dc);
    7272        String [] headers= gParser.getHeaders();
    73         List<String> headerList = Tab2MageHelper.arrayContentToLowercase(headers);
     73        List<String> headerList = Helper.arrayContentToLowercase(headers);
    7474        List<GenePixDataColumns> mandatoryColumns= Arrays.asList(GenePixDataColumns.values());
    7575        for (GenePixDataColumns man :mandatoryColumns )
  • trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/validation/Tab2MageImportValidatorUtils.java

    r374 r379  
    3030import uk.ac.ebi.nugo.plugins.util.NutribasePluginException;
    3131import uk.ac.ebi.nugo.plugins.util.Tab2MageConstants;
    32 import uk.ac.ebi.nugo.plugins.util.Tab2MageHelper;
     32import uk.ac.ebi.nugo.plugins.util.Helper;
    3333
    3434/**
  • trunk/uk/ac/ebi/Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/tab2mageimport/validation/Tab2MageValidationFactory.java

    r374 r379  
    3333import uk.ac.ebi.nugo.plugins.tab2mageimport.io.Base2Tab2MageFileReader;
    3434import uk.ac.ebi.nugo.plugins.util.NutribasePluginException;
    35 import uk.ac.ebi.nugo.plugins.util.Tab2MageHelper;
     35import uk.ac.ebi.nugo.plugins.util.Helper;
    3636
    3737/**
     
    260260        {
    261261          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);
    263263          GenePixFileValidation gprValidation= new GenePixFileValidation(gprFiles, dc);
    264264          if (!gprValidation.validate())
     
    279279          // obtain and check if the headers is within the allowed range
    280280          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);
    282282          AgilentValidation agValidation= new AgilentValidation(agFiles,dc);
    283283          if (!agValidation.validate())
Note: See TracChangeset for help on using the changeset viewer.