示例#1
0
 @Override
 protected Index doInBackground() throws Exception {
   int binSize = IgvTools.LINEAR_BIN_SIZE;
   FeatureCodec codec =
       CodecFactory.getCodec(
           file.getAbsolutePath(), GenomeManager.getInstance().getCurrentGenome());
   if (codec != null) {
     try {
       Index index = IndexFactory.createLinearIndex(file, codec, binSize);
       if (index != null) {
         IgvTools.writeTribbleIndex(index, idxFile.getAbsolutePath());
       }
       return index;
     } catch (TribbleException.MalformedFeatureFile e) {
       StringBuffer buf = new StringBuffer();
       buf.append("<html>Files must be sorted by start position prior to indexing.<br>");
       buf.append(e.getMessage());
       buf.append(
           "<br><br>Note: igvtools can be used to sort the file, select \"File > Run igvtools...\".");
       MessageUtils.showMessage(buf.toString());
     }
   } else {
     throw new DataLoadException("Unknown File Type", file.getAbsolutePath());
   }
   return null;
 }
示例#2
0
 public Object getIndex() {
   if (worker == null || !worker.isDone()) {
     return null;
   } else {
     try {
       return worker.get();
     } catch (Exception ex) {
       MessageUtils.showMessage(ex.getMessage());
     }
     return null;
   }
 }
示例#3
0
  private void notifyGenomesAddedRemoved(List<GenomeListItem> selectedValues, boolean added) {
    if (selectedValues == null || selectedValues.size() == 0) return;
    int size = selectedValues.size();
    String msg = "";
    if (size == 1) {
      msg += selectedValues.get(0) + " genome";
    } else {
      msg += size + " genomes";
    }
    if (added) {
      msg += " added to";
    } else {
      msg += " removed from";
    }
    msg += " list";

    MessageUtils.setStatusBarMessage(msg);
  }