(1/10?) Option ‘–p-metric’ was specified multiple times in the command.
(2/10?) Option ‘–p-metric’ was specified multiple times in the command.
(3/10?) Option ‘–p-metric’ was specified multiple times in the command.
(4/10?) Option ‘–p-metric’ was specified multiple times in the command.
(5/10?) Option ‘–p-metric’ was specified multiple times in the command.
(6/10?) Option ‘–p-metric’ was specified multiple times in the command.
(7/10?) Option ‘–p-metric’ was specified multiple times in the command.
(8/10?) Option ‘–p-metric’ was specified multiple times in the command.
(9/10?) Option ‘–p-metric’ was specified multiple times in the command.
(10/10?) Option ‘–p-metric’ was specified multiple times in the command.
I would really appreciate your advice… Many thanks!
At the moment, it's not possible to do this in one command in QIIME 2. You could build a for-loop (I'd recommend the python API for that but if you have some bash-foo, you could probably put together a loop on the command line or via a snakemake pipeline. You could alos check and see if core-diversity will let you change the list of metrics.
Otherwise, this might be a good development suggestion.
Following your suggestion I tried the following, but it gave me error.
for i in shannon observed_otus dominance
do
qiime diversity alpha
–i-table Ar2_raw_PairedEnd_table_deblur.qza
-–p-metric “’$i’”
–o-alpha-diversity Ar2_raw_PairedEnd_alpha_diversity
done
Error message:
Error: Detected invalid character in: -–p-metric
Verify the correct quotes or dashes (ASCII) are being used.
I have tried various combinations of quotes, such as “”, ‘’, “’’”,… all gave me the same error message.
Do you know how to correctly pass on a bash variable to a QIIME command please?
for i in shannon observed_otus dominance
do
qiime diversity alpha
–i-table Ar2_raw_PairedEnd_table_deblur.qza
-–p-metric $i
–o-alpha-diversity Ar2_raw_PairedEnd_alpha_diversity
done
I’ve tried your suggestion, and still got the same error:
Error: Detected invalid character in: -–p-metric, –-o-alpha-diversity
Verify the correct quotes or dashes (ASCII) are being used.
But don’t worry, I’ll try to figure it out.
Thanks again for your kindness!
for i in 'shannon' 'observed_otus' 'dominance'
do
echo $i
qiime diversity alpha
--i-table Ar2_raw_PairedEnd_table_deblur.qza
--p-metric $i
--o-alpha-diversity $i.qza
done
I also think you want to direct your output path more clearly. Like, you’ll re-write the filepath if you do it this way.
So, a wonderful collegue pointed out that you might also have an issue with your fancy dashes. Try typing directly on the command line or using a text editor to format
If you have a metada file, you can try ‘qiime diversity core-metrics’ or ’ qiime diversity core-metrics-phylogenetic ’ to calculate alpha diversity, and you will get some of the alpha diversity you listed (see the command documentation for details).
There’s also a very silly way. Your code will print out the qiime2 commands. If you want q2 to run these commands, you can try the following:
Create a blank ’ .txt ’ file, write the qiime2 command with a different ’ --p-metric ’ parameter by line through the loop or manually, then, change the file suffix to ’ .sh ', like this:
Thanks so much for your kind replies.
Unfortunately, I’ve tried all sorts of different dashes, quotation marks etc but nothing worked.
So I decided to write all of the commands in a bash file script.