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

ValueError: could not convert string to float #48

Open
IzabelaIbraim opened this issue Mar 3, 2020 · 0 comments
Open

ValueError: could not convert string to float #48

IzabelaIbraim opened this issue Mar 3, 2020 · 0 comments

Comments

@IzabelaIbraim
Copy link

Hello,
I been getting different errors when running IDR.

If I run Idr v2.0.2 I get the following error:
./idr --input-file-type bed --rank 7 --plot --verbose --samples peaks_TGATCA_clean.bed peaks_PrNotT_clean.bed
Loading the peak files
Merging peaks
Ranking peaks
Initial parameter values: [0.10 1.00 0.20 0.50]
Fitting the model parameters
Iter 0 1.57e+00 4.57e-01 [0.09023906 0.71172818 0.98999476 0.98043616]
Iter 1 2.36e-01 3.29e-01 [0.1093229 0.49997562 0.98999476 0.9755989 ]
Iter 2 1.56e-01 2.29e-01 [0.1093229 0.34967449 0.98999476 0.97019152]
Iter 3 1.12e-01 1.59e-01 [0.1093229 0.24417437 0.98999476 0.96406317]
Iter 4 4.48e-02 6.87e-02 [0.1093229 0.20000658 0.98999476 0.96466309]
Iter 5 2.89e-03 3.72e-03 [0.1093229 0.20000658 0.98999476 0.9675544 ]
Iter 6 1.44e-03 1.86e-03 [0.1093229 0.20000658 0.98999476 0.96899706]
Iter 7 7.46e-04 9.61e-04 [0.1093229 0.20000658 0.98999476 0.96974351]
Iter 8 3.85e-04 4.96e-04 [0.1093229 0.20000658 0.98999476 0.9701287 ]
Iter 9 2.01e-04 2.58e-04 [0.1093229 0.20000658 0.98999476 0.97032952]
Iter 10 1.06e-04 1.36e-04 [0.1093229 0.20000658 0.98999476 0.97043521]
Iter 11 5.60e-05 7.20e-05 [0.1093229 0.20000658 0.98999476 0.97049116]
Iter 12 2.97e-05 3.82e-05 [0.1093229 0.20000658 0.98999476 0.97052088]
Iter 13 1.58e-05 2.04e-05 [0.1093229 0.20000658 0.98999476 0.9705367 ]
Iter 14 8.42e-06 1.08e-05 [0.1093229 0.20000658 0.98999476 0.97054513]
Iter 15 4.49e-06 5.78e-06 [0.1093229 0.20000658 0.98999476 0.97054962]
Iter 16 2.39e-06 3.08e-06 [0.1093229 0.20000658 0.98999476 0.97055201]
Iter 17 0.00e+00 0.00e+00 [0.1093229 0.20000658 0.98999476 0.97055201]
Finished running IDR on the datasets
Final parameter values: [0.11 0.20 0.99 0.97]
Writing results to file
./idr --input-file-type bed --rank 7 --plot --verbose --samples peaks_TGATCA_clean.bed peaks_PrNotT_clean.bed
Traceback (most recent call last):
File "./idr", line 10, in
idr.idr.main()
File "/rhome/icoimbra/.conda/envs/py3_env/lib/python3.7/site-packages/idr-2.0.2-py3.7-linux-x86_64.egg/idr/idr.py", line 774, in main
useBackwardsCompatibleOutput=args.use_old_output_format)
File "/rhome/icoimbra/.conda/envs/py3_env/lib/python3.7/site-packages/idr-2.0.2-py3.7-linux-x86_64.egg/idr/idr.py", line 415, in write_results_to_file
if localIDRs == None or IDRs == None:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

If I run Idr v2.0.3 I get:
./idr --input-file-type bed --rank 7 --plot --verbose --samples ENCFF437QMO.bed ENCFF025CWO.bed
Traceback (most recent call last):
File "./idr", line 10, in
idr.idr.main()
File "/rhome/icoimbra/.conda/envs/py3_env/lib/python3.7/site-packages/idr-2.0.3-py3.7-linux-x86_64.egg/idr/idr.py", line 828, in main
merged_peaks, signal_type = load_samples(args)
File "/rhome/icoimbra/.conda/envs/py3_env/lib/python3.7/site-packages/idr-2.0.3-py3.7-linux-x86_64.egg/idr/idr.py", line 726, in load_samples
f1, f2 = [load_bed(fp, signal_index) for fp in args.samples]
File "/rhome/icoimbra/.conda/envs/py3_env/lib/python3.7/site-packages/idr-2.0.3-py3.7-linux-x86_64.egg/idr/idr.py", line 726, in
f1, f2 = [load_bed(fp, signal_index) for fp in args.samples]
File "/rhome/icoimbra/.conda/envs/py3_env/lib/python3.7/site-packages/idr-2.0.3-py3.7-linux-x86_64.egg/idr/idr.py", line 64, in load_bed
float(data[6]), float(data[7]), float(data[8])
ValueError: could not convert string to float: 'chr1_minus_88541_827795'

My bed files were generated using grit (following scrip from encode rampage protocol) and are organized as follow:

chr1 629361 629492 TSS_chr1_minus_13397_827795_pk1 1000 - 15.0 chr1_minus_13397_827795 chr1_minus_13397_827795 TSS_chr1_minus_13397_827795_pk1 1.0,0.0,0.0,0.0,0.0,0.0,1.0,2.0,0.0,0.0,0.0,0.0,0.0,0.0$
chr1 629580 629610 TSS_chr1_minus_13397_827795_pk2 1000 - 17.0 chr1_minus_13397_827795 chr1_minus_13397_827795 TSS_chr1_minus_13397_827795_pk2 2.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0$
chr1 629639 629939 TSS_chr1_plus_629080_634923_pk1 1000 + 1646.0 chr1_plus_629080_634923 chr1_plus_629080_634923 TSS_chr1_plus_629080_634923_pk1 270.0,0.0,0.0,1.0,79.0,6.0,4.0,2.0,3.0,23.0,8.0,97.0,0.$
chr1 629752 629867 TSS_chr1_minus_13397_827795_pk3 1000 - 37.0 chr1_minus_13397_827795 chr1_minus_13397_827795 TSS_chr1_minus_13397_827795_pk3 2.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.0,0.0,1.0$
chr1 629968 630009 TSS_chr1_minus_13397_827795_pk4 1000 - 97.0 chr1_minus_13397_827795 chr1_minus_13397_827795 TSS_chr1_minus_13397_827795_pk4 41.0,0.0,0.0,0.0,3.0,0.0,0.0,0.0,0.0,3.0,0.0,0.0,0.0$

I am using Python 3.7.6

How do I work around this?

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

1 participant