Why not go back to randomreads.sh after bedtools getfasta. OP is happy with it otherwise :-)
Hello,
i need to generate some artifical reads. randomsreads.sh from BBMap seems to be the right program for me.
I don't need random reads for my whole reference genome but for several thousand regions. So I wonder if there is better/faster way instead of first creating a separate ref file for every region? Maybe a new parameter for randomreads.sh for providing a bed file with the region (@Brian Bushnell :) )
fin swimmer
2 answers
You can do this with bedtools and wgsim:
# Generate FASTA file of regions
bedtools getfasta -fi reference.fasta -bed regions.bed > regions.fasta
# Generate reads from FASTA file of regions
wgsim regions.fasta reads_1.fastq reads_2.fastq
Haven't tried it personally, but ART is used a lot in my lab for this:
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3278762/
Not sure if it will do a region-by-region thing, though you could probably simulate a genome and then work backwards throwing away the uncessary stuff with bedtools or similar.
Log in to answer this question.