Skip to content

Commit

Permalink
Merge pull request #245 from RobokopU24/DnlRKorn-patch-7
Browse files Browse the repository at this point in the history
Set filenames to be based on object settings in all functions loadHistoneMap.py
  • Loading branch information
EvanDietzMorris authored Aug 13, 2024
2 parents 6836058 + eeacd0b commit 74ea571
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions parsers/yeast/src/loadHistoneMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,8 @@ def fetch_histone_data(self,
"CTD:increases_abundance_of"]

self.logger.debug('Histone Modifications Mapped to GO Terms!')
csv_fname = f"HistonePTM2GO.csv"
histonePTM2GO_df = pd.DataFrame.from_dict(histonePTM2GO)
histonePTM2GO_df.to_csv(os.path.join(output_directory, csv_fname), encoding="utf-8-sig", index=False)
histonePTM2GO_df.to_csv(os.path.join(output_directory, self.histone_mod_to_go_term_file_name), encoding="utf-8-sig", index=False)
for chr in chromosome_lengths.keys():
m = int(chromosome_lengths[chr])
for i in range(m): # Create loci nodes for chromosomes
Expand All @@ -303,7 +302,7 @@ def fetch_histone_data(self,
data['histoneMod'].append(ptm)
genomelocidf = pd.DataFrame(data)
self.logger.debug('Histone Modifications Loci Collected!')
genomelocidf.to_csv(os.path.join(output_directory, HISTONE_LOCI_FILE), encoding="utf-8-sig", index=False)
genomelocidf.to_csv(os.path.join(output_directory, self.histone_mod_list_file_name), encoding="utf-8-sig", index=False)

if not generate_gene_mapping:
return
Expand Down Expand Up @@ -336,5 +335,4 @@ def fetch_histone_data(self,
genomelocidf = genomelocidf.merge(just_windows, how='inner', on=['chromosomeID', 'start', 'end', 'loci'])

self.logger.debug(f"Histone Modifications Mapping Complete!")
csv_f3name = f"HistoneMod2Gene.csv"
genomelocidf.to_csv(os.path.join(output_directory, csv_f3name), encoding="utf-8-sig", index=False)
genomelocidf.to_csv(os.path.join(output_directory, self.histone_mod_to_gene_file_name), encoding="utf-8-sig", index=False)

0 comments on commit 74ea571

Please sign in to comment.