Skip to content

Commit

Permalink
Only read the file in one place
Browse files Browse the repository at this point in the history
  • Loading branch information
endast committed Oct 15, 2023
1 parent e29fcc0 commit 7be1915
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions deeprvat/annotations/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1139,16 +1139,14 @@ def concat_annotations(pvcf_blocks_file:str, annotation_dir:str, filename_patter
]
for f in tqdm(file_paths):
logger.info(f"processing file {f}")
file = pd.read_parquet(f)
logger.info(file.shape)
logger.info(file.columns)

if f == file_paths[0]:
logger.info("creating new file")
file = pd.read_parquet(f)
logger.info(file.shape)
logger.info(file.columns)
file.to_parquet(out_file, engine= "fastparquet")
else:
file = pd.read_parquet(f)
logger.info(file.shape)
logger.info(file.columns)
try:
file.to_parquet(out_file, engine= "fastparquet", append=True)
except ValueError:
Expand Down

0 comments on commit 7be1915

Please sign in to comment.