How to confirm forward and reverse primer matches the beggining of each read and keep only reads with fwd and rev primers ?
1
0
Entering edit mode
7.9 years ago
dzisis1986 ▴ 70

I have a sipmle script in command line to Check primers in fastq file but this is for one primer only.

cat 4C_Blaise_pool_1_H1_TSS_fastq | paste - - - - | awk '{if ($0~/\tAACGAAAGAAATTAAAGGATAACTG/)print}' | awk -F '\t' '{print $1"\n"$2"\n"$3"\n"$4}' > 4C_Blaise_pool_1_H1_TSS_Rev.fastq

I would like to include in my if the second primer as well in rder to check if each read starts with one one two primers and then write a new fastq only with the reads which include the forward and reverse primers. Any help with that??

sequencing fastq filtering reads primers • 1.8k views
ADD COMMENT
1
Entering edit mode
7.9 years ago

with bash , use paste with two input stream (8 columns)

paste     <(cat R1.fq | paste - - - - ) \
          <(cat R2.fq | paste - - - - ) \ 
         | awk  -F '\t' '($2~/^ABC/ && $6 ~ /^ABCD/ )' |\
         tr "\t" "\n"

output is an interleaved fastq

ADD COMMENT

Login before adding your answer.

Traffic: 1521 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