Closed tanyasarkjain closed 4 months ago
Set the output file name as the last argument
pbmm2 align [options] <ref.fa|xml|mmi> <in.bam|xml|fa|fq> [out.aligned.bam|xml]
I too get the same error. I run pbmm2 in snakemake workflow. This is the rule file
ruleorder: pbmm2_align_ubam > pbmm2_align_fastq
rule pbmm2_align_ubam:
input:
reference = config['ref']['fasta'],
ref_index = config['ref']['index'],
query = lambda wildcards: ubam_dict[wildcards.sample][wildcards.movie]
output:
bam = f"samples/{{sample}}/aligned/{{movie}}.{ref}.bam",
bai = f"samples/{{sample}}/aligned/{{movie}}.{ref}.bam.bai"
log: f"samples/{{sample}}/logs/pbmm2/align/{{movie}}.{ref}.log"
benchmark: f"samples/{{sample}}/benchmarks/pbmm2/align/{{movie}}.{ref}.tsv"
params:
sample = lambda wildcards: wildcards.sample,
preset = "CCS",
extra = "--sort --unmapped -c 0 -y 70",
loglevel = "INFO"
threads: 24
conda: "envs/pbmm2.yaml"
shell:
"""
(pbmm2 align --num-threads {threads} \
--preset {params.preset} \
--sample {params.sample} \
--log-level {params.loglevel} \
{params.extra} \
{input.reference} \
{input.query} \
{output.bam}) > {log} 2>&1
"""
rule pbmm2_align_fastq:
input:
reference = config['ref']['fasta'],
ref_index = config['ref']['index'],
query = lambda wildcards: fastq_dict[wildcards.sample][wildcards.movie]
output:
bam = f"samples/{{sample}}/aligned/{{movie}}.{ref}.bam",
bai = f"samples/{{sample}}/aligned/{{movie}}.{ref}.bam.bai"
log: f"samples/{{sample}}/logs/pbmm2/align/{{movie}}.{ref}.log"
benchmark: f"samples/{{sample}}/benchmarks/pbmm2/align/{{movie}}.{ref}.tsv"
params:
sample = lambda wildcards: wildcards.sample,
preset = "CCS",
extra = "--sort --unmapped -c 0 -y 70",
loglevel = "INFO"
threads: 24
conda: "envs/pbmm2.yaml"
shell:
"""
(pbmm2 align --num-threads {threads} \
--preset {params.preset} \
--sample {params.sample} \
--log-level {params.loglevel} \
{params.extra} \
{input.reference} \
{input.query} \
{output.bam}) > {log} 2>&1
"""
In the above rule file, do I have to edit the output as:
output:
bam = f"samples/{{sample}}/aligned/{{movie}}.out.aligned.bam",
bai = f"samples/{{sample}}/aligned/{{movie}}.out.aligned.bam.bai"
It would be of great help, if you check if I have understood the above edit Thank you
Operating system Which operating system and version are you using? MacOS
Package name I am using pbmm2 version 1.7.0
Conda environment
I am running the command
pbmm2 align GRCh38_latest_genomic.mmi movie_name.sequencing_control.subreads.bam
as the README suggests, but I am getting the following error message:>|> 20240314 19:43:20.622 -|- FATAL -|- CheckPositionalArgs -|- 0x20453a240|| -|- pbmm2 align ERROR: Could not determine read input type(s). Please do not mix data types, such as BAM+FASTQ. File of files may only contain BAMs or datasets.
I am unsure as to why this is happening, given I am following the readme - supplying the index of the fasta and then also a subreads bam file.