Mercurial > repos > tduigou > cloning_simulation
comparison cloning_simulation.py @ 3:044d36066cb3 draft
planemo upload for repository https://github.com/Edinburgh-Genome-Foundry/DnaCauldron/tree/master commit 6ae809b563b40bcdb6be2e74fe2a84ddad5484ae
| author | tduigou |
|---|---|
| date | Fri, 16 May 2025 12:40:59 +0000 |
| parents | 3171db614963 |
| children | 07e902da89ad |
comparison
equal
deleted
inserted
replaced
| 2:3171db614963 | 3:044d36066cb3 |
|---|---|
| 109 arcname = os.path.relpath(full_path, outdir_simulation) | 109 arcname = os.path.relpath(full_path, outdir_simulation) |
| 110 zipf.write(full_path, arcname) | 110 zipf.write(full_path, arcname) |
| 111 #print("Files in the zip archive:") | 111 #print("Files in the zip archive:") |
| 112 #for info in zipf.infolist(): | 112 #for info in zipf.infolist(): |
| 113 #print(info.filename) | 113 #print(info.filename) |
| 114 with zipfile.ZipFile(output_simulation, 'r') as zipf: | |
| 115 for member in zipf.namelist(): | 114 for member in zipf.namelist(): |
| 116 # Only extract actual files inside 'all_construct_records/' (not subfolders) | 115 # Only extract actual files inside 'all_construct_records/' (not subfolders) |
| 117 if member.startswith("all_construct_records/") and not member.endswith("/"): | 116 if member.startswith("assambly_simulation/all_construct_records/") and not member.endswith("/"): |
| 118 # Get the file name only (strip folder path) | 117 # Get the file name only (strip folder path) |
| 119 filename = os.path.basename(member) | 118 filename = os.path.basename(member) |
| 120 if not filename: | 119 if not filename: |
| 121 continue # skip any edge cases | 120 continue # skip any edge cases |
| 122 | 121 |
