brentp / peddy

genotype :: ped correspondence check, ancestry check, sex check. directly, quickly on VCF
MIT License
134 stars 39 forks source link

Matplotlib issue? 'c' argument looks like a single numeric RGB or RGBA sequence #77

Closed julieefeusier closed 4 years ago

julieefeusier commented 4 years ago

Hi,

I downloaded peddy 0.4.5 and received this error when I tried to run the example in the peddy directory. I received the same error whether I used conda or github to install peddy. Thank you.

$ conda update --all $ python -V Python 3.7.6 $ peddy --version peddy, version 0.4.5

$ python -m peddy -p 4 --plot --prefix ceph-1463 data/ceph1463.peddy.vcf.gz data/ceph1463.ped

2020-03-23 09:24:16 lonepeak11 peddy.cli[2755] INFO Running Peddy version 0.4.5 2020-03-23 09:24:16 lonepeak11 peddy.cli[2755] INFO ped_check 2020-03-23 09:24:16 lonepeak11 numexpr.utils[2755] INFO Note: NumExpr detected 24 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8. 2020-03-23 09:24:16 lonepeak11 numexpr.utils[2755] INFO NumExpr defaulting to 8 threads. 2020-03-23 09:24:24 lonepeak11 peddy.peddy[2755] INFO plotting 2020-03-23 09:24:24 lonepeak11 matplotlib.axes._axes[2755] WARNING 'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'. Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points. 2020-03-23 09:24:24 lonepeak11 matplotlib.axes._axes[2755] WARNING 'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'. Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points. 2020-03-23 09:24:24 lonepeak11 matplotlib.axes._axes[2755] WARNING 'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'. Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points. 2020-03-23 09:24:24 lonepeak11 matplotlib.axes._axes[2755] WARNING 'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'. Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points. 2020-03-23 09:24:24 lonepeak11 matplotlib.axes._axes[2755] WARNING 'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'. Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points. 2020-03-23 09:24:24 lonepeak11 matplotlib.axes._axes[2755] WARNING 'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'. Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points. 2020-03-23 09:24:24 lonepeak11 matplotlib.axes._axes[2755] WARNING 'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'. Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points. 2020-03-23 09:24:24 lonepeak11 matplotlib.axes._axes[2755] WARNING 'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'. Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points. 2020-03-23 09:24:24 lonepeak11 matplotlib.axes._axes[2755] WARNING 'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'. Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points. 2020-03-23 09:24:24 lonepeak11 matplotlib.axes._axes[2755] WARNING 'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'. Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points. 2020-03-23 09:24:24 lonepeak11 matplotlib.axes._axes[2755] WARNING 'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'. Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points. 2020-03-23 09:24:24 lonepeak11 matplotlib.axes._axes[2755] WARNING 'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'. Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points. 2020-03-23 09:24:25 lonepeak11 peddy.cli[2755] INFO ran in 9.7 seconds 2020-03-23 09:24:25 lonepeak11 peddy.cli[2755] INFO het_check 2020-03-23 09:24:28 lonepeak11 peddy.pca[2755] INFO loaded and subsetted thousand-genomes genotypes (shape: (2504, 2724)) in 0.6 seconds 2020-03-23 09:24:28 lonepeak11 peddy.pca[2755] INFO ran randomized PCA on thousand-genomes samples at 2724 sites in 0.7 seconds 2020-03-23 09:24:28 lonepeak11 peddy.pca[2755] INFO Projected thousand-genomes genotypes and sample genotypes and predicted ancestry via SVM in 0.1 seconds 2020-03-23 09:24:28 lonepeak11 matplotlib.axes._axes[2755] WARNING 'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'. Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points. 2020-03-23 09:24:28 lonepeak11 matplotlib.axes._axes[2755] WARNING 'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'. Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points. Traceback (most recent call last): File "/uufs/chpc.utah.edu/common/home/u0873645/anaconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/uufs/chpc.utah.edu/common/home/u0873645/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/uufs/chpc.utah.edu/common/home/u0873645/peddy/peddy/main.py", line 14, in sys.exit(cli()) File "/uufs/chpc.utah.edu/common/home/u0873645/anaconda3/lib/python3.7/site-packages/click/core.py", line 829, in call return self.main(args, kwargs) File "/uufs/chpc.utah.edu/common/home/u0873645/anaconda3/lib/python3.7/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/uufs/chpc.utah.edu/common/home/u0873645/anaconda3/lib/python3.7/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, ctx.params) File "/uufs/chpc.utah.edu/common/home/u0873645/anaconda3/lib/python3.7/site-packages/click/core.py", line 610, in invoke return callback(args, kwargs) File "/uufs/chpc.utah.edu/common/home/u0873645/peddy/peddy/cli.py", line 209, in peddy in ("ped_check", "het_check", "sex_check")]): File "/uufs/chpc.utah.edu/common/home/u0873645/peddy/peddy/cli.py", line 43, in run prefix=prefix, kwargs) File "/uufs/chpc.utah.edu/common/home/u0873645/peddy/peddy/peddy.py", line 878, in het_check pca_df, background_pca_df = pca(pca_plot, sitesfile, gt_types, sites) File "/uufs/chpc.utah.edu/common/home/u0873645/peddy/peddy/pca.py", line 138, in pca edgecolor=pal[i]) File "/uufs/chpc.utah.edu/common/home/u0873645/anaconda3/lib/python3.7/site-packages/matplotlib/init.py", line 1565, in inner return func(ax, *map(sanitize_sequence, args), *kwargs) File "/uufs/chpc.utah.edu/common/home/u0873645/anaconda3/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py", line 358, in wrapper return func(args, **kwargs) File "/uufs/chpc.utah.edu/common/home/u0873645/anaconda3/lib/python3.7/site-packages/matplotlib/axes/_axes.py", line 4387, in scatter raise ValueError("s must be a scalar, or the same size as x and y") ValueError: s must be a scalar, or the same size as x and y

brentp commented 4 years ago

thank you for reporting. I will fix this shortly.

roryk commented 4 years ago

Worth adding this test to the .travis.yaml?

 python -m peddy -p 4 --plot --prefix ceph-1463 data/ceph1463.peddy.vcf.gz data/ceph1463.ped

I can add it to the bioconda recipe as well so we can catch these, if that should work OOTB.

julieefeusier commented 4 years ago

If this helps, the only files I receive as output are:

ceph-1463.vs.html ceph-1463.ped_check.csv ceph-1463.ped_check.png ceph-1463.ped_check.rel-difference.csv

brentp commented 4 years ago

ok. this is fixed. I added --plot to the test and tagged 0.4.6 and pushed to pypi.