-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't open bgen using symbolic links #42
Comments
Jordan,
Thanks for using Bgen-Reader!
I'll be able to look into this tomorrow. I wonder if you have write access to the *.bgen file's directory?
In any case, adding an option to put the *.mmm file in any directory seems like the right answer and that is likely what we'll do.
* Carl
From: Jordan Rossen ***@***.***>
Sent: Tuesday, June 07, 2022 7:58 AM
To: limix/bgen-reader-py ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [limix/bgen-reader-py] Can't open bgen using symbolic links (Issue #42)
Hello,
I want to use the numpy inspired API to open an bgen using a symbolic link. I want to do this because I don't want to create the .metadata2.mmm file in the shared directory where the bgen lives. I thought I recalled being able to do this in a previous version of bgen-reader, but am running into the following problem now.
from bgen_reader import open_bgen
wha = open_bgen('/n/holylfs05/LABS/liang_lab_l3/Lab/jordan/ssctpr/data/ukbb_symbolic_link/ukb_imp_chr1_v3.bgen')
Traceback (most recent call last):
File "", line 1, in
File "/n/home_fasse/jrossen/.conda/envs/ssctpr2/lib/python3.9/site-packages/bgen_reader/_bgen2.py", line 133, in init
assert_file_exist(filepath)
File "/n/home_fasse/jrossen/.conda/envs/ssctpr2/lib/python3.9/site-packages/bgen_reader/_file.py", line 14, in assert_file_exist
raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), filepath)
I don't have a very strong understanding of how PosixPath works, but after a little playing around, it seems like PosixPath precludes the use of symbolic links.
Either allowing for the use of symbolic links, or allowing the user to specify a directory where .metadata2.mmm should be created would solve my problem completely.
Thanks for making this software!
-
Reply to this email directly, view it on GitHub<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Flimix%2Fbgen-reader-py%2Fissues%2F42&data=05%7C01%7C%7Cf122f3122a244133143308da48962d84%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637902107101785825%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Csmdm8wELv3aKeKlHLljUI4eIs5fH8UKEJFh2SCk9Kc%3D&reserved=0>, or unsubscribe<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABR65P4NZAC4U3P7ZSZZC3TVN5PRFANCNFSM5YDIGANA&data=05%7C01%7C%7Cf122f3122a244133143308da48962d84%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637902107101785825%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ZEqkxE39TrV6eWCALOmeeG4cTCjb5EY4ZbchudfhbGg%3D&reserved=0>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.******@***.***>>
|
Jordan,
Here is a possible temporary fix.
Uninstall bgen-reader (for example, pip uninstall bgen-reader)
Then install my private version from GitHub:
pip install ***@***.***
Then you should be able to use a new 'metadata_filepath' in open_bgen. For example:
filepath = example_filepath("example.32bits.bgen")
with open_bgen(
filepath, metadata_filepath=r"m:\deldir\cmk.mmm", verbose=False
) as bgen2:
for num_threads in [1, 2]:
for slice in [np.s_[:, :], np.s_[:, []]]:
val = bgen2.read(index=slice, num_threads=num_threads)
row_count = len(bgen2.samples[slice[0]])
col_count = len(bgen2.ids[slice[1]])
assert val.shape == (row_count, col_count, 3)
Please, let me know if this works for you. In any case, I'll have time tomorrow to work on it.
* Carl
From: Carl K
Sent: Tuesday, June 07, 2022 8:14 AM
To: limix/bgen-reader-py ***@***.***>; limix/bgen-reader-py ***@***.***>
Cc: Subscribed ***@***.***>
Subject: RE: [limix/bgen-reader-py] Can't open bgen using symbolic links (Issue #42)
Jordan,
Thanks for using Bgen-Reader!
I'll be able to look into this tomorrow. I wonder if you have write access to the *.bgen file's directory?
In any case, adding an option to put the *.mmm file in any directory seems like the right answer and that is likely what we'll do.
* Carl
From: Jordan Rossen ***@***.******@***.***>>
Sent: Tuesday, June 07, 2022 7:58 AM
To: limix/bgen-reader-py ***@***.******@***.***>>
Cc: Subscribed ***@***.******@***.***>>
Subject: [limix/bgen-reader-py] Can't open bgen using symbolic links (Issue #42)
Hello,
I want to use the numpy inspired API to open an bgen using a symbolic link. I want to do this because I don't want to create the .metadata2.mmm file in the shared directory where the bgen lives. I thought I recalled being able to do this in a previous version of bgen-reader, but am running into the following problem now.
from bgen_reader import open_bgen
wha = open_bgen('/n/holylfs05/LABS/liang_lab_l3/Lab/jordan/ssctpr/data/ukbb_symbolic_link/ukb_imp_chr1_v3.bgen')
Traceback (most recent call last):
File "", line 1, in
File "/n/home_fasse/jrossen/.conda/envs/ssctpr2/lib/python3.9/site-packages/bgen_reader/_bgen2.py", line 133, in init
assert_file_exist(filepath)
File "/n/home_fasse/jrossen/.conda/envs/ssctpr2/lib/python3.9/site-packages/bgen_reader/_file.py", line 14, in assert_file_exist
raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), filepath)
I don't have a very strong understanding of how PosixPath works, but after a little playing around, it seems like PosixPath precludes the use of symbolic links.
Either allowing for the use of symbolic links, or allowing the user to specify a directory where .metadata2.mmm should be created would solve my problem completely.
Thanks for making this software!
-
Reply to this email directly, view it on GitHub<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Flimix%2Fbgen-reader-py%2Fissues%2F42&data=05%7C01%7C%7Cf122f3122a244133143308da48962d84%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637902107101785825%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Csmdm8wELv3aKeKlHLljUI4eIs5fH8UKEJFh2SCk9Kc%3D&reserved=0>, or unsubscribe<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABR65P4NZAC4U3P7ZSZZC3TVN5PRFANCNFSM5YDIGANA&data=05%7C01%7C%7Cf122f3122a244133143308da48962d84%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637902107101785825%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ZEqkxE39TrV6eWCALOmeeG4cTCjb5EY4ZbchudfhbGg%3D&reserved=0>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.******@***.***>>
|
Was there some censoring done by github? Your message reads: Then install my private version from GitHub: |
Addressed by #44 |
Hi Carl, the update is working great! Sorry for taking so long to try it out. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I want to use the numpy inspired API to open an bgen using a symbolic link. I want to do this because I don't want to create the .metadata2.mmm file in the shared directory where the bgen lives. I thought I recalled being able to do this in a previous version of bgen-reader, but am running into the following problem now.
from bgen_reader import open_bgen
wha = open_bgen('/n/holylfs05/LABS/liang_lab_l3/Lab/jordan/ssctpr/data/ukbb_symbolic_link/ukb_imp_chr1_v3.bgen')
Traceback (most recent call last):
File "", line 1, in
File "/n/home_fasse/jrossen/.conda/envs/ssctpr2/lib/python3.9/site-packages/bgen_reader/_bgen2.py", line 133, in init
assert_file_exist(filepath)
File "/n/home_fasse/jrossen/.conda/envs/ssctpr2/lib/python3.9/site-packages/bgen_reader/_file.py", line 14, in assert_file_exist
raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), filepath)
I don't have a very strong understanding of how PosixPath works, but after a little playing around, it seems like PosixPath precludes the use of symbolic links.
Either allowing for the use of symbolic links, or allowing the user to specify a directory where .metadata2.mmm should be created would solve my problem completely.
Thanks for making this software!
The text was updated successfully, but these errors were encountered: