Mercurial > repos > trinity_ctat > ctat_lncrna_data_manager
changeset 15:ca57480062d1 draft
Uploaded
author | trinity_ctat |
---|---|
date | Fri, 22 Jun 2018 12:24:02 -0400 |
parents | 4cdc1ccaae76 |
children | 06f8b9c84b67 |
files | data_manager/add_ctat_lncrna_annotations.py |
diffstat | 1 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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()