isaacovercast / easySFS

Effective selection of population size projection for construction of the site frequency spectrum. Convert VCF to dadi/fastsimcoal style SFS for demographic analysis
124 stars 23 forks source link

Plotting SFS #54

Open clorenzo1 opened 1 year ago

clorenzo1 commented 1 year ago

Hi Issac,

I want to produce some plots from the 2D sfs as this important when comparing the models to the empirical data. I also want to view the Fst values calculated by dadi for each pair of populations. I added the following code under line 108:

    a=dadi.Plotting.plot_single_2d_sfs(fs,vmin=1) 
    pyplot.savefig('Plot_FS_dadi_.png')
    pyplot.savefig('Plot_FS_dadi_.svg')
    print("FST_measure_by_dadi",fs.Fst())

The Fst values print fine, but I only manage to produce two plots that are very strange and distorted as follows:

Plot_FS_dadi_

Is there a way to produce plots for each 1D sfs and also for each 2D sfs?

Best wishes,

Coral

isaacovercast commented 1 year ago

Hi Coral, That is a great question that I do not know the answer to! If you figure it out please submit a pull request and I'll merge it into the main branch. :) -isaac