function UpdateCbioData(job_id) {
  console.log('run UpdateCbioData', this, 'job', job_id)
  Job.call(this, job_id);
  // UpdateCbioData
  // args
  //  sample_group_id - samples with expression and clinical data for upload into cbio
}
UpdateCbioData.prototype = Object.create(Job.prototype);
UpdateCbioData.prototype.constructor = UpdateCbioData;

UpdateCbioData.prototype.run = function () {
  // create paths for files on the disk
  // Use temporary folders at /tmp/UpdateCbioData[job_id]

  var workDir = "/tmp/" + "UpdateCbioData_" + this.job._id;
  console.log('workdir',workDir)

  try {
    fs.mkdirSync(workDir);
  } catch (e) {
    console.log("Pretty sure you reran the job: {$set: { status: 'waiting' }}");
    console.log("error:", e);
    throw e;
  }

  console.log("workDir: ", workDir);

  // create a sample group which is the combination of the two sample groups
  // so that we can easily write out a file


  var self = this;
  var deferred = Q.defer();

  // define up here so as to be available throughout promise chain (so that
  // we can skip a .then block)
  var expressionDataPath = path.join(workDir, "data_expression.txt");
  var logPath = path.join(workDir, "*.log");
  var associated_object = {
    collection_name: "SampleGroups",
    mongo_id: this.job.args.sample_group_id,
  };
  var form_id = this.job.args.form_id;

  Q.all([
      // write mongo data to files

      // expression data to a file for use in Limma
      spawnCommand(getSetting("genomic_expression_export"), [
        "--sample_group_id", this.job.args.sample_group_id,
        "--cbio",
        "--uq-sample-labels",
      ], workDir, { stdoutPath: expressionDataPath }),
      // phenotype file for cbio importer
      spawnCommand(getSetting("clinical_export"), [
        "--sample_group_id",
        this.job.args.sample_group_id,
        "--form_id",
        this.job.args.form_id,
        "--work-dir",

        workDir,
      ], workDir),
    ])
    .then(function (spawnResults)           {
      console.log("done writing files");

      _.each(spawnResults, function (result) {
        if (result.exitCode !== 0) {
          throw "Problem writing files to disk.";
        }
      });

      // save the file paths... order maters for spawnResults
      // (the order depends on the order of `spawnCommand`s in `Q.all`)
      var clinicalPath = spawnResults[1].stdoutPath;

      // run CbioImporter
      return spawnCommand(getSetting("cbio_importer_path"), [
        "-c import-study",
        "-jar",
        getSetting("cbio_core_jar_path"),
        "-s",
        workDir,
      ], workDir );
    })
    .then(Meteor.bindEnvironment(function (cbioImportResult) {
      if (cbioImportResult.exitCode !== 0) {
        throw "Problem running cbio importer";
      }
      function printError (err) {
         if (err) {
           console.log("error creating blob:", err);
         }
       }
      var meta = { form_id: form_id, cbio_import: dataSetName};
      console.log('importing into cbio form', form_id, dataSetName, associated_object)
      Blobs2.create(cbioImportResult.stdoutPath, associated_object, meta, printError);

     deferred.resolve(cbioImportResult);
   }, deferred.reject))
    .catch(Meteor.bindEnvironment(function (reason) {

      deferred.reject(reason);
    }, deferred.reject));
  return deferred.promise;
};

JobClasses.UpdateCbioData = UpdateCbioData;

@@ -807,123 +807,1044 @@
  // 
-create a sample group which is the combination of the two sample groups%0A  // so that we can easily write out a file
+look up datasetName using sample_group%0A  var group = SampleGroups.findOne(this.job.args.sample_group_id);%0A  var dataSetHash = %7B%7D;%0A  var dataSetName = %22%22;%0A  _.each(group.data_sets, function (dataSet) %7B%0A    // check if we've seen this data set already%0A    var seenAlready = dataSetHash%5BdataSet.data_set_id%5D;%0A    if (!seenAlready) %7B%0A      // if we haven't, set it up%0A      dataSetName = dataSet.data_set_name;%0A      seenAlready = %7B%0A        data_set_name: dataSet.data_set_name,%0A        sample_labels: %5B%5D,%0A      %7D;%0A    %7D%0A    // combine the samples together%0A    seenAlready.sample_labels =%0A        seenAlready.sample_labels.concat(dataSet.sample_labels)%0A    dataSetHash%5BdataSet.data_set_id%5D = seenAlready;%0A  %7D);%0A  var comboSampleGroupDataSets = _.map(dataSetHash,%0A      function (samplesAndName, data_set_id) %7B%0A    return %7B%0A      data_set_id: data_set_id,%0A      data_set_name: samplesAndName.data_set_name,%0A      sample_labels: samplesAndName.sample_labels,%0A%0A      // I think we can fake this%0A      unfiltered_sample_count: 1,%0A    %7D;%0A  %7D);%0A%0A
 %0A%0A%0A 

add back code to look up dataset name