Question: Consensus fasta file with uncovered bases set to Ns
0
gravatar for deepti1rao
2.3 years ago by
deepti1rao30
deepti1rao30 wrote:

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?

ADD COMMENTlink modified 2.3 years ago by Matt Shirley9.2k • written 2.3 years ago by deepti1rao30
1
gravatar for geek_y
2.3 years ago by
geek_y10k
Barcelona
geek_y10k wrote:

bedtools maskfasta

Just provide the bed file with 0 coverage regions

ADD COMMENTlink modified 2.3 years ago • written 2.3 years ago by geek_y10k
0
gravatar for Matt Shirley
2.3 years ago by
Matt Shirley9.2k
Cambridge, MA
Matt Shirley9.2k wrote:

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.

ADD COMMENTlink written 2.3 years ago by Matt Shirley9.2k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 987 users visited in the last hour