Skip to content
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

PhenoSV error in hg19 #15

Open
weizhu365 opened this issue Feb 10, 2025 · 2 comments
Open

PhenoSV error in hg19 #15

weizhu365 opened this issue Feb 10, 2025 · 2 comments

Comments

@weizhu365
Copy link

I annotated multiple SVs from hg19 and got error. After some trouble-shooting, I found that several SVs caused the problem. Below is one of them:

chr1,144896297,144901046,1:144896297:DG,deletion

PhenoSV works for hg38 but not hg19 for this particular SV. The same problem can be reproduced using the online web version.

Could you explain why?

Thanks,

Wei

Wei Zhu

@Karenxzr
Copy link
Collaborator

Hi Wei, I updated codes for liftover from hg19 to hg38 for both website and the github codes. Please double check. Thanks.

Image

@weizhu365
Copy link
Author

Your change did work in one way, but failed when to process the csv input file:

python /data/zhuw10/git/PhenoSV/phenosv/model/phenosv.py --sv_file sp00103/sp_00.csv --target_folder TMP/ --target_file_name sp_00 --genome hg19 --model PhenoSV
Traceback (most recent call last):
File "/data/zhuw10/conda_envs/phenosv/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3621, in get_loc
return self._engine.get_loc(casted_key)
File "pandas/_libs/index.pyx", line 136, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 163, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 5198, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 5206, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'start'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/data/zhuw10/git/PhenoSV/phenosv/model/phenosv.py", line 177, in
main()
File "/data/zhuw10/git/PhenoSV/phenosv/model/phenosv.py", line 142, in main
sv_df[['START','END']] = sv_df.apply(lambda row: pd.Series(u.liftover_region(row['CHR'], row['start'], row['end'], converter)), axis=1)
File "/data/zhuw10/conda_envs/phenosv/lib/python3.10/site-packages/pandas/core/frame.py", line 8845, in apply
return op.apply().finalize(self, method="apply")
File "/data/zhuw10/conda_envs/phenosv/lib/python3.10/site-packages/pandas/core/apply.py", line 733, in apply
return self.apply_standard()
File "/data/zhuw10/conda_envs/phenosv/lib/python3.10/site-packages/pandas/core/apply.py", line 857, in apply_standard
results, res_index = self.apply_series_generator()
File "/data/zhuw10/conda_envs/phenosv/lib/python3.10/site-packages/pandas/core/apply.py", line 873, in apply_series_generator
results[i] = self.f(v)
File "/data/zhuw10/git/PhenoSV/phenosv/model/phenosv.py", line 142, in
sv_df[['START','END']] = sv_df.apply(lambda row: pd.Series(u.liftover_region(row['CHR'], row['start'], row['end'], converter)), axis=1)
File "/data/zhuw10/conda_envs/phenosv/lib/python3.10/site-packages/pandas/core/series.py", line 958, in getitem
return self._get_value(key)
File "/data/zhuw10/conda_envs/phenosv/lib/python3.10/site-packages/pandas/core/series.py", line 1069, in _get_value
loc = self.index.get_loc(label)
File "/data/zhuw10/conda_envs/phenosv/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3623, in get_loc
raise KeyError(key) from err
KeyError: 'start'

cat sp00103/sp_00.csv
chr1,144896297,144901046,1:144896297:DG,deletion

I guess that your revision introduced another bug into the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants