Consensus fasta file with uncovered bases set to Ns
I am looking forward to generating a consensus fasta file by providing my BED file and the reference fasta as inputs.I want to have the bases in my reference genome, showing 0 coverage to be substituted by Ns. Is there any script/tool available to do this?
• 2,874 views
•
link
2 answers
You can do this with pyfaidx as well.
$ pip install pyfaidx
$ faidx -m -b regions.bed file.fa # mask with "N"
$ faidx -s X -m -b regions.bed file.fa # mask with "X"
$ faidx -M -b regions.bed file.fa # soft-mask with lowercase characters
These all modify file.fa in-place, so make sure you're either testing on a copy or ready to change the file.
• 0 views
•
link
Log in to answer this question.