This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to remove part of FASTA sequences?

I have 10 bacterial genomes FASTA sequences (few of them might have chromosome and plasmids together and rest only chromosome) . And I have another FASTA file with 20 different plasmids. My plan is to remove the plasmid part from those 10 bacterial genomes and keep only chromosomal part as FASTA form if any section of bacterial genome match 100% to any of my 20 plasmids list. What are the best ways to do it?

sequence fasta

1 answer

I would take a look at the Biostrings R package for this. You can read your FASTA sequences in, then simply use the `maskMotif` method to mask your plasmid sequences and then you can use `injectHardMask` to replace your masked sequences with a letter of your choice. This way you can still identify where there were sequences, and the total length of your chromosome doesn't change.

Log in to answer this question.