Rosemeis / pcangsd

Framework for analyzing low depth NGS data in heterogeneous populations using PCA.
GNU General Public License v3.0
46 stars 11 forks source link

error: "Argument 'beagle' has incorrect type" #46

Closed nreid closed 3 years ago

nreid commented 3 years ago

Hello,

I was wondering if you could give me some insight into this error I'm getting:

I run angsd like this (angsd version: 0.933-102-g7d57642):

angsd \
-nThreads 10 \
-b $BAMLIST \
-GL 2 \
-doGlf 2 \
-doMajorMinor 1 \
-doMaf 2 \
-doCounts 1 \
-SNP_pval 1e-6 \
-minMaf 0.05 \
-minMapQ 30 \
-minQ 20 \
-setMinDepth 350 \
-setMaxDepth 500 \
-out $OUTDIR/angsd

angsd finishes without error:

    -> Done reading data waiting for calculations to finish
    -> Done waiting for threads
    -> Output filenames:
        ->"../../results/pcangsd/angsd.arg"
        ->"../../results/pcangsd/angsd.beagle.gz"
        ->"../../results/pcangsd/angsd.mafs.gz"
    -> Thu Jan 28 15:32:32 2021
    -> Arguments and parameters for all analysis are located in .arg file
    -> Total number of sites analyzed: 420397048
    -> Number of sites retained after filtering: 731123 
    [ALL done] cpu-time used =  91009.46 sec
    [ALL done] walltime used =  14428.00 sec

And I run pcangsd like this:

PCANGSD=pcangsd/pcangsd.py
python $PCANGSD \
-beagle $OUTDIR/angsd.beagle.gz \
-out pcangsd \
-threads 10

And the error, after only a few seconds:

PCAngsd v.1.0
Using 10 thread(s).

Parsing Beagle file.
Traceback (most recent call last):
  File "/pcangsd/pcangsd.py", line 154, in <module>
    L = reader_cy.readBeagle(args.beagle)
TypeError: Argument 'beagle' has incorrect type (expected unicode, got str)

If I look at the beagle.gz file it seems ok.

-bash-4.2$ zcat $OUTDIR/angsd.beagle.gz | head | cut -f 1-5
marker  allele1 allele2 Ind0    Ind0
MvBL_chr1_2136  2   0   0.799979    0.200021
MvBL_chr1_2139  3   1   0.000532    0.999468
MvBL_chr1_2203  3   1   0.004238    0.995762
MvBL_chr1_2238  1   3   0.984609    0.015391
MvBL_chr1_2608  2   3   0.666622    0.333333
MvBL_chr1_2610  0   2   0.666622    0.333333
MvBL_chr1_2614  0   2   0.666622    0.333333
MvBL_chr1_2617  0   3   0.666622    0.333333
MvBL_chr1_2618  0   3   0.666622    0.333333

I downloaded and compiled pcangsd yesterday. It's not really clear to me what I've done that could screw up the beagle file, so any help would be appreciated!

Noah

nreid commented 3 years ago

Sorry, discovered this is a python issue most certainly on my end, I will try to figure out how I screwed up the build...

Rosemeis commented 3 years ago

Hey,

Yeah it is an issue between Python3 and Python2.

Best, Jonas