Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions example/example_data.map
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
1 1 0 0

1 2 19.5 15000000

pos chr cM
0 1 0
15000000 1 19.5
6 changes: 4 additions & 2 deletions src/threads_arg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ def read_map_file(map_file, expected_chromosome=None) -> Tuple[np.ndarray, np.nd


def _read_pgen_physical_positions(pgen_file):
pvar = pgen_file.replace("pgen", "pvar")
bim = pgen_file.replace("pgen", "bim")
if not pgen_file.endswith("pgen"):
raise ValueError(f"Cannot find .pvar or .bim files, {pgen_file} does not end with 'pgen'.")
pvar = pgen_file.rstrip("pgen") + "pvar"
bim = pgen_file.rstrip("pgen") + "bim"
physical_positions = None
if os.path.isfile(bim):
physical_positions = np.array(pd.read_table(bim, sep="\\s+", header=None, comment='#')[3]).astype(np.float64)
Expand Down
Loading