bacpop / PopPUNK

PopPUNK 👨‍🎤 (POPulation Partitioning Using Nucleotide Kmers)
https://www.bacpop.org/poppunk
Apache License 2.0
88 stars 18 forks source link

Unrecognized arguments in poppunk_assign: --assign-lineages and --rank #187

Closed ChadFibke closed 2 years ago

ChadFibke commented 2 years ago

Hi @johnlees, I hit another small snag described below:

Versions:

  poppunk 2.4.0
  poppunk_sketch 1.7.4 

I wanted to use my previously constructed database (with strand-preserved and phased-codon options) to predict lineages of new samples. The database information is below:

$ poppunk_db_info.py database_phased_p2.h5

PopPUNK database:       database_phased_p2.h5
Sketch version:         7d333b5bfee96ea6156e58656f5e7c8115b99897
Number of samples:      12800
K-mer sizes:            13,17,21,25,29
Sketch size:            9984
Contains random matches:    True
Codon phased seeds:     True

I constructed a fitted model using the lineage option (due to poor population structure). I then used the following command to assign lineages to my query samples and got the following error:

# command used
poppunk_assign \
    --db /pathway/to/database_phased/
    --query /pathway/to/qfile.txt \
    --output /pathway/to/poppunk_clusters \
    --strand-preserved \
    --assign-lineages \
    --rank 3 \
    --qc-filter prune \
    --threads 8  

#error received

usage: poppunk_assign [-h] --db DB --query QUERY [--distances DISTANCES]
                      [--external-clustering EXTERNAL_CLUSTERING] --output
                      OUTPUT [--plot-fit PLOT_FIT] [--write-references]
                      [--update-db] [--overwrite] [--graph-weights]
                      [--min-kmer-count MIN_KMER_COUNT] [--exact-count]
                      [--strand-preserved] [--qc-filter {stop,prune,continue}]
                      [--retain-failures] [--max-a-dist MAX_A_DIST]
                      [--max-pi-dist MAX_PI_DIST]
                      [--type-isolate TYPE_ISOLATE]
                      [--length-sigma LENGTH_SIGMA]
                      [--length-range LENGTH_RANGE LENGTH_RANGE]
                      [--prop-n PROP_N] [--upper-n UPPER_N]
                      [--model-dir MODEL_DIR]
                      [--previous-clustering PREVIOUS_CLUSTERING]
                      [--core-only] [--accessory-only] [--threads THREADS]
                      [--gpu-sketch] [--gpu-dist] [--gpu-graph]
                      [--deviceid DEVICEID] [--version] [--citation]
poppunk_assign: error: unrecognized arguments: --assign-lineages --rank 3

I also could not see the --assign-lineages and --rank arguments when running poppunk_assign --help

Any help would be appreciated :)

Best, Chad

johnlees commented 2 years ago

I think we have changed this so that it should work automatically from your lineage model, and produce output at all ranks. Can you try again, but just removing those two arguments?

I see the documentation is probably wrong on this, if this works we'll correct the instructions

ChadFibke commented 2 years ago

Hi,

I removed the --rank and --assign-lineages, and it looks like PopPUNK is picking up the expected lineage cluster model. The program successfully ran!

PopPUNK: assign
    (with backend: sketchlib v1.7.4
     sketchlib: /home/chad.fibke/.conda/envs/POPpunk/lib/python3.9/site-packages/pp_sketchlib.cpython-39-x86_64-linux-gnu.so)

Graph-tools OpenMP parallelisation enabled: with 8 threads
Mode: Assigning clusters of query sequences

Loading lineage cluster model
Completed model loading

The rest of the output was related to qc and progress :). Thank you for the quick response!

Best, Chad

johnlees commented 2 years ago

Ok excellent, I'll raise another issue to remind me to fix the docs for this case