ArnovanHilten / GenNet

Framework for Interpretable Neural Networks
Apache License 2.0
91 stars 14 forks source link

ValueError during hase_convert from plink files #87

Closed lnalinaf closed 1 year ago

lnalinaf commented 1 year ago

Hey Arno!

I'm trying to convert plink files (just for 1 sample) with GenNet -convert and have tried steps all and only hase_convert, the following problem occurred: python GenNet/GenNet.py convert -g /content/plink_files -study_name hase_convert -o /content/hase_convert -step hase_convert

Traceback (most recent call last): File "GenNet/GenNet.py", line 284, in <module> main() File "GenNet/GenNet.py", line 28, in main convert(args) File "/content/GenNet/GenNet_utils/Convert.py", line 464, in convert hase_convert(args) File "/content/GenNet/GenNet_utils/Convert.py", line 40, in hase_convert G.plink2hdf5(out=args.out) File "/content/GenNet/GenNet_utils/hase/hdgwas/converter.py", line 160, in plink2hdf5 self.convert_individuals() File "/content/GenNet/GenNet_utils/hase/hdgwas/converter.py", line 77, in convert_individuals individuals = self.reader.folder.get_fam() File "/content/GenNet/GenNet_utils/hase/hdgwas/data.py", line 992, in get_fam ind = genfromtxt(open(os.path.join(self.path, i + '.fam'), 'r'), delimiter=' ', File "/usr/local/lib/python3.8/dist-packages/numpy/lib/npyio.py", line 2221, in genfromtxt rows = np.array(data, dtype=[('', _) for _ in dtype_flat]) ValueError: could not assign tuple of length 1 to structure with 6 fields. Closing remaining open files:/content/hase_convert/individuals/hase_convert.h5...done

Many thanks, Alina

ArnovanHilten commented 1 year ago

Hi Alina,

I am sorry that you experience issues in the conversion. I have tried to make the tool as accessibele as I could but unfortunatly I could not test all configurations. I have seen this issue once before with a plink2 files. Unfortunatly, I did not resolve the issue for plink2 fuiles yet and I will not have much time until Januari because of some upcoming deadlines.

I will look into it but I need to find time for it.

Best, Arno

lnalinaf commented 1 year ago

Hi Arno,

Seems that I found the possible reason for such a mistake, it appears when in ALT column multi-allelic variant is presented.

Best, Alina