Question about awk command line - follow-up
1
1
Entering edit mode
7.8 years ago
vishwaas1704 ▴ 30
$ awk -vPRIMER="ACTG" '{if ($0~/^>/) { print $0; } else { print PRIMER$0; }}' in.fa > out.fa

(by Alex Reynolds)

Can this code be modified to add primer sequence in the end of the complete sequence, what we have generated in the previous code? And I assume we will already use the reverse complement sequence so that we dont have to include that thing in the code.

sequence • 1.4k views
ADD COMMENT
0
Entering edit mode

This is a follow-up question for: A: Fasta file edition

Tagging: Alex Reynolds

ADD REPLY
0
Entering edit mode

yes... i tried to post on there... but may be,,because it was solved... it didnot catch attention.... ... thus i had to post as a new post

ADD REPLY
3
Entering edit mode
7.8 years ago

Reposition PRIMER$0 to $0PRIMER to move the string to the end.

ADD COMMENT
1
Entering edit mode

Thankyou very-3 much @Alex Reynolds !!!

with your code, i tried to mix both command, and guess what ... it worked !!!

awk -vfPRIMER="forwardprimer" -vrPRIMER="reverseprimer" '{if ($0~/^>/) { print $0; } else { print fPRIMER$0rPRIMER; }}' in.fasta > out.fasta
ADD REPLY

Login before adding your answer.

Traffic: 2268 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6