Skip to content

Commit

Permalink
escape s+
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocamilloni committed Feb 7, 2025
1 parent 2bb976b commit ec908fb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/multiego/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def read_molecular_contacts(path, ensemble_molecules_idx_sbtype_dictionary, simu

contact_matrix = pd.DataFrame()
if not h5:
contact_matrix = pd.read_csv(path, header=None, sep="\s+", names=col_names, dtype=col_types)
contact_matrix = pd.read_csv(path, header=None, sep=r"\s+", names=col_names, dtype=col_types)
contact_matrix["learned"] = contact_matrix["learned"].fillna(1).astype(bool)
else:
contact_matrix = pd.read_hdf(path, key="data", dtype=col_types)
Expand Down
4 changes: 2 additions & 2 deletions tools/make_mat/make_mat.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ def read_mat(name, protein_ref_indices, args, cumulative=False):
path_prefix = f"{args.histo}"
if args.tar:
with tarfile.open(args.histo, "r:*") as tar:
ref_df = pd.read_csv(tar.extractfile(name), header=None, sep="\s+", usecols=[0, *protein_ref_indices])
ref_df = pd.read_csv(tar.extractfile(name), header=None, sep=r"\s+", usecols=[0, *protein_ref_indices])
ref_df_columns = ["distance", *[str(x) for x in protein_ref_indices]]
ref_df.columns = ref_df_columns
ref_df.set_index("distance", inplace=True)
else:
if args.noh5:
ref_df = pd.read_csv(f"{path_prefix}/{name}", header=None, sep="\s+", usecols=[0, *protein_ref_indices])
ref_df = pd.read_csv(f"{path_prefix}/{name}", header=None, sep=r"\s+", usecols=[0, *protein_ref_indices])
ref_df_columns = ["distance", *[str(x) for x in protein_ref_indices]]
ref_df.columns = ref_df_columns
ref_df.set_index("distance", inplace=True)
Expand Down
2 changes: 1 addition & 1 deletion tools/make_mat/ndx2HDF5.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
}

# Read the input file with specified column names and data types
contact_matrix = pd.read_csv(args.input_file, header=None, sep="\s+", names=col_names, dtype=col_types)
contact_matrix = pd.read_csv(args.input_file, header=None, sep=r"\s+", names=col_names, dtype=col_types)
contact_matrix["learned"] = contact_matrix["learned"].fillna(1).astype(bool)

contact_matrix["molecule_name_ai"] = contact_matrix["molecule_name_ai"].astype("category")
Expand Down

0 comments on commit ec908fb

Please sign in to comment.