|
From: timothee c. <tc...@st...> - 2010-03-02 11:05:21
|
Hi Folks, I had a few issues using blast2sam.pl script provided with samtools so I modified it and I thought I could share the modified script. Here are the changes that I made. * Print the query sequence in sam format and add a dummy quality string of A (21) * Correct a small bug where deletion and insertion were swapped * Handle multiple hits for one query in several sam lines * Handle the new blast+ format along with the old blast format Any comment is welcome. btw does anybody know if there would be a sensible way of transforming blast e value in a phred like mapping quality? Thanks Tim ---------------------------------------------------------------------------------------------- Exemple of how I use the script: * Old format blast-2.2.22/bin/megablast -d reference.fasta -i query.fasta | samtools-0.1.7_x86_64-linux/blast2sam.pl | samtools-0.1.7_x86_64-linux/samtools view -bT reference.fasta - | samtools-0.1.7_x86_64-linux/samtools sort - query_sorted * New format blast+2.2.22/bin/blastn -task dc-megablast -db reference_genes.fasta -query query.fasta | sed 's/lcl|//' | | samtools-0.1.7_x86_64-linux/blast2sam.pl | samtools-0.1.7_x86_64-linux/samtools view -bT reference.fasta - | samtools-0.1.7_x86_64-linux/samtools sort - query_sorted -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. |