hardingnj / xpclr

Code to compute the XP-CLR statistic to infer natural selection
MIT License
87 stars 28 forks source link

AttributeError: 'NoneType' object has no attribute 'keys' #88

Open xibeixingchen opened 1 year ago

xibeixingchen commented 1 year ago

Hi,

When I code xpclr --format vcf --input small.vcf.gz --samplesA samplesA.txt --samplesB samplesB.txt --maxsnps 50 --size 1000 --step 1000 --out xpclr_1_2_Chr1.txt --chr 1L, and a error is found as following. I used fixture files. What happend?

2022-11-19 11:02:57 : INFO : running xpclr v1.1.2 2022-11-19 11:02:57 : INFO : Loading VCF /home/jiazc/miniconda3/lib/python3.8/site-packages/allel/io/vcf_read.py:1240: UserWarning: 'None' INFO header not found warnings.warn('%r INFO header not found' % name) /home/jiazc/miniconda3/lib/python3.8/site-packages/allel/io/vcf_read.py:1454: UserWarning: no type for field 'variants/None', assuming object warnings.warn('no type for field %r, assuming %s' % (f, normed_types[f])) Traceback (most recent call last): File "/home/jiazc/miniconda3/bin/xpclr", line 4, in import('pkg_resources').run_script('xpclr==1.1.2', 'xpclr') File "/home/jiazc/miniconda3/lib/python3.8/site-packages/pkg_resources/init.py", line 672, in run_script self.require(requires)[0].run_script(script_name, ns) File "/home/jiazc/miniconda3/lib/python3.8/site-packages/pkg_resources/init.py", line 1479, in run_script exec(script_code, namespace, namespace) File "/home/jiazc/miniconda3/lib/python3.8/site-packages/xpclr-1.1.2-py3.8.egg/EGG-INFO/scripts/xpclr", line 196, in File "/home/jiazc/miniconda3/lib/python3.8/site-packages/xpclr-1.1.2-py3.8.egg/EGG-INFO/scripts/xpclr", line 97, in main File "/home/jiazc/miniconda3/lib/python3.8/site-packages/xpclr-1.1.2-py3.8.egg/xpclr/util.py", line 134, in load_vcf_format_data File "/home/jiazc/miniconda3/lib/python3.8/site-packages/xpclr-1.1.2-py3.8.egg/xpclr/util.py", line 118, in load_vcf_wrapper AttributeError: 'NoneType' object has no attribute 'keys',

Through there are some same issues, and I found my issues is different.

Best, Zhicheng Jia

Mirror1211 commented 1 year ago

请问你的问题解决了么?我也遇到了相同的问题

xibeixingchen commented 1 year ago

请问你的问题解决了么?我也遇到了相同的问题 没有,换了C+XPCLR,但是会出现段错误。迷惑

Mirror1211 commented 1 year ago

我的联系超算管理员直接用conda安装的成功过了. old school的安装方法解决不了。

2022-11-25 17:50:30 "zhicheng jia" @.***> 写道:

请问你的问题解决了么?我也遇到了相同的问题 没有,换了C+XPCLR,但是会出现段错误。迷惑

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

dhimanamar commented 1 year ago

Hi, I am also encountering the same error message. The error looks like:

2023-03-28 11:39:11 : INFO : running xpclr v1.1.2 2023-03-28 11:39:11 : INFO : Loading VCF Traceback (most recent call last): File "/data/modules/python/python-miniconda3-qiime/envs/xpclr/bin/xpclr", line 196, in main() File "/data/modules/python/python-miniconda3-qiime/envs/xpclr/bin/xpclr", line 97, in main g1, g2, positions, genetic_dist = xpclr.util.load_vcf_format_data( File "/data/modules/python/python-miniconda3-qiime/envs/xpclr/lib/python3.10/site-packages/xpclr/util.py", line 133, in load_vcf_format_data pos1, geno1 = load_vcf_wrapper(vcf_fn, chrom, samples1, s1) File "/data/modules/python/python-miniconda3-qiime/envs/xpclr/lib/python3.10/site-packages/xpclr/util.py", line 119, in load_vcf_wrapper assert "samples" in callset.keys(), "None of the samples provided in {0!r} are found in {1!r}".format( AttributeError: 'NoneType' object has no attribute 'keys'

Does anyone have an idea? Best, Amar

Hi,

When I code xpclr --format vcf --input small.vcf.gz --samplesA samplesA.txt --samplesB samplesB.txt --maxsnps 50 --size 1000 --step 1000 --out xpclr_1_2_Chr1.txt --chr 1L, and a error is found as following. I used fixture files. What happend?

2022-11-19 11:02:57 : INFO : running xpclr v1.1.2 2022-11-19 11:02:57 : INFO : Loading VCF /home/jiazc/miniconda3/lib/python3.8/site-packages/allel/io/vcf_read.py:1240: UserWarning: 'None' INFO header not found warnings.warn('%r INFO header not found' % name) /home/jiazc/miniconda3/lib/python3.8/site-packages/allel/io/vcf_read.py:1454: UserWarning: no type for field 'variants/None', assuming object warnings.warn('no type for field %r, assuming %s' % (f, normed_types[f])) Traceback (most recent call last): File "/home/jiazc/miniconda3/bin/xpclr", line 4, in import('pkg_resources').run_script('xpclr==1.1.2', 'xpclr') File "/home/jiazc/miniconda3/lib/python3.8/site-packages/pkg_resources/init.py", line 672, in run_script self.require(requires)[0].run_script(script_name, ns) File "/home/jiazc/miniconda3/lib/python3.8/site-packages/pkg_resources/init.py", line 1479, in run_script exec(script_code, namespace, namespace) File "/home/jiazc/miniconda3/lib/python3.8/site-packages/xpclr-1.1.2-py3.8.egg/EGG-INFO/scripts/xpclr", line 196, in File "/home/jiazc/miniconda3/lib/python3.8/site-packages/xpclr-1.1.2-py3.8.egg/EGG-INFO/scripts/xpclr", line 97, in main File "/home/jiazc/miniconda3/lib/python3.8/site-packages/xpclr-1.1.2-py3.8.egg/xpclr/util.py", line 134, in load_vcf_format_data File "/home/jiazc/miniconda3/lib/python3.8/site-packages/xpclr-1.1.2-py3.8.egg/xpclr/util.py",line 118, in load_vcf_wrapper AttributeError: 'NoneType' object has no attribute 'keys',

Through there are some same issues, and I found my issues is different.

Best, Zhicheng Jia