linux - adding an adapter sequence to the end of a fastq file -


i have large fastq file , want add sequence "ttaagg" end of each sequence in file (the 2nd line every 4th line after), while still maintaining fastq file format. example: first line start with:

@hwi-d00449:41:c2h8bacxx:5:1101:1219:2053 1:n:0: gcaatatccttcaacta + fffhfhgfhaggiiiii 

and want print out:

@hwi-d00449:41:c2h8bacxx:5:1101:1219:2053 1:n:0: gcaatatccttcaactattaagg + fffhfhgfhaggiiiii 

i imagine sed or awk this, haven't been able find solution allows me keep fastq format.

i tried:

awk 'nr%4==2 { print $0 "ttaagg"}' < file_in.fastq > fileout_fastq  

which added ttaagg second line , every fourth line, deleted other 3 lines.

does have suggestions of command lines can use or if know of package available can this, please let me know!

try gnu sed:

 sed '2~4s/$/ttaagg/' file 

Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -