Changeset 5657


Ignore:
Timestamp:
Jun 16, 2011, 1:08:54 PM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #1153: Handling short read transcript sequence data

Added web pages for editing and viewing derived bioassay sets. They'll probably need to be polished up a bit.

The final link to raw bioassay is still not possible. I think we have to re-design the link somewhat. In BASE 2 we used the array index to link back to the correct (labeled) extracts. We can't use that in BASE 3 since for sequencing experiments there doesn't have to be any relation between extracts in the same lane of the flow cell. The idea was to provide a direct link to the extract, but then we loose one of the parents in 2-channel microarray experiments...

Location:
trunk
Files:
8 added
40 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/DerivedBioAssay.java

    r5653 r5657  
    6464    @throws BaseException If there is an error
    6565  */
    66   static DerivedBioAssay getNew(DbControl dc, DerivedBioAssaySet bioAssaySet, MeasuredBioMaterial bioMaterial)
     66  static DerivedBioAssay getNew(DbControl dc, DerivedBioAssaySet bioAssaySet, Extract extract)
    6767    throws PermissionDeniedException, InvalidDataException, BaseException
    6868  {
     
    7070    ba.setName("New bioassay");
    7171    ba.getData().setBioAssaySet(bioAssaySet.getData());
    72     if (bioMaterial != null)
    73     {
    74       ba.getData().setBioMaterial((MeasuredBioMaterialData)bioMaterial.getData());
     72    if (extract != null)
     73    {
     74      ba.getData().setExtract(extract.getData());
    7575    }
    7676    return ba;
     
    250250  }
    251251
    252   public MeasuredBioMaterial getBioMaterial()
    253   {
    254     return getDbControl().getItem(MeasuredBioMaterial.class, getData().getBioMaterial());
     252  public Extract getExtract()
     253  {
     254    return getDbControl().getItem(Extract.class, getData().getExtract());
    255255  }
    256256 
     
    260260    query.restrictPermanent(
    261261      Restrictions.eq(
    262         Hql.property("parent"),
     262        Hql.property("parentBioAssay"),
    263263        Hql.entity(this)
    264264      )
  • trunk/src/core/net/sf/basedb/core/DerivedBioAssaySet.java

    r5653 r5657  
    182182    return super.isUsed();
    183183  }
     184 
     185  /**
     186    Grant READ persmission to everyone that has read permision
     187    on the parent physical bioassay.
     188  */
     189  @Override
     190  void initPermissions(int granted, int denied)
     191    throws BaseException
     192  {
     193    // TODO Auto-generated method stub
     194    super.initPermissions(granted, denied);
     195  }
     196
    184197  /**
    185198    Set protocol, hardware and software from project default settings.
     
    383396    one bioassay for each biomaterial.
    384397   
    385     @param bioMaterial The biomaterial this bioassay is related to
     398    @param extract The biomaterial this extract is related to
    386399    @return A new child bioassay
    387400  */
    388   public DerivedBioAssay newBioAssay(MeasuredBioMaterial bioMaterial)
     401  public DerivedBioAssay newBioAssay(Extract extract)
    389402  {
    390403    checkPermission(Permission.WRITE);
    391     // TODO - Check if the biomaterial is a source to the parent physical bioassay
     404    // TODO - Check if the extract is a source to the parent physical bioassay
    392405   
    393     return DerivedBioAssay.getNew(getDbControl(), this, bioMaterial);
     406    return DerivedBioAssay.getNew(getDbControl(), this, extract);
    394407  }
    395408 
     
    406419  }
    407420 
     421  public Job getJob()
     422  {
     423    return getDbControl().getItem(Job.class, getData().getJob());
     424  }
     425 
    408426  private boolean protocolHasBeenSet = false;
    409427  /**
  • trunk/src/core/net/sf/basedb/core/PhysicalBioAssay.java

    r5652 r5657  
    457457 
    458458  /**
     459    Get a query that returns all derived bioassay sets created from this
     460    physical bioassay.
     461    @return An {@link ItemQuery} object
     462  */
     463  public ItemQuery<DerivedBioAssaySet> getDerivedBioAssaySets()
     464  {
     465    ItemQuery<DerivedBioAssaySet> query = DerivedBioAssaySet.getQuery();
     466    query.restrictPermanent(
     467      Restrictions.eq(
     468        Hql.property("physicalBioAssay"),
     469        Hql.entity(this)
     470      )
     471    );
     472    return query;
     473  }
     474 
     475  /**
    459476    Get a query that returns all root derived bioassay sets created from this
    460477    physical bioassay.
     
    473490    return query;
    474491  }
     492 
    475493 
    476494  /**
  • trunk/src/core/net/sf/basedb/core/RawBioAssay.java

    r5652 r5657  
    114114    rba.setPlatform(platform, rawDataType);
    115115    rba.setName("New raw bioassay");
    116     rba.setArrayNum(1);
    117116    rba.getData().setEntryDate(new Date());
    118117    return rba;
     
    140139    rba.setVariant(variant, rawDataType);
    141140    rba.setName("New raw bioassay");
    142     rba.setArrayNum(1);
    143141    rba.getData().setEntryDate(new Date());
    144142    return rba;
     
    237235    try
    238236    {
    239       if (getData().getParent() != null) annotatable.add(getParent());
     237      if (getData().getParentBioAssay() != null) annotatable.add(getParentBioAssay());
     238      if (getData().getParentExtract() != null) annotatable.add(getParentExtract());
    240239    }
    241240    catch (PermissionDeniedException ex)
     
    603602 
    604603  /**
    605     Get the hybridization array number this raw bioassay is linked to.
    606     The default value is 1.
    607     @since 2.6
    608   */
    609   public int getArrayNum()
    610   {
    611     return getData().getArrayNum();
    612   }
    613   /**
    614     Set the array number on the physical bioassay this raw bioassay is linked to.
    615     The value should be  between 1 and the size specified by the physical bioassay
    616     {@link PhysicalBioAssay#getSize()}.
    617     @param arrayNum A value > 0
    618     @throws NumberOutOfRangeException If the value is <=0
    619     @since 2.6
    620   */
    621   public void setArrayNum(int arrayNum)
    622   {
    623     checkPermission(Permission.WRITE);
    624     if (arrayNum <= 0) throw new NumberOutOfRangeException("arrayNum", arrayNum, 0, false);
    625     getData().setArrayNum(arrayNum);
    626   }
    627  
    628   /**
    629604    Get the {@link DerivedBioAssay} this raw bioassay is created from.
    630605
     
    635610    @since 3.0
    636611  */
    637   public DerivedBioAssay getParent()
     612  public DerivedBioAssay getParentBioAssay()
    638613    throws PermissionDeniedException, BaseException
    639614  {
    640     return getDbControl().getItem(DerivedBioAssay.class, getData().getParent());
     615    return getDbControl().getItem(DerivedBioAssay.class, getData().getParentBioAssay());
    641616  }
    642617 
     
    650625    @since 3.0
    651626  */
    652   public void setParent(DerivedBioAssay parent)
     627  public void setParentBioAssay(DerivedBioAssay parent)
    653628    throws PermissionDeniedException
    654629  {
    655630    checkPermission(Permission.WRITE);
    656631    if (parent != null) parent.checkPermission(Permission.USE);
    657     getData().setParent(parent == null ? null : parent.getData());
    658   }
    659 
     632    getData().setParentBioAssay(parent == null ? null : parent.getData());
     633  }
     634
     635  /**
     636    Get the {@link Extract} this raw bioassay is created from.
     637 
     638    @return The <code>Extract</code> item or null if not known
     639    @throws PermissionDeniedException If the logged in user doesn't have
     640      read permission for the extract
     641    @throws BaseException If there is another error.
     642    @since 3.0
     643  */
     644  public Extract getParentExtract()
     645    throws PermissionDeniedException, BaseException
     646  {
     647    return getDbControl().getItem(Extract.class, getData().getParentExtract());
     648  }
     649 
     650  /**
     651    Set the {@link Extract} this raw bioassay is created from.
     652 
     653    @param extract The parent extract or null if not known
     654    @throws PermissionDeniedException If the logged in user doesn't have
     655      write permission for the raw bioassay use permission for the scan
     656    @throws BaseException If there is another error
     657    @since 3.0
     658  */
     659  public void setParentBioAssay(Extract extract)
     660    throws PermissionDeniedException
     661  {
     662    checkPermission(Permission.WRITE);
     663    if (extract != null) extract.checkPermission(Permission.USE);
     664    getData().setParentExtract(extract == null ? null : extract.getData());
     665  }
     666
     667 
    660668  /**
    661669    Get the {@link Software} used while analysing the scanned images.
  • trunk/src/core/net/sf/basedb/core/data/DerivedBioAssayData.java

    r5653 r5657  
    104104    Get the parent bioassay set that this bioassay belongs to.
    105105    @hibernate.many-to-one outer-join="false" update="false"
    106     @hibernate.column name="`bioassayset_id`" not-null="true" unique-key="uniquebioassay"
     106    @hibernate.column name="`bioassayset_id`" not-null="true" unique-key="uniqueextract"
    107107  */
    108108  public DerivedBioAssaySetData getBioAssaySet()
     
    115115  }
    116116 
    117   private MeasuredBioMaterialData bioMaterial;
     117  private ExtractData extract;
    118118  /**
    119     Get the biomaterial that is related to the data in this bioassay.
     119    Get the extract that is related to the data in this bioassay.
    120120    @hibernate.many-to-one outer-join="false" update="false"
    121     @hibernate.column name="`biomaterial_id`" not-null="false" unique-key="uniquebioassay"
     121    @hibernate.column name="`extract_id`" not-null="false" unique-key="uniqueextract"
    122122  */
    123   public MeasuredBioMaterialData getBioMaterial()
     123  public ExtractData getExtract()
    124124  {
    125     return bioMaterial;
     125    return extract;
    126126  }
    127   public void setBioMaterial(MeasuredBioMaterialData bioMaterial)
     127  public void setExtract(ExtractData extract)
    128128  {
    129     this.bioMaterial = bioMaterial;
     129    this.extract = extract;
    130130  }
    131131
  • trunk/src/core/net/sf/basedb/core/data/RawBioAssayData.java

    r5652 r5657  
    142142  }
    143143 
    144   private int arrayNum;
    145   /**
    146     The array number this raw bioassay is linked to on a multi-array
    147     hybridization.
    148     @hibernate.property column="`array_num`" type="int" not-null="true"
    149     @since 2.6
    150   */
    151   public int getArrayNum()
    152   {
    153     return arrayNum;
    154   }
    155   public void setArrayNum(int arrayNum)
    156   {
    157     this.arrayNum = arrayNum;
    158   }
    159  
    160144  private SoftwareData software;
    161145  /**
     
    220204    @hibernate.many-to-one column="`bioassay_id`" not-null="false" outer-join="false"
    221205  */
    222   public DerivedBioAssayData getParent()
     206  public DerivedBioAssayData getParentBioAssay()
    223207  {
    224208    return bioAssay;
    225209  }
    226   public void setParent(DerivedBioAssayData bioAssay)
     210  public void setParentBioAssay(DerivedBioAssayData bioAssay)
    227211  {
    228212    this.bioAssay = bioAssay;
    229213  }
    230214
     215  private ExtractData extract;
     216  /**
     217    Get the derived bioassay that this raw bioassay has been created from.
     218    @hibernate.many-to-one column="`extract_id`" not-null="false" outer-join="false"
     219  */
     220  public ExtractData getParentExtract()
     221  {
     222    return extract;
     223  }
     224  public void setParentExtract(ExtractData extract)
     225  {
     226    this.extract = extract;
     227  }
     228
     229 
    231230  private String rawDataType;
    232231  /**
  • trunk/src/core/net/sf/basedb/util/AnnotationUtil.java

    r5652 r5657  
    119119      if (item instanceof RawBioAssay)
    120120      {
    121         return ((RawBioAssay)item).getArrayNum();
     121        //return ((RawBioAssay)item).getArrayNum();
     122        return arrayNum;
    122123      }
    123124      else if (item instanceof DerivedBioAssaySet || item instanceof PhysicalBioAssay)
  • trunk/src/core/net/sf/basedb/util/overview/GenericOverview.java

    r5384 r5657  
    9898  private Map<Object, Object> objectCache;
    9999  private List<Failure> failures;
     100  private NodeCache<Object> nodeCache;
    100101
    101102  /**
     
    202203  public NodeCache<Object> getNodeCache()
    203204  {
    204     return null;
     205    return nodeCache;
    205206  }
    206207 
     
    346347  {
    347348    this.allNodes = new HashMap<String, Node>();
    348     //this.nodeCache = new NodeCache<Object>();
     349    this.nodeCache = new NodeCache<Object>();
    349350    this.objectCache = new HashMap<Object, Object>();
    350351    this.failures = new LinkedList<Failure>();
  • trunk/src/core/net/sf/basedb/util/overview/OverviewUtil.java

    r5652 r5657  
    348348
    349349    PhysicalBioAssay pba = null;
    350     int arrayNum = 1;
    351350    // Special case when starting with a raw bioassay since we only
    352351    // want to get parents from the sub-array with the same
    353352    // index = rba.getArrayNum()
     353    /*
    354354    if (root instanceof RawBioAssay)
    355355    {
     
    366366      }
    367367    }
     368    */
    368369 
    369370    Set<Annotatable> parents = (Set<Annotatable>)context.getCachedObject(cacheKey);
     
    373374      context.setCachedObject(cacheKey, parents);
    374375      Set<Annotatable> temp = pba != null ?
    375           pba.getAnnotatableParents(arrayNum) : item.getAnnotatableParents();
     376          pba.getAnnotatableParents() : item.getAnnotatableParents();
    376377      if (temp != null)
    377378      {
  • trunk/src/core/net/sf/basedb/util/overview/loader/DerivedBioAssayLoader.java

    r5653 r5657  
    111111    DerivedBioAssay bioAssay = null;
    112112    boolean denied = false;
    113     int arrayNum = 0;
    114113    try
    115114    {
    116115      RawBioAssay rba = (RawBioAssay)rawBioAssayNode.getItem(dc);
    117       arrayNum = rba.getArrayNum();
    118       bioAssay = rba.getParent();
     116      bioAssay = rba.getParentBioAssay();
    119117    }
    120118    catch (PermissionDeniedException ex)
     
    122120      denied = true;
    123121    }
    124     Object cacheKey = new IndexedCacheKey(bioAssay, arrayNum);
    125     Node scanNode = createItemNode(nf, bioAssay, cacheKey, denied,
     122    Node scanNode = createItemNode(nf, bioAssay, bioAssay, denied,
    126123        rawBioAssayNode, ChildNodeDirection.REVERSE);
    127124    return scanNode;
  • trunk/src/core/net/sf/basedb/util/overview/loader/ExtractLoader.java

    r5653 r5657  
    215215    are the extracts that has been used on a bioassay.
    216216  */
    217   private Node createReverseNode(PhysicalBioAssay hyb, DbControl dc, OverviewContext context, Node parentNode)
     217  private Node createReverseNode(PhysicalBioAssay pba, DbControl dc, OverviewContext context, Node parentNode)
    218218  {
    219219    Node folderNode = null;
     
    223223    // only load extracts on the specific 'array index'
    224224    Node rbaNode = parentNode.getFirstParent(new ItemTypeFilter(Item.RAWBIOASSAY));
    225     int arrayNum = 0;
    226     if (rbaNode != null)
    227     {
    228       arrayNum = ((RawBioAssay)rbaNode.getItem()).getArrayNum();
    229     }
    230     ItemQuery<Extract> query = context.initQuery(hyb.getExtracts(arrayNum), "name");
     225    ItemQuery<Extract> query = context.initQuery(pba.getExtracts(0), "name");
    231226    ItemResultIterator<Extract> it = query.iterate(dc);
    232227    while (it.hasNext())
     
    250245    try
    251246    {
    252       extract = (Extract)bioAssay.getBioMaterial();
     247      extract = bioAssay.getExtract();
    253248    }
    254249    catch (PermissionDeniedException ex)
  • trunk/src/core/net/sf/basedb/util/overview/loader/PhysicalBioAssayLoader.java

    r5652 r5657  
    103103    PhysicalBioAssay bioAssay = null;
    104104    boolean denied = false;
    105     int arrayNum = 0;
    106105    try
    107106    {
     
    112111      {
    113112        RawBioAssay rba = (RawBioAssay)rbaNode.getItem();
    114         arrayNum = rba.getArrayNum();
    115113      }
    116114    }
     
    119117      denied = true;
    120118    }
    121     Object cacheKey = new IndexedCacheKey(bioAssay, arrayNum);
    122     Node bioAssayNode = createItemNode(nf, bioAssay, cacheKey, denied, derivedBioAssaySetNode, ChildNodeDirection.REVERSE);
     119    Node bioAssayNode = createItemNode(nf, bioAssay, bioAssay, denied, derivedBioAssaySetNode, ChildNodeDirection.REVERSE);
    123120    return bioAssayNode;
    124121  }
  • trunk/src/core/net/sf/basedb/util/overview/validator/RawBioAssayValidator.java

    r5652 r5657  
    9393    try
    9494    {
    95       int arrayIndex = rba.getArrayNum();
    96       DerivedBioAssay parent = rba.getParent();
     95      DerivedBioAssay parent = rba.getParentBioAssay();
    9796      Map<String, Node> used = (Map<String, Node>)context.getCachedObject("USED.ARRAYINDEX");
    9897      if (used == null)
     
    101100        context.setCachedObject("USED.ARRAYINDEX", used);
    102101      }
    103      
     102      /*
    104103      String key = parent.getId() + ":" + arrayIndex;
    105104      if (used.containsKey(key))
     
    119118        used.put(key, node);
    120119      }
    121      
     120      */
     121      /*
    122122      PhysicalBioAssay pba = parent.getBioAssaySet().getPhysicalBioAssay();
    123123      if (arrayIndex > pba.getSize() || arrayIndex < 1)
     
    129129          new Fix("Increase size on physical bioassay", pba));
    130130      }
     131      */
    131132    }
    132133    catch (RuntimeException ex)
  • trunk/src/plugins/core/net/sf/basedb/plugins/IlluminaRawDataImporter.java

    r5652 r5657  
    671671            RawBioAssay rba = RawBioAssay.getNew(dc, generic, illumina);
    672672            rba.setName(arrayName);
    673             rba.setArrayNum(arrayNum);
     673            //rba.setArrayNum(arrayNum);
    674674            if (design != null) rba.setArrayDesign(design);
    675675            if (protocol != null) rba.setProtocol(protocol);
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/RawBioAssayImporter.java

    r5652 r5657  
    326326    if (nameMapper != null) rba.setName(nameMapper.getValue(data));
    327327    if (descriptionMapper != null) rba.setDescription(descriptionMapper.getValue(data));
    328     if (arrayIndexMapper != null)
    329     {
    330       Integer arrayIndex = arrayIndexMapper.getInt(data);
    331       if (arrayIndex != null) rba.setArrayNum(arrayIndex);
    332     }
    333328    ArrayDesign designFromScan = null;
    334     /*
    335     if (scanMapper != null)
    336     {
    337       String nameOrId = scanMapper.getValue(data);
    338       Scan scan = findScan(dc, FallbackIdMethod.NAME_OR_ID, scanMapper.getValue(data));
    339       if (nameOrId == null || scan != null) rba.setScan(scan);
    340       if (scan != null)
    341       {
    342         try
    343         {
    344           designFromScan = scan.getArrayDesign();
    345         }
    346         catch (PermissionDeniedException ex)
    347         {}
    348       }
    349     }
    350     */
    351329    if (!rba.hasData())
    352330    {
  • trunk/src/test/TestAnalyzeUtil.java

    r5384 r5657  
    8282   
    8383    // Create raw bioassays and import raw data
    84     int rba1 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "Genepix.1", 0, 0, 0, arrayDesignId, 1, false);
    85     int rba2 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "Genepix.2", 0, 0, 0, arrayDesignId, 1, false);
     84    int rba1 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "Genepix.1", 0, 0, 0, arrayDesignId, false);
     85    int rba2 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "Genepix.2", 0, 0, 0, arrayDesignId, false);
    8686    TestRawBioAssay.test_import_from_file(rba1, "data/test.rawdata.import.txt");
    8787    TestRawBioAssay.test_import_from_file(rba2, "data/test.rawdata.import.txt");
  • trunk/src/test/TestAnnotation.java

    r5430 r5657  
    8686
    8787    // Test: inherit annotations
    88     int rawBioAssayId = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", null, 0, 0, 0, arrayDesignId, 1, false);
     88    int rawBioAssayId = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", null, 0, 0, 0, arrayDesignId, false);
    8989    test_inherit_annotation(Item.RAWBIOASSAY, rawBioAssayId, intAnnotationId);
    9090    test_inherit_annotation(Item.RAWBIOASSAY, rawBioAssayId, stringAnnotationId);
  • trunk/src/test/TestDerivedBioAssaySet.java

    r5653 r5657  
    322322    {
    323323      System.out.println(i+":\t"+ba.getId()+"\t"+ba.getName()+"\t"+
    324         ba.getDescription()+"\t"+ba.getBioAssaySet()+"\t"+ba.getBioMaterial());
     324        ba.getDescription()+"\t"+ba.getBioAssaySet()+"\t"+ba.getExtract());
    325325    }
    326326  }
     
    332332  }
    333333 
    334   static int test_add_bioassay(int bioAssaySetid, int bioMaterialId, String name)
     334  static int test_add_bioassay(int bioAssaySetid, int extractId, String name)
    335335  {
    336336    if (bioAssaySetid == 0) return 0;
     
    341341      dc = TestUtil.getDbControl();
    342342      DerivedBioAssaySet dbas = DerivedBioAssaySet.getById(dc, bioAssaySetid);
    343       MeasuredBioMaterial bioMaterial = null;
    344       if (bioMaterialId != 0) bioMaterial = (MeasuredBioMaterial)BioMaterial.getById(dc, bioMaterialId);
    345       DerivedBioAssay ba = dbas.newBioAssay(bioMaterial);
     343      Extract extract = null;
     344      if (extractId != 0) extract = Extract.getById(dc, extractId);
     345      DerivedBioAssay ba = dbas.newBioAssay(extract);
    346346      ba.setName(name);
    347347      ba.setDescription("Added at "+new Date());
  • trunk/src/test/TestDirty.java

    r5319 r5657  
    7575        "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*", null, 0, 2, 1, 4);
    7676   
    77     int rawBioAssayId = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", null, 0, 0, 0, arrayDesignId, 1, false);
     77    int rawBioAssayId = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", null, 0, 0, 0, arrayDesignId, false);
    7878    int fileId = TestFile.test_create("data/test.import.dirty.txt", false, false);
    7979   
  • trunk/src/test/TestExperiment.java

    r5340 r5657  
    7979      "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*", null, 0, 2, 1, 4);
    8080   
    81     int rbaId1 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", null, 0, 0, 0, arrayDesignId, 1, false);
    82     int rbaId2 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", null, 0, 0, 0, arrayDesignId, 1, false);
     81    int rbaId1 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", null, 0, 0, 0, arrayDesignId, false);
     82    int rbaId2 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", null, 0, 0, 0, arrayDesignId, false);
    8383    TestRawBioAssay.test_import_from_file(rbaId1, "data/test.rawdata.import.txt");
    8484    TestRawBioAssay.test_import_from_file(rbaId2, "data/test.rawdata.import.txt");
  • trunk/src/test/TestGenericOverview.java

    r5653 r5657  
    135135   
    136136    // Raw bioassay #1
    137     int rawBioAssay1 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "RBA #1", scannedAssayId1, software, featureProtocol, arrayDesign, 1, false);
     137    int rawBioAssay1 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "RBA #1", scannedAssayId1, software, featureProtocol, arrayDesign, false);
    138138    TestDataFileType.test_set_file(Item.RAWBIOASSAY, rawBioAssay1, DataFileType.GENERIC_RAW_DATA, genePixFile);
    139139    TestDataFileType.test_set_file(Item.RAWBIOASSAY, rawBioAssay1, DataFileType.AFFYMETRIX_CEL, celFile);
     
    141141
    142142    // Raw bioassay #2
    143     int rawBioAssay2 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "RBA #2", scannedAssayId2, software, featureProtocol, arrayDesign, 2, false);
     143    int rawBioAssay2 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "RBA #2", scannedAssayId2, software, featureProtocol, arrayDesign, false);
    144144    TestDataFileType.test_set_file(Item.RAWBIOASSAY, rawBioAssay2, DataFileType.GENERIC_RAW_DATA, genePixFile);
    145145
     
    166166
    167167    // Raw bioassays
    168     int seqRaw1 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "SeqRBA #1", alignedAssayId1, software, 0, arrayDesign, 1, false);
    169     int seqRaw2 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "SeqRBA #2", alignedAssayId2, software, 0, arrayDesign, 2, false);
     168    int seqRaw1 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "SeqRBA #1", alignedAssayId1, software, 0, arrayDesign, false);
     169    int seqRaw2 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "SeqRBA #2", alignedAssayId2, software, 0, arrayDesign, false);
    170170   
    171171    // **** Experiment ******
  • trunk/src/test/TestMetadata.java

    r5653 r5657  
    9595int scanId = 0;
    9696    int rawId = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "My raw bioassay",
    97         scanId, 0, 0, designId, 1, true);
     97        scanId, 0, 0, designId, true);
    9898    int formulaId = TestFormula.test_create("Test metadata", Formula.Type.COLUMN_EXPRESSION,
    9999      "genepix",  new String[] { "ch(1) + ch(2)" }, true);
  • trunk/src/test/TestRawBioAssay.java

    r5653 r5657  
    7272   
    7373    // Standard tests: create, load, list
    74     int id = test_create(Platform.GENERIC, "genepix", null, bioAssayId, softwareId, protocolId, arrayDesignId, 1, true);
    75     int id2 = test_create(Platform.GENERIC, "genepix", null, 0, 0, 0, 0, 1, false);   
    76     int id3 = test_create(Platform.AFFYMETRIX, null, null, 0, 0, 0, 0, 1, false);
     74    int id = test_create(Platform.GENERIC, "genepix", null, bioAssayId, softwareId, protocolId, arrayDesignId, true);
     75    int id2 = test_create(Platform.GENERIC, "genepix", null, 0, 0, 0, 0, false);   
     76    int id3 = test_create(Platform.AFFYMETRIX, null, null, 0, 0, 0, 0, false);
    7777   
    7878    test_load(id);
     
    116116  }
    117117
    118   static int test_create(String platformId, String rawDataType, String name, int bioAssayId, int softwareId, int protocolId, int arrayDesignId, int arrayNum, boolean setAll)
     118  static int test_create(String platformId, String rawDataType, String name, int bioAssayId, int softwareId, int protocolId, int arrayDesignId, boolean setAll)
    119119  {
    120120    if (!TestUtil.hasPermission(Permission.CREATE, Item.RAWBIOASSAY)) return 0;
     
    132132      }
    133133      if (name != null) rba.setName(name);
    134       rba.setArrayNum(arrayNum);
    135134      if (softwareId != 0)
    136135      {
     
    143142      if (bioAssayId != 0)
    144143      {
    145         rba.setParent(DerivedBioAssay.getById(dc, bioAssayId));
     144        rba.setParentBioAssay(DerivedBioAssay.getById(dc, bioAssayId));
    146145      }
    147146      if (arrayDesignId != 0)
  • trunk/src/test/TestRawDataFlatFileImporter.java

    r5319 r5657  
    4646    TestArrayDesign.test_import_from_file(arrayDesignId, "data/test.rawdata.import.txt",
    4747        "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*", ".*(EMPTY_WELL|no clone).*", 0, 2, 1, 4);
    48     int rawBioAssayId = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", null, 0, 0, 0, arrayDesignId, 1, true);
     48    int rawBioAssayId = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", null, 0, 0, 0, arrayDesignId, true);
    4949   
    5050    // Create plugin configuration and job
  • trunk/src/test/TestSpotImages.java

    r4889 r5657  
    5959    write("++Testing spot images import");
    6060   
    61     int rawBioAssayId = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", null, 0, 0, 0, 0, 1, false);
     61    int rawBioAssayId = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", null, 0, 0, 0, 0, false);
    6262    TestReporter.test_import_from_file("data/test.rawdata.import.txt", "\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*", "\\t", 4, 3);
    6363    TestRawBioAssay.test_import_from_file(rawBioAssayId, "data/test.rawdata.import.txt");
  • trunk/src/test/TestWebservices.java

    r5652 r5657  
    112112    int affyDesignId = TestArrayDesign.test_create(Platform.AFFYMETRIX, true);
    113113    TestArrayDesign.test_set_file(affyDesignId, DataFileType.AFFYMETRIX_CDF, cdfId);
    114     int affyRaw1 = TestRawBioAssay.test_create(Platform.AFFYMETRIX, null, "Affymetrix.1", 0, 0, 0, affyDesignId, 1, false);
     114    int affyRaw1 = TestRawBioAssay.test_create(Platform.AFFYMETRIX, null, "Affymetrix.1", 0, 0, 0, affyDesignId, false);
    115115    TestDataFileType.test_set_file(Item.RAWBIOASSAY, affyRaw1, "affymetrix.cel", celId);
    116     int affyRaw2 = TestRawBioAssay.test_create(Platform.AFFYMETRIX, null, "Affymetrix.2", 0, 0, 0, affyDesignId, 1, false);
     116    int affyRaw2 = TestRawBioAssay.test_create(Platform.AFFYMETRIX, null, "Affymetrix.2", 0, 0, 0, affyDesignId, false);
    117117    TestDataFileType.test_set_file(Item.RAWBIOASSAY, affyRaw2, "affymetrix.cel", celId);
    118118   
  • trunk/www/admin/annotationtypes/edit_annotationtype.jsp

    r5510 r5657  
    849849      <td>
    850850        <b>Enabled for</b><br>
    851         <select name="enabled" multiple size="14" style="width: 12em;"
     851        <select name="enabled" multiple size="14" style="width: 16em;"
    852852          ondblclick="moveBetween(document.forms['annotationType'].enabled, document.forms['annotationType'].disabled)">
    853853        </select>
     
    871871      <td>
    872872        <b>Disabled for</b><br>
    873         <select name="disabled" multiple size="14" style="width: 12em;"
     873        <select name="disabled" multiple size="14" style="width: 16em;"
    874874          ondblclick="moveBetween(document.forms['annotationType'].disabled, document.forms['annotationType'].enabled)">
    875875        </select>
  • trunk/www/common/annotations/annotate.jsp

    r5644 r5657  
    190190  <base:page type="popup" title="<%=title%>">
    191191  <base:head scripts="annotations.js,parameters.js" styles="parameters.css">
    192  
    193192  <script language="JavaScript">
    194193  function init()
     
    628627        %>
    629628        </select>
    630       <%=selectedCategoryName %>
    631629        <div class="parameterlist" style="height: <%=(int)(scale*300)%>px; margin-top: 4px;">
    632630        <%=sb.toString()%>
  • trunk/www/common/annotations/inherit.jsp

    r5642 r5657  
    7070    PhysicalBioAssay hyb = (PhysicalBioAssay)current;
    7171    RawBioAssay rba = (RawBioAssay)root;
    72     parents = hyb.getAnnotatableParents(rba.getArrayNum());
     72    parents = hyb.getAnnotatableParents();
    7373  }
    7474  else
  • trunk/www/include/menu.jsp

    r5652 r5657  
    465465
    466466    final boolean hasPhysicalBioAssays     = !sc.hasPermission(Permission.DENIED, Item.PHYSICALBIOASSAY);
     467    final boolean hasDerivedBioAssaySets   = !sc.hasPermission(Permission.DENIED, Item.DERIVEDBIOASSAYSET);
    467468
    468469    final boolean hasRawBioAssays       = !sc.hasPermission(Permission.DENIED, Item.RAWBIOASSAY);
     
    547548        tooltip="<%=menu.getString("physicalbioassays.tooltip", hasPhysicalBioAssays)%>"
    548549        enabled="<%=hasPhysicalBioAssays%>"
     550      />
     551      <m:menuitem
     552        title="<%=common.getString("item.derivedbioassayset+")%>"
     553        onclick="<%="Menu.openUrl('"+root+"views/derivedbioassaysets/index.jsp?ID="+ID+"')"%>"
     554        tooltip="<%=menu.getString("derivedbioassaysets.tooltip", hasDerivedBioAssaySets)%>"
     555        enabled="<%=hasDerivedBioAssaySets%>"
    549556      />
    550557      <m:menuitem
  • trunk/www/include/scripts/main.js

    r5650 r5657  
    531531    this.controllers['FORMULA'] = { url:'views/formulas/index.jsp', width:850, height:600 };
    532532    this.controllers['PHYSICALBIOASSAY'] = { url:'views/physicalbioassays/index.jsp', width:800, height:500 };
     533    this.controllers['DERIVEDBIOASSAYSET'] = { url:'views/derivedbioassaysets/index.jsp', width:800, height:500 };
     534    this.controllers['DERIVEDBIOASSAY'] = { url:'views/derivedbioassaysets/bioassays/index.jsp', width:800, height:500 };
    533535    this.controllers['RAWBIOASSAY'] = { url:'views/rawbioassays/index.jsp', width:800, height:500 };
    534536    this.controllers['RAWDATA'] = { url:'views/rawbioassays/rawdata/index.jsp', width:700, height:500, popup: true, edit:false };
  • trunk/www/my_base/projects/edit_project.jsp

    r5650 r5657  
    228228      Link.addNewSection(defaultItems, new Section('SOFTWARE', 'Software'));
    229229      <%
    230       for (BasicItem defaultItem : project.getDefaultItems(dc))
    231       {
    232         String name = defaultItem instanceof Nameable ? ((Nameable)defaultItem).getName() : defaultItem.toString();
    233         if (defaultItem instanceof Subtypable)
     230      if (project != null)
     231      {
     232        for (BasicItem defaultItem : project.getDefaultItems(dc))
    234233        {
    235           ItemSubtype subtype = ((Subtypable)defaultItem).getItemSubtype();
    236           if (subtype != null) name += " (" + subtype.getName() + ")";
     234          String name = defaultItem instanceof Nameable ? ((Nameable)defaultItem).getName() : defaultItem.toString();
     235          if (defaultItem instanceof Subtypable)
     236          {
     237            ItemSubtype subtype = ((Subtypable)defaultItem).getItemSubtype();
     238            if (subtype != null) name += " (" + subtype.getName() + ")";
     239          }
     240          %>
     241          Link.addNewItem(defaultItems, new Item('<%=defaultItem.getType().name()%>', <%=defaultItem.getId()%>, '<%=HTML.javaScriptEncode(name)%>'), true);
     242          <%
    237243        }
    238         %>
    239         Link.addNewItem(defaultItems, new Item('<%=defaultItem.getType().name()%>', <%=defaultItem.getId()%>, '<%=HTML.javaScriptEncode(name)%>'), true);
    240         <%
    241244      }
    242245      %>
  • trunk/www/views/physicalbioassays/edit_bioassay.jsp

    r5650 r5657  
    146146      currentArraySlide = Base.getFirstMatching(dc, ArraySlide.getQuery(), "name", cc.getPropertyFilter("arraySlide.name"));
    147147    }
    148     name = Values.getString(cc.getPropertyValue("name"), "New hybridization");
     148    name = Values.getString(cc.getPropertyValue("name"), "New physical bioassay");
    149149    eventDate = (Date)cc.getPropertyObject("creationEvent.eventDate");
    150150   
     
    482482        var i = item.value ? item.value.indexOf(':') : -1;
    483483        frm.used_quantity.value = i >= 0 ? item.value.substring(0, i) : item.value;
    484         frm.array_index.value = i > 0 ? item.value.substring(i+1) : '1';
     484        frm.position.value = i >= 0 ? item.value.substring(i+1) : '1';
    485485        frm.used_quantity.focus();
    486486      }
     
    488488      {
    489489        frm.used_quantity.value = '';
    490         frm.array_index.value = '1';
     490        frm.position.value = '1';
    491491      }
    492492    }
     
    495495      var frm = document.forms['bioassay'];
    496496      var usedQuantity = frm.used_quantity.value;
    497       var arrayIndex = frm.array_index.value;
     497      var position = frm.position.value;
    498498      var size = parseInt(frm.size.value);
    499       if (arrayIndex != '' && (arrayIndex > size || arrayIndex <= 0))
    500       {
    501         alert('Array index must be between 1 and ' + size);
     499      if (position != '' && (position > size || position <= 0))
     500      {
     501        alert('Position must be between 1 and ' + size);
    502502        return;
    503503      }
    504       if (arrayIndex == '') arrayIndex = 1;
     504      if (position == '') position = 1;
    505505      var displayQuantity = usedQuantity == '' ? '-' : usedQuantity+' µg';
    506506      for (var i = 0; i < frm.extracts.length; i++) // >
     
    509509        if (option.selected && option.item.id)
    510510        {
    511           option.item.value = usedQuantity + ':' + arrayIndex;
     511          option.item.value = usedQuantity + ':' + position;
    512512          var text = option.text.replace(/\[.*\]/, '['+displayQuantity+']');
    513           text = text.replace(/\d*\:/, arrayIndex + ':');
     513          text = text.replace(/\d*\:/, position + ':');
    514514          option.text = text;
    515515        }
    516516      }
    517517    }
    518     function arrayIndexOnBlur()
     518    function positionOnBlur()
    519519    {
    520520      usedQuantityOnBlur();
     
    756756
    757757      <tr>
    758         <td style="text-align: right; padding-right: 5px;">- array index</td>
     758        <td style="text-align: right; padding-right: 5px;">- position</td>
    759759        <td>
    760             <input <%=clazz%> type="text" name="array_index" value=""
     760            <input <%=clazz%> type="text" name="position" value=""
    761761              size="12" maxlength="10" onkeypress="return Numbers.numberOnly(event)"
    762               onkeyup="arrayIndexOnBlur()"
    763             >
     762              onkeyup="positionOnBlur()"
     763            > (1 -- size of bioassay)
    764764        </td>
    765765      </tr>
  • trunk/www/views/physicalbioassays/index.jsp

    r5652 r5657  
    241241          String[] extra = request.getParameter("E"+extractId).split(":");
    242242          Float usedQuantity = Values.getFloat(extra[0], null);
    243           int arrayIndex = extra.length > 1 ? Values.getInt(extra[1], 1) : 1;
     243          int position = extra.length > 1 ? Values.getInt(extra[1], 1) : 1;
    244244          creationEvent.addSource(e, usedQuantity);
    245           creationEvent.setSourceGroup(e, arrayIndex);
     245          creationEvent.setSourceGroup(e, position);
    246246        }
    247247      }
  • trunk/www/views/physicalbioassays/list_bioassays.jsp

    r5652 r5657  
    211211      Table.presetOnChange('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>');
    212212    }
    213     function newScan(hybridizationId)
    214     {
    215       Main.viewOrEditItem('<%=ID%>', 'SCAN', 0, true, '&hybridization_id='+hybridizationId);
     213    function newDerivedBioAssaySet(bioAssayId)
     214    {
     215      Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAYSET', 0, true, '&physicalbioassay_id='+bioAssayId);
    216216    }
    217217    </script>
     
    316316      <tbl:columndef
    317317        id="protocol"
    318         property="creationEvent.protocol"
    319         sortproperty="creationEvent.protocol.name"
    320         filterproperty="creationEvent.protocol.name"
    321         exportproperty="creationEvent.protocol.name"
     318        property="creationEvent.protocol.name"
    322319        datatype="string"
    323320        title="Protocol"
     
    328325      <tbl:columndef
    329326        id="hardware"
    330         property="creationEvent.hardware"
     327        property="creationEvent.hardware.name"
    331328        datatype="string"
    332329        title="Hardware"
  • trunk/www/views/physicalbioassays/view_bioassay.jsp

    r5652 r5657  
    152152      Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&item_id=<%=itemId%>', 'RunPlugin'+cmd, 740, 540);
    153153    }
    154     function newScan()
    155     {
    156       Main.viewOrEditItem('<%=ID%>', 'SCAN', 0, true, '&hybridization_id=<%=itemId%>');
    157     }
    158154    function switchTab(tabControlId, tabId)
    159155    {
     
    168164      }
    169165    }
    170    
     166    function newDerivedBioAssaySet()
     167    {
     168      Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAYSET', 0, true, '&physicalbioassay_id=<%=itemId%>');
     169    }
    171170    </script>
    172171  </base:head>
     
    223222        onclick="newDerivedBioAssaySet()"
    224223        title="New derived bioassay set&hellip;"
    225         tooltip="Create a new derived bioassay set from this physical bioassay"
     224        tooltip="Create a derived bioassay set from this bioassay"
    226225        visible="<%=sc.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAYSET) && usePermission%>"
    227226      />
     
    402401      }
    403402      %>
    404      
     403
    405404      <%
    406       ItemQuery<DerivedBioAssaySet> dbasQuery = (ItemQuery<DerivedBioAssaySet>)pba.getRootDerivedBioAssaySets();
    407       dbasQuery.include(Include.ALL);
    408       dbasQuery.order(Orders.asc(Hql.property("name")));
    409       ItemResultList<DerivedBioAssaySet> bioAssaySets = dbasQuery.list(dc);
    410       if (bioAssaySets.size() == 0)
     405      ItemQuery<DerivedBioAssaySet> childQuery = pba.getDerivedBioAssaySets();
     406      childQuery.include(Include.ALL);
     407      childQuery.order(Orders.asc(Hql.property("name")));
     408      ItemResultList<DerivedBioAssaySet> children = childQuery.list(dc);
     409      if (children.size() == 0)
    411410      {
    412411        %>
    413412        <h4>Derived bioassay sets</h4>
    414         No derived bioassay sets has been created from this bioassay
    415         (or, you don't have permission to view them).
     413        This bioassay doesn't have any derived bioassay sets.
    416414        <%
    417415      }
     
    419417      {
    420418        %>
    421         <base:section
    422           id="derivedBioAssaySetsSection"
    423           title="<%="Derived bioassay sets (" + bioAssaySets.size() + ")"%>"
     419        <base:section 
     420          id="children"
     421          title="<%="Derived bioassay sets (" + children.size() + ")"%>"
    424422          context="<%=cc%>"
    425423          >
    426424          <tbl:table
    427             id="derivedBioAssaySets"
     425            id="children"
    428426            clazz="itemlist"
    429427            columns="all"
     
    434432          />
    435433          <tbl:columndef
    436             id="hardware"
    437             title="Hardware"
    438           />
    439  
     434            id="itemSubtype"
     435            title="Type"
     436          />
    440437          <tbl:columndef
    441438            id="description"
     
    447444            <tbl:rows>
    448445            <%
    449             for (DerivedBioAssaySet item : bioAssaySets)
     446            for (DerivedBioAssaySet item : children)
    450447            {
    451448              %>
    452449              <tbl:row>
    453                 <tbl:cell column="name"><base:icon
    454                     image="deleted.gif"
    455                     tooltip="This item has been scheduled for deletion"
    456                     visible="<%=item.isRemoved()%>"
    457                   /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell>
    458                 <tbl:cell column="hardware"><base:propertyvalue item="<%=item%>" property="hardware" /></tbl:cell>
     450                <tbl:cell column="name"><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell>
     451                <tbl:cell column="itemSubtype"><base:propertyvalue item="<%=item%>" property="itemSubtype" /></tbl:cell>
    459452                <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell>
    460453              </tbl:row>
     
    469462      }
    470463      %>
     464
     465
    471466      <jsp:include page="../../common/anytoany/list_anytoany.jsp">
    472467        <jsp:param name="ID" value="<%=ID%>" />
     
    575570        %>
    576571        <h4>Shared to</h4>
    577         This hybridization is not shared
     572        This bioassay is not shared
    578573        (or, you don't have permission to view the ones it is shared to).
    579574        <%
  • trunk/www/views/rawbioassays/edit_rawbioassay.jsp

    r5650 r5657  
    3636  import="net.sf.basedb.core.Platform"
    3737  import="net.sf.basedb.core.PlatformVariant"
    38   import="net.sf.basedb.core.Scan"
    3938  import="net.sf.basedb.core.Protocol"
    4039  import="net.sf.basedb.core.Project"
     
    8887  PlatformVariant defaultVariant = null;
    8988 
    90   boolean readCurrentScan = true;
    91   Scan currentScan = null;
    9289  boolean readCurrentProtocol = true;
    9390  Protocol currentProtocol = null;
     
    104101  // Load recently used items
    105102  List<Protocol> recentProtocols = (List<Protocol>)cc.getRecent(dc, Item.PROTOCOL);
    106   List<Scan> recentScans = (List<Scan>)cc.getRecent(dc, Item.SCAN);
    107103  List<Software> recentSoftware = (List<Software>)cc.getRecent(dc, Item.SOFTWARE);
    108104  List<ArrayDesign> recentArrayDesigns = (List<ArrayDesign>)cc.getRecent(dc, Item.ARRAYDESIGN);
     
    182178    if (currentRawDataType == null) currentRawDataType = defaultRawDataType;
    183179
    184     int scanId = Values.getInt(request.getParameter("scan_id"));
    185     if (scanId != 0)
    186     {
    187       currentScan = Scan.getById(dc, scanId);
    188     }
    189     else if (cc.getPropertyFilter("scan.name") != null)
    190     {
    191       currentScan = Base.getFirstMatching(dc, Scan.getQuery(), "name", cc.getPropertyFilter("scan.name"));
    192     }
    193 
    194     if (currentScan != null)
    195     {
    196       name = currentScan.getName() + ".r" + (currentScan.countRawBioAssays() + 1);
    197     }
    198     else
    199     {
    200       name = Values.getString(cc.getPropertyValue("name"), "New raw bioassay");
    201     }
     180    name = Values.getString(cc.getPropertyValue("name"), "New raw bioassay");
    202181    if (cc.getPropertyFilter("protocol.name") != null)
    203182    {
     
    209188      currentSoftware = Base.getFirstMatching(dc, Software.getQuery(), "name", cc.getPropertyFilter("software.name"));
    210189    }
     190    /*
    211191    if (currentScan != null)
    212192    {
     
    218198      {}
    219199    }
     200    */
    220201    if (currentArrayDesign == null && cc.getPropertyFilter("arrayDesign.name") != null)
    221202    {
     
    248229    }
    249230   
    250     try
    251     {
    252       currentScan = rawBioAssay.getScan();
    253     }
    254     catch (PermissionDeniedException ex)
    255     {
    256       readCurrentScan = false;
    257     }
    258231    try
    259232    {
     
    314287        return false;
    315288      }
    316       else if (!Numbers.isInteger(frm.arrayNum.value))
    317       {
    318         alert("'" + frm.arrayNum.value + "' is not a valid number");
    319         frm.arrayNum.focus();
    320         return false;
    321       }
    322       else if (parseInt(frm.arrayNum.value) <= 0)
    323       {
    324         alert("Array index must be > 0");
    325         frm.arrayNum.focus();
    326         return false;
    327       }
    328289      return true;
    329290    }
     
    435396      var parents = new Array();
    436397
    437       var scanId = Math.abs(parseInt(frm.scan_id[frm.scan_id.selectedIndex].value));
    438       if (scanId > 0) parents[parents.length] = 'SCAN:'+scanId;
    439398      if (frm.arraydesign_id)
    440399      {
     
    473432    {
    474433      protocolChanged = true;
    475     }
    476    
    477     function scanOnChange()
    478     {
    479       var frm = document.forms['rawbioassay'];
    480       var selectedIndex = frm.scan_id.selectedIndex
    481       var scanId = frm.scan_id[selectedIndex].value;
    482       if (scanId > 0) updateArrayDesign(scanId);
    483       parentsChanged = true;
    484     }
    485     function selectScanOnClick()
    486     {
    487       var frm = document.forms['rawbioassay'];
    488       var url = '../scans/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setScanCallback';
    489       if (frm.scan_id.length > 1)
    490       {
    491         var id = Math.abs(parseInt(frm.scan_id[1].value));
    492         url += '&item_id='+id;
    493       }
    494       Main.openPopup(url, 'SelectScan', 1000, 700);
    495     }
    496     function setScanCallback(id, name)
    497     {
    498       var frm = document.forms['rawbioassay'];
    499       var list = frm.scan_id;
    500       if (list.length < 2 || list[1].value == '0') // >
    501       {
    502         Forms.addListOption(list, 1, new Option());
    503       }
    504       list[1].value = id;
    505       list[1].text = name;
    506       list.selectedIndex = 1;
    507       updateArrayDesign(id)
    508       parentsChanged = true;
    509434    }
    510435   
     
    583508      arrayDesignOnChange();
    584509    }
    585     function updateArrayDesign(scanId)
    586     {
    587       var request = Ajax.getXmlHttpRequest();
    588       if (request != null)
    589       {
    590         var url = '../scans/ajax.jsp?ID=<%=ID%>&cmd=GetArrayDesign&item_id=' + scanId;
    591         request.open("GET", url, true);
    592         Ajax.setReadyStateHandler(request, updateArrayDesignCallback);
    593         request.send(null);
    594       }
    595       return request != null;
    596     }
    597     function updateArrayDesignCallback(request)
    598     {
    599       var frm = document.forms['rawbioassay'];
    600       var response = Ajax.parseJsonResponse(request.responseText);
    601       if (response.status != 'ok')
    602       {
    603         alert(response.message);
    604         return false;
    605       }
    606      
    607       if (response.id)
    608       {
    609         var designList = frm.arraydesign_id;
    610         if (designList.length < 2 || designList[1].value == '0') // >
    611         {
    612           Forms.addListOption(designList, 1, new Option());
    613         }
    614         designList[1].value = response.id;
    615         designList[1].text = response.name;
    616         designList.selectedIndex = 1;
    617       }
    618     }
    619    
     510
    620511    function init()
    621512    {
     
    680571          value="<%=HTML.encodeTags(name)%>"
    681572          size="40" maxlength="<%=RawBioAssay.MAX_NAME_LENGTH%>"></td>
    682       </tr>
    683       <tr>
    684         <td class="prompt">Array index</td>
    685         <td><input <%=requiredClazz%> type="text" name="arrayNum"
    686           value="<%=rawBioAssay == null ? Values.getString(cc.getPropertyValue("arrayNum"), "1") : rawBioAssay.getArrayNum()%>"
    687           size="12" maxlength="10" onkeypress="return Numbers.integerOnly(event)"></td>
    688573      </tr>
    689574      <tr>
     
    774659      </tr>
    775660      <tr>
    776         <td class="prompt">Scan</td>
    777         <td>
    778           <base:select
    779             id="scan_id"
    780             clazz="selectionlist"
    781             required="false"
    782             current="<%=currentScan%>"
    783             denied="<%=!readCurrentScan%>"
    784             recent="<%=recentScans%>"
    785             newitem="<%=rawBioAssay == null%>"
    786             onselect="selectScanOnClick()"
    787             onchange="scanOnChange()"
    788           />
    789         </td>
    790       </tr>
    791       <tr>
    792661        <td class="prompt">Software</td>
    793662        <td>
  • trunk/www/views/rawbioassays/index.jsp

    r5630 r5657  
    1 <%@page import="net.sf.basedb.core.FeatureIdentificationMethod"%>
    21<%-- $Id$
    32  ------------------------------------------------------------------
     
    3332  import="net.sf.basedb.core.Include"
    3433  import="net.sf.basedb.core.RawBioAssay"
    35   import="net.sf.basedb.core.Scan"
     34  import="net.sf.basedb.core.FeatureIdentificationMethod"
    3635  import="net.sf.basedb.core.Protocol"
    3736  import="net.sf.basedb.core.Software"
     
    298297      rba.setName(Values.getStringOrNull(request.getParameter("name")));
    299298      rba.setDescription(Values.getStringOrNull(request.getParameter("description")));
    300       rba.setArrayNum(Values.getInt(request.getParameter("arrayNum"), 1));
    301299      int protocolId = Values.getInt(request.getParameter("protocol_id"), -1);
    302300      if (protocolId >= 0)  // < 0 = denied or unchanged
     
    313311        if (sw != null) cc.setRecent(sw, maxRecent);
    314312      }
    315       int scanId = Values.getInt(request.getParameter("scan_id"), -1);
    316       if (scanId >= 0) // < 0 = denied or unchanged
    317       {
    318         Scan scan = scanId == 0 ? null : Scan.getById(dc, scanId);
    319         rba.setScan(scan);
    320         if (scan != null) cc.setRecent(scan, maxRecent);
    321       }
     313
    322314      Job job = null;
    323315      ArrayDesign ad = null;
  • trunk/www/views/rawbioassays/list_rawbioassays.jsp

    r5623 r5657  
    336336      />
    337337      <tbl:columndef
    338         id="arrayNum"
    339         property="arrayNum"
    340         datatype="int"
    341         title="Array index"
    342         sortable="true"
    343         filterable="true"
    344         exportable="true"
    345       />
    346       <tbl:columndef
    347338        id="hasData"
    348339        property="hasData"
     
    382373      />
    383374      <tbl:columndef
    384         id="scan"
    385         property="scan.name"
    386         datatype="string"
    387         title="Scan"
     375        id="parent"
     376        property="parent.name"
     377        datatype="string"
     378        title="Parent"
    388379        sortable="true"
    389380        filterable="true"
     
    721712                  /></tbl:cell>               
    722713                <tbl:cell column="rawDataType"><%=HTML.encodeTags(item.getRawDataType().getName())%></tbl:cell>
    723                 <tbl:cell column="arrayNum"><%=item.getArrayNum()%></tbl:cell>
    724714                <tbl:cell column="hasData"><%=item.hasData()%></tbl:cell>
    725                 <tbl:cell column="scan"
     715                <tbl:cell column="parent"
    726716                  ><base:propertyvalue
    727717                    item="<%=item%>"
    728                     property="scan"
     718                    property="parent"
    729719                    enableEditLink="<%=mode.hasEditLink()%>"
    730720                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
  • trunk/www/views/rawbioassays/view_rawbioassay.jsp

    r5623 r5657  
    4040  import="net.sf.basedb.core.RawDataType"
    4141  import="net.sf.basedb.core.SpotImages"
    42   import="net.sf.basedb.core.Scan"
    4342  import="net.sf.basedb.core.Protocol"
    4443  import="net.sf.basedb.core.Software"
     
    349348      </tr>
    350349      <tr>
    351         <td class="prompt">Scan</td>
    352         <td><base:propertyvalue item="<%=rawBioAssay%>" property="scan" /></td>
     350        <td class="prompt">Parent bioassay</td>
     351        <td><base:propertyvalue item="<%=rawBioAssay%>" property="parent" /></td>
    353352      </tr>
    354353      <tr>
     
    471470      <%
    472471      Set<String> names = rawBioAssay.getHeaderNames();
    473       %>
    474       <base:section
    475         id="headers"
    476         title="<%="Raw data headers (" + (names == null ? 0 : names.size()) + ")"%>"
    477         context="<%=cc%>"
    478         >
    479         <table class="form" cellspacing="0">
    480         <%
    481         boolean needsTr = true;
    482         if (names != null)
    483         {
    484           for (String name : names)
     472      if (names == null || names.size() == 0)
     473      {
     474        %>
     475        <h4>Raw data headers</h4>
     476        None.
     477        <%
     478      }
     479      else
     480      {
     481        %>
     482        <base:section
     483          id="headers"
     484          title="<%="Raw data headers (" + (names == null ? 0 : names.size()) + ")"%>"
     485          context="<%=cc%>"
     486          >
     487          <table class="form" cellspacing="0">
     488          <%
     489          boolean needsTr = true;
     490          if (names != null)
    485491          {
     492            for (String name : names)
     493            {
     494              %>
     495              <%=needsTr ? "<tr valign=\"top\">" : "" %>
     496                <td class="prompt"><%=HTML.encodeTags(name)%></td>
     497                <td><%=HTML.encodeTags(rawBioAssay.getHeader(name))%></td>
     498                <td>&nbsp;&nbsp;</td>
     499              <%=needsTr ? "" : "</tr>"%>
     500              <%
     501              needsTr = !needsTr;
     502            }
    486503            %>
    487             <%=needsTr ? "<tr valign=\"top\">" : "" %>
    488               <td class="prompt"><%=HTML.encodeTags(name)%></td>
    489               <td><%=HTML.encodeTags(rawBioAssay.getHeader(name))%></td>
    490               <td>&nbsp;&nbsp;</td>
    491504            <%=needsTr ? "" : "</tr>"%>
    492505            <%
    493             needsTr = !needsTr;
    494506          }
    495507          %>
    496           <%=needsTr ? "" : "</tr>"%>
    497           <%
    498         }
    499         %>
    500         </table>
    501       </base:section>
     508          </table>
     509        </base:section>
     510        <%
     511      }
     512      %>
    502513
    503514      <%
Note: See TracChangeset for help on using the changeset viewer.