I am a beginer and I make a pipeline to do Rnaseq sequence alignment. I work with BWA, my code is the following:

rule bwa_mem2_mem:
input:
    reads=["../results/trimmed/{sample}_R1_trimmed.fastq.gz","../results/trimmed/{sample}_R1_trimmed.fastq.gz"],
    ref="../resources/reference/Qrob_PM1N.fa"
output:
    out= "../results/mapped_reads/{sample}.bam"
log:
    "../results/logs/bwa_mem2/{sample}.log"
message: """--- Alignment in process ---"""
threads: 8
shell:
    "(bwa-mem2 mem -M -t {threads} -v 2 {input.ref} {input.reads} | samtools view -Sb -> {output.out}) > {log}"

And the problem is that the terminal shows me the following, knowing that I have the right path and the fact that I have installed BWA-mem2 but I think my pc does not want to install it.

 [Fri Apr 16 08:07:18 2021]
Job 4: --- Alignment in process ---

/usr/bin/bash: bwa-mem2 : commande introuvable
[main_samview] fail to read the header from "-".
[Fri Apr 16 08:07:18 2021]
Error in rule bwa_mem2_mem:
    jobid: 4
    output: ../results/mapped_reads/sub1.bam
    log: ../results/logs/bwa_mem2/sub1.log (check log file(s) for error message)
    shell:
        (bwa-mem2 mem -M -t 4 -v 2 ../resources/reference/Qrob_PM1N.fa ../results/trimmed/sub1_R1_trimmed.fastq.gz ../results/trimmed/sub1_R1_trimmed.fastq.gz | samtools view -Sb -> ../results/mapped_reads/sub1.bam) > ../results/logs/bwa_mem2/sub1.log
        (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

Removing output files of failed job bwa_mem2_mem since they might be corrupted:
../results/mapped_reads/sub1.bam
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: /home/coralie/Bureau/epitree/workflow/.snakemake/log/2021-04-16T080718.069055.snakemake.log"

And the log file displays:

-----------------------------
Executing in AVX2 mode!!
-----------------------------
* Ref file: genome.fasta
* Entering FMI_search
ERROR! Unable to open the file: genome.fasta.bwt.8bit.32
[main_samview] fail to read the header from "-".

I'm a bit stuck, do you have any ideas?

Thanks in advance for your help



Source link