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

vcf2bgc.py file #8

Closed
Irvilma opened this issue Apr 14, 2021 · 6 comments
Closed

vcf2bgc.py file #8

Irvilma opened this issue Apr 14, 2021 · 6 comments

Comments

@Irvilma
Copy link

Irvilma commented Apr 14, 2021

Hello,

I'm trying to convert my vcf file (from ipyrad) to bcg using vcf2bgc.py file. For this, I'm using your example data files download from DRYAD but I get an error:

./vcf2bgc.py -v eatt.trans.finalfilt.recode.vcf -m eatt.bgc.popmap_final.txt --p1 PureEA --p2 PureTT --admixed EATT -o example_tutorial

P1 population has 8 individuals...

P2 population has 8 individuals...

Admixed populalation has 85 individuals...

Processing 233 records in VCF file...

Traceback (most recent call last):
File "./vcf2bgc.py", line 378, in
main()
File "./vcf2bgc.py", line 140, in main
normalize_linkagemap(pos_list, pos_min, pos_max, chrom_number, linkage_fh, locus_list)
File "./vcf2bgc.py", line 192, in normalize_linkagemap
mylist[i] = (val - nmin) / (nmax - nmin)
ZeroDivisionError: integer division or modulo by zero

Does anybody have an idea what is wrong? Any help would be appreciated.
The same error occurs with my own data.

The package is really helpful, congrats!
Thank you!

@btmartin721
Copy link
Owner

Hello,

Thank you for your interest in ClineHelpR. I will look into what may be happening with the vcf2bgc.py script this evening. Sorry for the issue.

@btmartin721
Copy link
Owner

Hello,

The issue should be fixed now. Please do a git pull to update the vcf2bgc.py script and try running it again. Let me know if you are still having issues with the script.

The problem was that I had accidentally turned the linkage model on by default, but it should have to be toggled on to use it. Because the example file as well as your own data file had chromosomes with only one site, the script was dividing by zero when it tried to normalize the position maps between 0 and 1.

I turned the option to generate linkage maps off by default now, and I added error handling for if the linkage map file has chromosomes with only one position.

Thanks,

-Bradley

@Irvilma
Copy link
Author

Irvilma commented Apr 15, 2021 via email

@tkchafin tkchafin reopened this Apr 15, 2021
@tkchafin
Copy link
Collaborator

Hi Irene,

It looks like the list.clear() which is throwing the error was added in Python 3.3, so I'm guessing you are using an older version of Python than 3.3. I just added a fix that should work with Python3 versions older than 3.3, could you give that a try?

Thanks,
Tyler

@Irvilma
Copy link
Author

Irvilma commented Apr 15, 2021 via email

@btmartin721
Copy link
Owner

You're very welcome. Glad to see it's working now. Thanks for your interest in ClineHelpR.

-Bradley

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

3 participants