Skip to content

Commit

Permalink
Log a command to demo removing the outdated input files
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarshall committed Aug 14, 2024
1 parent a4a3a45 commit 06f8e1b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/rename_embedded_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,15 @@ def reheader_cram(old_url: str, old_id: str, new_id: str):
if len(sys.argv) < 2:
print(__doc__)

old_urls = []
for arg in sys.argv[1:]:
field = arg.split(',')
if len(field) >= 3:
reheader_cram(field[0], field[1], field[2])
else:
reheader_cram(field[0], 'CPG[0-9]*', field[1])
old_urls.append(field[0])
old_urls.append(f'{field[0]}.crai')

logger.info(f'After checking the output, manually remove {len(old_urls)} outdated data files:')
logger.info(f'gcloud storage rm {" ".join(old_urls)}')

0 comments on commit 06f8e1b

Please sign in to comment.