This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to replace a stretch of a sequence with N's in a fasta file

Hi! I´m trying to change a stretch of 300,000 nucleotides on chromosome 21, with NNN´s in a fasta file. This turned out to be not such a trivial task. I searched BioPython packages for a solution but can't find anything appropriate. It needs to a specific region between 8,202,082–8,552,360 nucleotides on chr 21. Any ideas?

fasta biopython

1 answer

maskfasta from bedtools.

That was a simple solution and it worked perfectly. I was overthinking how to solve it. Thank you!

Log in to answer this question.