This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Path to bam files in --bam_list bcftools mpileup

Hello,

I want to do variant calling of my multiple bam files.

rule bcftools:
    input:
        ref="genome.fa",
        bam="/path/to/bam_list",
    output:
        outf ="chr.vcf"
    shell:
        "bcftools mpileup -f {input.ref} --bam-list {input.bam} |"  
        "bcftools call -vcO v {output.outf}"

bam_list:

bob.bam
john.bam
carl.bam
...
so on

If I do not specify the path of each bam file in the bam_list, it cannot find it. But if I specify in my final vcf file, the path will be included in each column of the genotype name (which is annoying and long since I have many bam files). How can I specify one single path to all my bam files?

EDIT: I specified the working directory and it works, if there are any other solutions good to know anyway.

bcftools bam

Hello, it looks like if you give full path in the bam_list file, the vcf will automatically keep sample name only.

0 answers

No answers yet.

Log in to answer this question.