Skip to content

Commit

Permalink
Use pyarrow for reading csvs
Browse files Browse the repository at this point in the history
  • Loading branch information
endast committed Dec 6, 2023
1 parent 4ac78cd commit 93fa488
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deeprvat/preprocessing/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ def process_sparse_gt_file(
samples: List[str],
calls_to_exclude: pd.DataFrame = None,
) -> Tuple[List[np.ndarray], List[np.ndarray]]:
sparse_gt = pd.read_csv(
sparse_gt = pd.read_table(
file,
names=["chrom", "pos", "ref", "alt", "sample", "gt"],
sep="\t",
engine="pyarrow",
index_col=None,
)
sparse_gt = sparse_gt[sparse_gt["sample"].isin(samples)]
Expand Down Expand Up @@ -183,7 +183,7 @@ def process_sparse_gt(
logging.info("Reading variants...")
start_time = time.time()

variants = pd.read_csv(variant_file, sep="\t")
variants = pd.read_table(variant_file, engine="pyarrow")

# Filter all variants based on chromosome
if chromosomes is not None:
Expand Down

0 comments on commit 93fa488

Please sign in to comment.