Hello All,

I was curious if anyone is aware of any tools or approach that can convert hard-masked genome to soft-masked format. For example,

genome: *....ATGCATGCATGC......*  

conversion required: *....ATGCNNNNATGC......*   to *....ATGCatgcATGC......*


Regards,  
B
I would first get the coordinates of Ns in the hard-masked genome and output them as a bed file. Here's an example using seqkit.

```
seqkit locate --bed -rPp "N+" hardmasked.fasta > N_coords.bed
```

You can then use bedtools to soft mask the non-masked genome.

```
bedtools maskfasta -soft -fi unmasked.fasta -bed N_coords.bed -fo softmasked.fasta
```