This is my command: bcftools mpileup -Ou -d 1000 --threads 10 --annotate…
- User
This is my command:
bcftools mpileup -Ou -d 1000 --threads 10 --annotate FORMAT/AD,FORMAT/ADF,FORMAT/ADR,FORMAT/DP,FORMAT/SP,INFO/AD,INFO/ADF,INFO/ADR -q10 -f reference.fasta SRR6170145.bam SRR6170260.bam SRR6170338.bam SRR6170513.bam | bcftools call --ploidy 1 -m -Oz -o output.vcf.gz
but I want to make it a lot faster. Taking this commentary from a github discussion, I thought that maybe that could be applied here:
GNU Parallel is a great alternative to xargs for this kind of thing, and saves you having to cleanup the temporary files.
This command will parallelize over chromosomes/contigs with one simultaneous job per core, writing all results to my.pileup:
parallel --colsep ‘\t’ samtools mpileup -b my_bams.fofn -r {1} :::: genome.fa.fai > my.pileup
Where my_bams.fofn is a file of BAM files, and genome.fa.fai is the output of samtools faidx or alternately a newline separated list of chromosomes.
If fewer threads are desired, they can be specified with the --jobs flag, e.g. --jobs 16 runs 16 simultaneous jobs. Adding the --keep-order flag will output results in the same order they occur in genome.fa.fai at the cost of load-balancing.
Could you help me? Note that I am working with a bacteria, so there is 1 chromosome, instead of splitting the file into chromosomes I would like to split it based on intervals
- Assistant
- User
how can I use bedtools to create that bed file?
- Assistant
To create intervals for your genome using
bedtools, you first need to know the length of your bacterial chromosome. This information is typically contained in a FASTA index file which can be generated usingsamtools faidx. Once you have the index file, you can create a BED file with intervals of your desired size.Here are the steps to create evenly spaced intervals using :
- User
- Assistant
The error message you're seeing indicates that there's an issue with your VCF file header and the definition of contigs or reference sequences. It seems the VCF parser is not correctly identifying your contig definition line (
##contig=<ID=REL606,length=4629812>), which is properly present as you've shown in the output of for the VCF file.