Blog:Perform Primer to Primer comparison to see and show if the primers produced are new or 100% similar to published primers
1
0
Entering edit mode
7 months ago

Hi Everyone

I was recently asked to compare the primers we produced in our lab with the published primers and see if they are 100% similar or not. This was an SWGA experiment but you can use the code snippet for any other cases as well.

I started with BlastN but since primers were really small (10bp), it was difficult to get anything even when the database was of primers itself. I therefore thought of returning to the basics and use Needleman–Wunsch algorithm for this purpose.

mamba install -c bioconda emboss

## First I split my query primer file into separate fasta files using 
awk '/^>/ {out = substr($1, 2) ".fasta"; print > out} !/^>/ {print >> out}' query/query.fasta

## Then I used the needle command of emboss to carry out primer to primer global alignment
ls -1 *.fasta | while read p; 
do 
needle $p published/published.fasta -gapopen 10 -gapextend 0.5 -outfile $p.needle; 
done

This will produce .needle files (this isn't a new file format just the way I like saving the results with tool name) which will contain the alignment results with all the published primers in the published.fasta file. So needle command will perform one-against-all alignment.

Further if you want you can retrieve the Identity value and create all-vs-all identity heatmap for your paper.

If you think there is a better way to do this, I am all ears!! Please drop comments and suggestions.

Primers emboss needle • 721 views
ADD COMMENT
1
Entering edit mode
7 months ago
GenoMax 141k

You can also use bowtie v.1.x.

$ more test.fa
>te1
TCAATGCCAT
>te2
GGTCTACGTC
>te3
CGTGGGCACT
>te4
GCCGAGGACA
>te5
TACGAGCGCT

Build an index with reference

$ bowtie-build test.fa small

Align your sequences. Here I will simply provide them on the command line using -c option. Sequence 1 aligns with one error where as sequence 3 does not align.

$ bowtie -x small -c GGTCTACATC,GCCGAGGACA,TATCGATCGA,GGTCTACGTC
0       +       te2     0       GGTCTACATC      IIIIIIIIII      0       7:G>A
1       +       te4     0       GCCGAGGACA      IIIIIIIIII      0
3       +       te2     0       GGTCTACGTC      IIIIIIIIII      0
# reads processed: 4
# reads with at least one alignment: 3 (75.00%)
# reads that failed to align: 1 (25.00%)
Reported 3 alignments
ADD COMMENT
0
Entering edit mode

Interesting. I hope you also have a way to visualize the all-vs-all primer comparison as something like this where the Y-axis have published primers and x-axis have in-house primers

enter image description here

ADD REPLY

Login before adding your answer.

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