HKU-BAL / Clair3

Clair3 - Symphonizing pileup and full-alignment for high-performance long-read variant calling
245 stars 26 forks source link

A loop to run clair3 on multiple .bam files #127

Closed Samcha12 closed 2 years ago

Samcha12 commented 2 years ago

Hi I am trying to run clair3 (conda) with a for loop to analyze bam files from different samples.

The code looks like:

conda create -n clair3 -c bioconda clair3 python=3.6.10 -y conda activate clair3

for i in {path do di/*.bam} do run_clair3.sh \ --bam_fn=$i \ --ref_fn={path to the reference genome .fasta} \ --threads=10 \ --platform=ont \ --model_path={path to r941_prom_hac_g360+g422} \ --output= {path to output dir} \ --sample_name=x\ done

when I run this, I have the following error Picture1

Can you help me to fix the problem?

aquaskyline commented 2 years ago

add more '\'

aquaskyline commented 2 years ago

add '\' after run_clair3.sh

aquaskyline commented 2 years ago

If you are familiar with bash, in your error message, it shows "--ref_fn=..." was treated as a new row, i.e., there must be some problems between '--ref_fn' and the previous row. Sometime it could be editor's problem, sometime it's autocorrection, but you can simply type the command again verbatim, and preferably remove the '\' and merge all options into one row to get it working first. Since this is a bash syntax problem, please do trial and error to get it work.

Samcha12 commented 2 years ago

Thanks a lot