# HG changeset patch # User trinity_ctat # Date 1529684642 14400 # Node ID ca57480062d10b6a26bb8100bdcf5ed590cb55a3 # Parent 4cdc1ccaae76e09d9d5b611c51596e126757057f Uploaded diff -r 4cdc1ccaae76 -r ca57480062d1 data_manager/add_ctat_lncrna_annotations.py --- a/data_manager/add_ctat_lncrna_annotations.py Thu Jun 21 19:08:52 2018 -0400 +++ b/data_manager/add_ctat_lncrna_annotations.py Fri Jun 22 12:24:02 2018 -0400 @@ -13,7 +13,7 @@ from datetime import * # Remove the following line when testing without galaxy package: -from galaxy.util.json import to_json_string +# from galaxy.util.json import to_json_string # Am not using the following: # from galaxy.util.json import from_json_string @@ -314,10 +314,23 @@ # Temporarily the output file's dictionary is written for debugging: print "The dictionary for the output file is:\n\t{:s}".format(str(data_manager_dict)) + + # Make a new annotations.config with absolute paths + annot_abs_path=[] + with open(os.path.join(annotations_directory,"annotations.config"),"r") as annot_reader: + for line in annot_reader: + if line.startswith("ORTHOLOG="): + annot_abs_path.append(line) + else: + annot_abs_path.append(line.replace("=","="+annotations_directory+os.sep)) + with open(os.path.join(annotations_directory,"annotations_abs_paths.config"),"w") as annot_writer: + for line in annot_abs_path: + annot_writer.write(line) + # Save info to json file. This is used to transfer data from the DataManager tool, to the data manager, # which then puts it into the correct .loc file (I think). # Remove the following line when testing without galaxy package. - open(args.output_filename, 'wb').write(to_json_string(data_manager_dict)) + # open(args.output_filename, 'wb').write(to_json_string(data_manager_dict)) if __name__ == "__main__": main()