GREP from multiFasta file and keep headers
Hi there,
I am new to coding, consider yourself warned 😀
I have a multifasta file with 3′ UTR sequences of variable length. I would like to extract a 6-mer sequence; AGTCTC with 20 nts upstream and 20 nts downstream (but not the rest of the sequence from that 3’UTR or that particular line, just these 20+6+20 nucleotides).
I know I can do that with Grep;
grep - "....................AGTCTC...................." 3UTR.fa > 3UTR2.fa
However, this doesn’t give me a new Fasta file with headers..
I know I can use the -B option but this give me all the lines from header to my sequence of interest.
Any suggestions are much appreciated!
Cheers,
Marie
• 27 views
Read more here: Source link