creating graph of distribution of blast hits on the query sequence I'm attempting to visualize the results of my BLAST search in a way similar to the graphical display of the distribution of blast hits from the web BLAST.

For example, from my BLAST search:



except I would like the graph to contain information including information for the distribution of all 6139 hits across my query sequence.

Since this is a large number of sequences to visualize a distribution, I am considering using a score of the number of hits on a certain region, and having an output more similar to:



If I were to run my blast using the BLAST+ command line tool, and read the results into R, which parts of the output should I plot in order to recreate the graphical display of the distribution? Ideally I would like to make a reusable object that can make an equivalent plot for any BLAST input.

Thanks.
You probably want to include query start (qstart) and query end (qend) in your blast output.

Something like this:

blastn -query your.fasta -out blast.out.txt -db your.db -outfmt '6 qseqid sseqid qstart qend length evalue'


In R you can take the "qstart:qend" from each line for density plot.

There are many ways in R to plot the densities of these start and end amino acids.

Let me show an example with a small data frame:

qstart &lt;- c(200, 300, 250, 400, 500)
qend &lt;- c(300, 450, 400, 600, 650)

df &lt;- as.data.frame(cbind(qstart,qend))

aa &lt;- vector()
i=1
for(i in 1:5){
aa &lt;- append(aa, c(df[i,1]:df[i,2]))
i+1
}

hist(aa)
dens &lt;- density(aa)
plot(dens)