Entering edit mode
9.6 years ago
GP
▴
10
Hi All,
I have a fasta file containing approx 600bp long reads. I want to extract first 12 bases from each read along with fasta header and write into new file, is there any one liner or easy way to do this job? Any help is appreciated. Thanks!
Or if the headers are ≤ 12 characters then simply
And if it's multiline (same header restriction):
Header is > 12 characters, thanks though, works as well!
Thanks very much airan, its working. Actually I had multline fasta seqs that I formatted to single line, is there any tweaking in your one liner awk command to use it for multiline fasta file. Best, D
Glad to help :). If you have a multiline fasta file, I guess that you could use this one:
Perfect!! again, thanks :-)
I am trying this code for a big file. Just as an example first 4 sequences, each 30000 nucleotide
When I try the following code, it works.
However, for the position of more than 1000, it does not work and there is not sequence.