WGLab / PhenoSV

PhenoSV: Interpretable phenotype-aware model for the prioritization of genes affected by structural variants.
MIT License
16 stars 3 forks source link

Error for inversion #4

Closed tgong1 closed 5 months ago

tgong1 commented 6 months ago

Hi,

Thank you for developing this useful tool! I had successfully ran PhenoSV offline for DELs and DUPs. While I had a problem when using PhenoSV for inversions, please see the error message bellow. Using the same test bed file, I can use the web version without any problem. I'd like to use PhenoSV for more inversions, so really hope the command line tool can work. Please give me some suggestions on what I can do to solve the problem. Thank you a lot for your time and help!

Traceback (most recent call last): File "/scratch/gq19/tg2182/PhenoSV/phenosv/model/phenosv.py", line 175, in main() File "/scratch/gq19/tg2182/PhenoSV/phenosv/model/phenosv.py", line 148, in main pred = of.phenosv(None, None, None, None, sv_df, annotation_path, model, elements_path, feature_files, scaler_file, File "/scratch/gq19/tg2182/PhenoSV/phenosv/model/../model/operation_function.py", line 548, in phenosv sv = sv_transformation(CHR, START, END, svtype,ID,elements_path, annotation_path, None, None, full_mode = full_mode) File "/scratch/gq19/tg2182/PhenoSV/phenosv/model/../model/operation_function.py", line 237, in sv_transformation df1, anno1 = bke_to_sv(CHR, START, ID, elements_path, annotation_path,'inversion') File "/scratch/gq19/tg2182/PhenoSV/phenosv/model/../model/operation_function.py", line 170, in bke_to_sv end = int(start+1) TypeError: can only concatenate str (not "int") to str

Here is the test file I had used (sorry, github does not allow me to upload bed file, so just attached here): chr1 2785692 2786126 graphtyper_75_1_75 inversion chr1 12833357 13345613 graphtyper_307_1_307 inversion chr1 19578330 19611985 graphtyper_412_1_412 inversion

kaichop commented 5 months ago

@Karenxzr can you address the issue?

Karenxzr commented 5 months ago

@tgong1 Hi, thanks for your interest in PhenoSV. As the error suggested, I guess the coordinates were read as strings instead of integers. Without having your actual bed file, I can't make sure it is indeed the case. Can you double check your bed file to make sure? You can also use my sample bed file and change one del/dup into inversion to test. Also, I just added below codes to transform a str BKE into int. You can also git pull to avoid similar errors. Let me know if it works.

if isinstance(BKE,str):
      BKE = int(BKE)
tgong1 commented 5 months ago

Dear authors,

Thank you for the reply! "git pull" worked for me! PhenoSV worked perfectly for deletion, duplication, inversion and translocation, while I still have error messages for insertion as below, and manually change del and/or dup to "insertion" in your sample bed file still give me this error. Please let me know any suggestions to fix this. Thank you for your time and help!

Traceback (most recent call last): File "/scratch/gq19/tg2182/PhenoSV/phenosv/model/phenosv.py", line 175, in main() File "/scratch/gq19/tg2182/PhenoSV/phenosv/model/phenosv.py", line 148, in main pred = of.phenosv(None, None, None, None, sv_df, annotation_path, model, elements_path, feature_files, scaler_file, File "/scratch/gq19/tg2182/PhenoSV/phenosv/model/../model/operation_function.py", line 550, in phenosv sv = sv_transformation(CHR, START, END, svtype,ID,elements_path, annotation_path, None, None, full_mode = full_mode) File "/scratch/gq19/tg2182/PhenoSV/phenosv/model/../model/operation_function.py", line 229, in sv_transformation if END-START>1: TypeError: unsupported operand type(s) for -: 'str' and 'str'

Best, Tingting

Karenxzr commented 5 months ago

@tgong1 Hi, please git pull again and see the bug can be fixed now. Thank you!