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

Covar and new ANGSD 2D SFS #2

Closed
dmvelasco opened this issue Jul 22, 2015 · 5 comments
Closed

Covar and new ANGSD 2D SFS #2

dmvelasco opened this issue Jul 22, 2015 · 5 comments

Comments

@dmvelasco
Copy link

I am having trouble getting ngsCovar to play nice with the 2D SFS from the recent version of ANGSD.

As mentioned, I am trying to use a 2D SFS from the new ANGSD output because it is quite simple to generate. (It does output all values in a single line, but I converted it to matrix of (2N1+1)x(2N2+2) as noted in the ngs2dSFS documentation.) The consistently produced error is -> Possible error reading SFS, binary file might be broken....

Granted the file may be incorrect because I notice that in the ngsCovar documentation it states the SFS file contains sample allele frequency posterior probabilities while the ANGSD 2D SFS documentation states its output ANGSD contains the expected values. Additionally, the file is plain text.

Any help or suggestions would be greatly appreciated and please let me know if you need additional information.

@mfumagalli
Copy link
Owner

The -sfsfile taken by ngsCovar is not the (global) 2D-SFS but rather the per-site allele frequency probabilities (.saf files). Also, remember that the latter file should be produced by ANGSD <0.800 otherwise the new file format in ANSGD is not supported ngsTools. Additionally, rather than using the -sfsfile option (and thus weighting each site but its probability of being variable) you can try to perform a non-stringent SNP calling (e.g. with ANGSD or using -minMaf in nsgCovar) and avoid using -sfsfile.

@ANGSD
Copy link

ANGSD commented Jul 22, 2015

You should be able to generate the old format from the new format.
Using the realSFS subprogram. This will also select the overlapping sites per default.

On 22 Jul 2015, at 10:55, Matteo Fumagalli notifications@github.com wrote:

The -sfsfile taken by ngsCovar is not the (global) 2D-SFS but rather the per-site allele frequency probabilities (.saf files). Also, remember that the latter file should be produced by ANGSD <0.800 otherwise the new file format in ANSGD is not supported ngsTools. Additionally, rather than using the -sfsfile option (and thus weighting each site but its probability of being variable) you can try to perform a non-stringent SNP calling (e.g. with ANGSD or using -minMaf in nsgCovar) and avoid using -sfsfile.


Reply to this email directly or view it on GitHub #2 (comment).

@dmvelasco
Copy link
Author

Matteo - many thanks for your response. Yes, I had suspected the -sfsfile used might be the .saf file (there are a couple inconsistencies in the documentation that made it unclear) and tried it too. However, since it was produced by ANGSD >0.800, it too did not work. Initially I had used -minMaf in ngsCovar, but the lowest coverage samples grouped together, which was the reason for wanting to try the weighted method.

ANGSD - thanks! To confirm, the conversion from new to old versions is via realSFS print? This is how it looked from the SFS Estimation page at popgen.dk/angsd. I will give it a try.

Thanks again for your replies!

@ANGSD
Copy link

ANGSD commented Jul 22, 2015

On 22 Jul 2015, at 18:13, Dianne Velasco notifications@github.com wrote:

ANGSD - thanks! To confirm, the conversion from new to old versions is via realSFS print? This is how it looked from the SFS Estimation page at popgen.dk/angsd http://popgen.dk/angsd. I will give it a try.

Exactly.

You use the print option of the ./realSFS program, but by also supplying -oldout 1. Otherwise it will print the safs to the screen.
I’ve updated the http://www.popgen.dk/angsd http://popgen.dk/angsd wiki and the ./realSFS subprogram in the latests commit. If users write ./realSFS print without any arguments it will now printout some examples.

@dmvelasco
Copy link
Author

Apologies for the delay reporting back as I had to put working on this aside temporarily. However, I am happy to report that it is working. Thanks again for all your help.

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