Hi Ryan,
Thanks for your prompt response.
I modified the SNP's names in the vcf, run easySFS to generate the FS using the new vcf and then created the dictionary again. However, the problem persists. I also avoided having SNP's names that start with 0, it seems that python doesn't like it. However, I don't know what else to try. Here is my new code (I'm showing the structure of the dictionary and it seems to be in the expected format for the function):
# In case it's helpful, this is the command I'm using in easySFS:
./easySFS.py -i ./DownMigrant.UppeMig.SNPsdadi2.vcf -p
./popAssign_OneDownOneUp.txt -a --proj=138,180
# New FS
fs = dadi.Spectrum.from_file("./downstreamM-upstreamM.sfs")
print(fs)
[[-- 50364.40973840228 19506.52545925824 ... -- -- --]
[37822.78653369307 21542.67582831754 12012.46117673672 ... -- -- --]
[9776.239861528618 7356.083052229609 5033.494801393011 ... -- -- --]
...
[8.88972787591124e-22 8.182693911379928e-20 3.620665138082356e-18 ... --
-- --]
[1.240025583782837e-22 1.141390025356761e-20 5.050344781452131e-19 ...
-- -- --]
[7.63775735436711e-24 7.030211704540504e-22 3.110672857641352e-20 ... --
-- --]]
# the 2D plot looks the same as before
# New vcf
vcf = "./DownMigrant.UppeMig.SNPsdadi2.vcf"
vcfDict = dadi.Misc.make_data_dict_vcf(vcf, './popAssign_OneDownOneUp.txt')
# Does the dictionary have the expected format? (chrom_pos): yes
first_four = dict(islice(vcfDict.items(), 4))
print(first_four)
{'chr048565_20048': {'segregating': ('G', 'A'), 'context': '-G-', 'outgroup_allele': '-', 'outgroup_context': '---', 'calls': {'downstreamM': (0, 194), 'upstreamM': (0, 296)}}, 'chr048565_20049': {'segregating': ('T', 'A'), 'context': '-T-', 'outgroup_allele': '-', 'outgroup_context': '---', 'calls': {'downstreamM': (0, 194), 'upstreamM': (0, 296)}}, 'chr048565_20087': {'segregating': ('C', 'A'), 'context': '-C-', 'outgroup_allele': '-', 'outgroup_context': '---', 'calls': {'downstreamM': (0, 194), 'upstreamM': (0, 296)}}, 'chr048565_20111': {'segregating': ('T', 'G'), 'context': '-T-', 'outgroup_allele': '-', 'outgroup_context': '---', 'calls': {'downstreamM': (0, 194), 'upstreamM': (0, 296)}}}
# Bootstrap
Nboot, chunk_size = 100, 2e7
chunks = dadi.Misc.fragment_data_dict(vcfDict, chunk_size)
pop_ids, ns = ["downstreamM", "upstreamM"] , [138, 180] # I'm using the same samples as the downprojection in easySFS
boots = dadi.Misc.bootstraps_from_dd_chunks(chunks, Nboot, pop_ids, ns)
# content of boots fs: all have 0's and a single 1 as the last entry (I also opened the files)
print(boots[13])
[[-- 0.0 0.0 ... 0.0 0.0 0.0]
[0.0 0.0 0.0 ... 0.0 0.0 0.0]
[0.0 0.0 0.0 ... 0.0 0.0 0.0]
...
[0.0 0.0 0.0 ... 0.0 0.0 0.0]
[0.0 0.0 0.0 ... 0.0 0.0 0.0]
[0.0 0.0 0.0 ... 0.0 0.0 --]]
I'd appreciate any further guidance.
Thank you in advance