Question: Question about awk command line - follow-up
1
gravatar for vishwaas1704
3.7 years ago by
vishwaas170430
vishwaas170430 wrote:
$ 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 • 712 views
ADD COMMENTlink modified 3.7 years ago by Alex Reynolds31k • written 3.7 years ago by vishwaas170430

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

Tagging: Alex Reynolds

ADD REPLYlink modified 3.7 years ago • written 3.7 years ago by genomax91k

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 REPLYlink written 3.7 years ago by vishwaas170430
3
gravatar for Alex Reynolds
3.7 years ago by
Alex Reynolds31k
Seattle, WA USA
Alex Reynolds31k wrote:

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

ADD COMMENTlink written 3.7 years ago by Alex Reynolds31k
1

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 REPLYlink modified 3.7 years ago by WouterDeCoster44k • written 3.7 years ago by vishwaas170430
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1044 users visited in the last hour