Esempio n. 1
0
                        " ".join(traceback.print_exc())))

            script_util.check_disk_space(self.logger)
            # Zip tophat folder
            out_file_path = os.path.join(directory, "%s.zip" % output_name)
            try:
                logger.info("Zipping the output files".format(out_file_path))
                script_util.zip_files(self.logger, output_dir, out_file_path)
            except Exception, e:
                logger.exception(e)
                raise Exception(
                    "Failed to compress the index: {0}".format(out_file_path))
            ## Upload the file using handle service
            try:
                #hisat2_handle = hs.upload(out_file_path)
                hisat2_handle = script_util.upload_file_to_shock(
                    logger, out_file_path)['handle']
            except Exception, e:
                logger.exception(e)
                raise Exception("Failed to upload zipped output file".format(
                    out_file_path))
            script_util.check_disk_space(self.logger)
            #### Replace version with get_version command#####
            logger.info("Preparing output object")
            hisat2_out = {
                "file": hisat2_handle,
                "size": os.path.getsize(out_file_path),
                "aligned_using": "hisat2",
                "aligner_version": "2.2.6",
                'library_type': lib_type,
                'condition': condition,
                'read_sample_id': read_sample,
Esempio n. 2
0
    except Exception,e:
         raise Exception(e)
         logger.exception("".join(traceback.format_exc()))
         raise Exception("Error parsing FPKMtracking")
 ##  compress and upload to shock
    try:
         logger.info("Zipping Stringtie output")
         print "Zipping Stringtie output"
         out_file_path = os.path.join(directory,"%s.zip" % output_name)
         script_util.zip_files(logger,output_dir,out_file_path)
    except Exception,e:
         raise Exception(e)
         logger.exception("".join(traceback.format_exc()))
         raise Exception("Error executing stringtie")
    try:
         handle = script_util.upload_file_to_shock(logger,out_file_path)['handle']
    except Exception, e:
         raise Exception(e)
         logger.exception("".join(traceback.format_exc()))
         raise Exception("Error while zipping the output objects: {0}".format(out_file_path))
         ## Save object to workspace
    try:
         logger.info("Saving Stringtie object to workspace")
         es_obj = { 'id'                       : output_name,
                    'type'                     : 'RNA-Seq',
                    'numerical_interpretation' : 'FPKM',
                    'expression_levels'        : exp_dict,
                    'tpm_expression_levels'    : tpm_exp_dict,
                    'processing_comments'      : "log2 Normalized",
                    'genome_id'                : genome_id,
                    'annotation_id'            : annotation_id,
Esempio n. 3
0
                     prev_value = ''
                     self.logger.info(line)
 except Exception, e:
     raise Exception(e)
     raise Exception("Error executing cuffdiff {0},{1}".format(
         cuffdiff_command, e))
 try:
     self.logger.info("Zipping Cuffdiff output")
     out_file_path = os.path.join(
         self.directory,
         "{0}.zip".format(self.method_params['output_obj_name']))
     script_util.zip_files(self.logger, output_dir, out_file_path)
 except Exception, e:
     raise Exception("Error executing cuffdiff")
 try:
     handle = script_util.upload_file_to_shock(self.logger,
                                               out_file_path)['handle']
 except Exception, e:
     print " ".join(traceback.print_exc())
     raise Exception(
         "Failed to upload the Cuffdiff output files: {0}".format(
             " ".join(traceback.print_exc())))
 ## Save object to workspace
 try:
     self.logger.info("Saving Cuffdiff object to workspace")
     cm_obj = {
         "tool_used": self.tool_used,
         "tool_version": self.tool_version,
         "condition": self.details['labels'],
         "genome_id": self.details['genome_id'],
         "expressionSet_id": self.details['expressionset_id'],
         "alignmentSet_id": self.details['alignmentset_id'],