EvanForsythe / ERCnet

9 stars 2 forks source link

Add logic that supports addending ERC_results file with numbers to avoid filename collisions #61

Closed tgattsIV closed 1 year ago

tgattsIV commented 1 year ago

Problem: Currently ERC_results files take an incredibly long time to generate and there are no protections for overwriting them if a user submits a job with the same name and correlation flags twice. These files take a long time to generate and we also do not want user input required (which could stall a job submitted to a cluster).

Solution: Add logic that checks if the file already exists, if it does, check the last part of the string for a number, then either add or increment that number for a new filename.

Example: file ERC_results_BXB_spearman.tsv already exists, but another job in the same folder using BXB branch method and spearman correlation is run. A new filename will be generated called ERC_results_BXB_spearman_1.tsv