Mykrobe-tools/mykrobe

How do I run command line?

peflanag opened this issue · 10 comments

Hi, this is probably a stupid question but how do I run the program? I've tried a number of combinations of command and it keeps failing. I want to use command line over the GUI so I can loop a script to run a number of samples but when I try on one sample it just fails.

Any help would be great.

Cheers,

P

Screenshot 2021-05-21 at 12 22 00

Sorry, this is a little confusing at the time of writing, because we recently changed how it is run, but have not yet made a new release with the new usage. So the documentation reflects the latest code, but not the latest release.

The old way to run (version 0.9.0 and earlier) is:

mykrobe predict tb sample_name --seq reads.fastq --out out.tsv

The new way to run is:

mykrobe predict --species tb --sample sample_name --seq reads.fq --output out.tsv

There are other options, eg make a JSON file instead of the default tsv. There are example commands here for the latest code: https://github.com/Mykrobe-tools/mykrobe/wiki/AMR-Prediction
and if you want to see the old usage, it's here: https://github.com/Mykrobe-tools/mykrobe/wiki/AMR-Prediction/90f3e5f272995abeb8ebd8e32a86c626d09ece07

Thanks @martinghunt

When will the new code be available for me to update?

It's there now on tip of master branch, is just we haven't made a new release on the releases page yet.

Ah ok. I installed by Conda install (not sure how to do via master) so I will wait till I can do a Conda update on it!

Cheers.

Just to check, I tried running like you said but with a script to loop it with two samples before I try a vast amount. It still failed. I'k just wondering if I am still missing something? I've attached a .txt file with the script I wrote.

Cheers
Screenshot 2021-05-21 at 13 41 47
Mykrobe.txt

You need to use the old (version <= 0.9.0) usage:

mykrobe predict tb sample_name --seq reads.fastq --out out.tsv

Sorry, my bad, I must have ran the olde script. I did run this though:

sampleLoc=/Volumes/IMRL/FastQ_Trimmed
sampleName=("21IE73" "21IE74")
outputLoc=/Volumes/IMRL/Analysis/Yearly_Runs/2021/Run_6_Nano_EK_MiSeq/Mykrobe

for sample in ${sampleName[*]}

do

mykrobe predict tb ${sampleName} --seq $sampleLoc/${sampleName}*R1.fastq.gz $sampleLoc/${sampleName}*R2.fastq.gz --output $outputLoc/${sample}.tsv

done

And it failed with the screenshot. I'm wondering how I place the sample_name field in with multiple samples maybe? it seems to be looking for the species as my sample?

Screenshot 2021-05-21 at 13 52 43

Oh no! The usage was incorrect - it had sample and species the wrong way around. Should be:

mykrobe predict sample_name tb ....

Sorry for the confusion..

I did notice that in the mykrobe call, I think you need to replace ${sampleName} with ${sample}.

Ah ok perfect cheers! It seems to be running now so fingers crossed!

Great! Glad it's working.