I am using wgsim to simulate reads from randomly selected genome regions (hg19):
Noticed that sometimes wgsim stops (works fine for some fasta files and for specific fasta produces empty <out.read1.fq> <out.read2.fq> files and does nothing else).
Checked those 1Mb fasta files and they are all N's
>Chr_random
NNNNNNNNNNNNNNN
...
NNNNNNNNNNNNNNN
Question:
- How can solve this wgsim problem?
Or - How can I filter out N rich fasta files?
NB: wgsim "chromosome specif bias" was reported before - Short Read Simulator For Cnv Indel? Don't know if I am encountering the same problem here.
Edit
I simply used grep but their might be more elegant way.
1 answer
This is one of the problems that can be somewhat deceiving with respect of the difficulty of solving it. Grepping for a stretch of Ns per file is good answer if that works for this problem.
If one wanted a more generic answer to find all Ns in a file that potentially contains a large number sequences some of which could be potentially huge then I there is no off-the shelf solution that comes to my mind.
It would probably require writing code that reads in fixed amount of data in and keeps a running tally of Ns while resetting for each fasta record. Or some clever regular expression perhaps.
Log in to answer this question.