Error: no such option: --o-visualization q2-sample-classifier

I have run the q2-sample-classifier and am receiving an error that for such option for the output visualization. Any thoughts on why this might be occurring?

qiime sample-classifier classify-samples --i-table C:\Users\kjharris\Desktop\crayfishmicrobiome2018\rep-seqs.qza --m-metadata-file “C:\Users\kjharris\Desktop\crayfishmicrobiome2018\metadata April 16 2019 - Editable.txt” --p-optimize-feature-selection --p-parameter-tuning --p-estimator RandomForestClassifier --p-n-estimators 100 --o-visualization crayfishmicrobiome2018\rep-seqs.qzv
Usage: qiime sample-classifier classify-samples [OPTIONS]
Try “qiime sample-classifier classify-samples --help” for help.

Error: no such option: --o-visualization

1 Like

Hey there @mudbugecology!

Yes indeed - the information is all right there, ripe for the picking! :pear: :apple:

Let's start with the error message:

Okay, so so looks like this part of your command is causing the problem: --o-visualization crayfishmicrobiome2018\rep-seqs.qzv. So, if we double check the docs (trimmed to just the output section):

  --o-sample-estimator ARTIFACT PATH SampleEstimator[Classifier]
                                  Trained sample estimator.  [required if not
                                  passing --output-dir]
  --o-feature-importance ARTIFACT PATH FeatureData[Importance]
                                  Importance of each input feature to model
                                  accuracy.  [required if not passing
                                  --output-dir]
  --o-predictions ARTIFACT PATH SampleData[ClassifierPredictions]
                                  Predicted target values for each input
                                  sample.  [required if not passing --output-
                                  dir]
  --o-model-summary VISUALIZATION PATH
                                  Summarized parameter and (if enabled)
                                  feature selection information for the
                                  trained estimator.  [required if not passing
                                  --output-dir]
  --o-accuracy-results VISUALIZATION PATH
                                  Accuracy results visualization.  [required
                                  if not passing --output-dir]

So, the first thing I notice is that there is no --o-visualization option in this command. Okay, so moving forward --- double check the --help text for the command to make sure that you are providing all the required options to the command, then try it again! Good luck! :qiime2:

2 Likes

Thanks for the quick reply! I will give this a try!

Hey @mudbugecology,

Just to clarify: “visualization” was an output in an old version of q2-sample-classifier. You must have been using some old docs or copying/pasting from an old collection of scripts. So you are not going crazy — but as @thermokarst recommends whenever you see an error like that it is best to check the help documentation since parameter names do change from time to time!

2 Likes

An off-topic reply has been split into a new topic: How to use metadata in q2-sample-classifier

Please keep replies on-topic in the future.

I am attempting to run this in Linux as a subsystem on a new pc and I have the most recent release of q2, I have also been attempting this on my mac, but I am still having some difficultly getting the directory to output:

(qiime2-2019.4) kjharris@6SS4NV2:/mnt/c/Users/kjharris/Desktop$ qiime diversity alpha-group-significance --i-table C:\Users\kjharris\Desktop\crayfishmicrobiome2018\table.qza --m-metadata-file “C:\Users\kjharris\Desktop\crayfishmicrobiome2018\metadata may 1 2019 modified.txt” --m-metadata-column SampleType “C:\Users\kjharris\Desktop\crayfishmicrobiome2018\metadata may 1 2019 modified.txt” --p-optimize-feature-selection --p-parameter-tuning --p-estimator RandomForestClassifier --p-n-estimators 100 --output-dir SampleTypeMicrobiome
Usage: qiime diversity alpha-group-significance [OPTIONS]

Visually and statistically compare groups of alpha diversity values.

Inputs:
–i-alpha-diversity ARTIFACT SampleData[AlphaDiversity]
Vector of alpha diversity values by sample. [required]
Parameters:
–m-metadata-file METADATA…
(multiple The sample metadata.
arguments will
be merged) [required]
Outputs:
–o-visualization VISUALIZATION
[required]
Miscellaneous:
–output-dir PATH Output unspecified results to a directory
–verbose / --quiet Display verbose output to stdout and/or stderr during
execution of this action. Or silence output if
execution is successful (silence is golden).
–citations Show citations and exit.
–help Show this message and exit.

              There were some problems with the command:

(1/6?) no such option: --i-table
(2/6?) no such option: --m-metadata-column
(3/6?) no such option: --p-optimize-feature-selection
(4/6?) no such option: --p-parameter-tuning
(5/6?) no such option: --p-estimator
(6/6?) no such option: --p-n-estimators
(qiime2-2019.4) kjharris@6SS4NV2:/mnt/c/Users/kjharris/Desktop$

not sure why I started it that way since the current doc on the tutorial Predicting sample metadata values with q2-sample-classifier — QIIME 2 2019.4.0 documentation suggests this:

qiime sample-classifier classify-samples
--i-table moving-pictures-table.qza
--m-metadata-file moving-pictures-sample-metadata.tsv
--m-metadata-column BodySite
--p-optimize-feature-selection
--p-parameter-tuning
--p-estimator RandomForestClassifier
--p-n-estimators 20
--p-random-state 123
--output-dir moving-pictures-classifier

Hi @mudbugecology,

I think the issue is you need to prefix your paths with /mnt/c/<normal path here, but with / not \>. That being said, the parser shouldn't really be complaining about those options not existing, as obviously they do. So there's an interesting edge case here (and not your fault).

Regardless of that, I think if you update your paths, the command should start working correctly.

Example:

C:\Users\kjharris\Desktop\crayfishmicrobiome2018\table.qza

should become:

/mnt/c/Users/kjharris/Desktop/crayfishmicrobiome2018/table.qza

inside the linux subsystem.

Let me know if that works! I'll look into why the no such option: is happening with the Windows style paths...

1 Like

thanks, Evan!! I will give this a go and let you know if it works

1 Like

working on a new error message, but this seems to be moving in the right direction: qiime sample-classifier classify-samples --i-table /mnt/c/Users/kjharris/Desktop/crayfishmicrobiome2018/table/qza --m-metadata-file /mnt/c/Users/kjharris/Desktop/crayfishmicrobiome2018/metadata may 1 2019 modified.txt --m-metadata-column SampleType /mnt/c/Users/kjharris/Desktop/crayfishmicrobiome2018/metadata may 1 2019 modified.txt --p-optimize-feature-selection --p-parameter-tuning --p-estimator RandomForestClassifier --p-n-estimators 100 --output-dir SampleTypecrayfishmicrobiome
There was an issue with loading the file /mnt/c/Users/kjharris/Desktop/crayfishmicrobiome2018/metadata as metadata:

Metadata file path doesn’t exist, or the path points to something other than a file. Please check that the path exists, has read permissions, and points to a regular file (not a directory): /mnt/c/Users/kjharris/Desktop/crayfishmicrobiome2018/metadata

There may be more errors present in the metadata file. To get a full report, sample/feature metadata files can be validated with Keemei: https://keemei.qiime2.org

Find details on QIIME 2 metadata requirements here: https://docs.qiime2.org/2019.4/tutorials/metadata/

Yep! The issue this time is one of path quoting, to be honest, I’m taking notes here, as this is another common problem that ideally the parser should be handling more gracefully (so thanks!)

To solve this one you have two options:

 /mnt/c/Users/kjharris/Desktop/crayfishmicrobiome2018/metadata may 1 2019 modified.txt

should be written as either:

 /mnt/c/Users/kjharris/Desktop/crayfishmicrobiome2018/metadata\ may\ 1\ 2019\ modified.txt

or

'/mnt/c/Users/kjharris/Desktop/crayfishmicrobiome2018/metadata may 1 2019 modified.txt'

(note the single-quotes around the path)

Space is considered a special character to most command line tools, so it doesn’t realize may, 1, 2019, etc are part of the file. Most people just avoid space all-together in their filenames as it makes life much easier.

1 Like

bingo! you all are the best

qiime sample-classifier classify-samples --i-table /mnt/c/Users/kjharris/Desktop/crayfishmicrobiome2018/table-rarefy-to-12000.qza --m-metadata-file /mnt/c/Users/kjharris/Desktop/crayfishmicrobiome2018/metadata\ April\ 30\ 2019.t
xt --m-metadata-column SampleType --p-optimize-feature-selection --p-parameter-tuning --p-estimator RandomForestClassifier --p-n-estimators 10
0 --output-dir SampleTypecrayfishmicrobiome
Saved SampleEstimator[Classifier] to: SampleTypecrayfishmicrobiome/sample_estimator.qza
Saved FeatureData[Importance] to: SampleTypecrayfishmicrobiome/feature_importance.qza
Saved SampleData[ClassifierPredictions] to: SampleTypecrayfishmicrobiome/predictions.qza
Saved Visualization to: SampleTypecrayfishmicrobiome/model_summary.qzv
Saved Visualization to: SampleTypecrayfishmicrobiome/accuracy_results.qzv

2 Likes

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.