Question: How to confirm forward and reverse primer matches the beggining of each read and keep only reads with fwd and rev primers ?
0
gravatar for dzisis1986
2.7 years ago by
dzisis198620
dzisis198620 wrote:

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??

ADD COMMENTlink modified 2.7 years ago by Pierre Lindenbaum123k • written 2.7 years ago by dzisis198620
1
gravatar for Pierre Lindenbaum
2.7 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum123k wrote:

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 COMMENTlink written 2.7 years ago by Pierre Lindenbaum123k
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: 1649 users visited in the last hour