Package uk.ac.bbsrc.tgac.miso.core.data.impl

Examples of uk.ac.bbsrc.tgac.miso.core.data.impl.PartitionImpl


                    for (Integer num : parts.keySet()) {
                      if (parts.get(num) == null) {
                        long newId = (notNullPartID-notNullPartNum)+num;
                        log.info("Inserting partition at "+num+" with ID "+ newId);
                        SequencerPoolPartition p = new PartitionImpl();
                        p.setSequencerPartitionContainer(f);
                        p.setId(newId);
                        p.setPartitionNumber(num);
                        p.setSecurityProfile(f.getSecurityProfile());
                        ((SequencerPartitionContainerImpl)f).addPartition(p);
                      }
                    }

                    log.info(f.getName()+":: partitions now ("+f.getPartitions().size()+")");
View Full Code Here


          if (j.getString("name").contains("DIL")) {
            Long dilutionId = Long.parseLong(j.getString("name").replaceAll("\\D+", ""));
            Long partitionId = Long.parseLong(j.getString("value").replaceAll("\\D+", ""));
            //and a new Partition created from the ID
            PartitionImpl newPartition = new PartitionImpl();
            newPartition.setId(partitionId);
            //if the partition is not already in the set of newPartitions:
            if (newPartitions.add(newPartition)) {
              // a new pool is created
              Pool<Dilution> newPool = new PoolImpl<Dilution>();
              //details of the original partition's pool are copied to the new one
              Pool<? extends Poolable> oldPool = requestManager.getSequencerPoolPartitionById(partitionId).getPool();
              newPool.setExperiments(oldPool.getExperiments());
              newPool.setPlatformType(oldPool.getPlatformType());
              //the new pool is added to the partition
              newPartition.setPool(newPool);
            }

            for (SequencerPoolPartition nextPartition : newPartitions) {
              if (nextPartition.getId() == partitionId) {
                //Dilution dilution = requestManager.getDilutionByIdAndPlatform(dilutionId, nextPartition.getPool().getPlatformType());
View Full Code Here

          log.debug(t.getName() + ": added " + sample.getName());
        }

        for (SequencerPoolPartition partition : partitionDAO.listBySubmissionId(rs.getLong("submissionId"))) {
          //for each partition, lists all the runs on the flowcell/container
          SequencerPoolPartition newPartition = new PartitionImpl();
          newPartition.setId(partition.getId());
          newPartition.setSequencerPartitionContainer(partition.getSequencerPartitionContainer());
          newPartition.setPartitionNumber(partition.getPartitionNumber());

          Pool<Dilution> newPool = new PoolImpl<Dilution>();
          Pool<? extends Poolable> oldPool = partition.getPool();
          newPool.setId(oldPool.getId());
          newPool.setExperiments(oldPool.getExperiments());

          List<Run> runs = new ArrayList<Run>(runDAO.listBySequencerPartitionContainerId(partition.getSequencerPartitionContainer().getId()));
          //if there is 1 run for the flowcell/container, sets the run for that container to the first on on the list
          if (runs.size() == 1) {
            partition.getSequencerPartitionContainer().setRun(runs.get(0));
          }

          List<Long> dilutionIdList = template.queryForList(SUBMISSION_DILUTION_SELECT, Long.class, new Object[]{rs.getLong("submissionId"), partition.getId()});

          log.debug("dilutionIdList for partition " + partition.getId() + "from DB table:" + dilutionIdList.toString());
          for (Long id : dilutionIdList) {
            Dilution dil = libraryDilutionDAO.getLibraryDilutionByIdAndPlatform(id, partition.getPool().getPlatformType());
            try {
              newPool.addPoolableElement(dil);
            }
            catch (Exception e) {
              e.printStackTrace();
            }
          }
          //adds the new pool to the partition
          newPartition.setPool(newPool);

          //replace any existing experiment-linked pools with the new pool
          for (Experiment experiment : experimentDAO.listBySubmissionId(rs.getLong("submissionId"))) {
            if (experiment.getPool().getId() == newPool.getId()) {
              experiment.setPool(newPool);
              t.addSubmissionElement(experiment);
              log.debug(t.getName() + ": added " + experiment.getName());
              break;
            }
          }

          //adds the partition to the submission
          log.debug("submission " + t.getId() + " new partition " + newPartition.getId() + " contains dilutions " + newPartition.getPool().getDilutions().toString());
          t.addSubmissionElement(newPartition);
        }
      }
      catch (IOException ie) {
        log.warn("Cannot map submission: " + ie.getMessage());
View Full Code Here

TOP

Related Classes of uk.ac.bbsrc.tgac.miso.core.data.impl.PartitionImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.