{"id":2513,"date":"2015-05-28T05:34:04","date_gmt":"2015-05-28T05:34:04","guid":{"rendered":"http:\/\/41j.com\/blog\/?p=2513"},"modified":"2015-05-28T05:34:04","modified_gmt":"2015-05-28T05:34:04","slug":"using-blast-for-nucleotide-alignments","status":"publish","type":"post","link":"https:\/\/41j.com\/blog\/2015\/05\/using-blast-for-nucleotide-alignments\/","title":{"rendered":"Using BLAST+ for nucleotide alignments"},"content":{"rendered":"<p>It&#8217;s quite some time since I needed to run BLAST locally on anything. Here are some quick notes.<\/p>\n<p>First download BLAST:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nwget ftp:\/\/ftp.ncbi.nlm.nih.gov\/blast\/executables\/blast+\/LATEST\/ncbi-blast-2.2.30+-x64-linux.tar.gz\r\ntar xvzf ncbi-blast-2.2.30+-x64-linux.tar.gz\r\ncd ncbi-blast-2.2.30+\/bin\r\n<\/pre>\n<p>Create a new reference database:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n.\/makeblastdb -in ~\/genomics\/myreference.fasta  -dbtype nucl\r\n<\/pre>\n<p>In my case I needed to align fastq files. However BLAST only takes fasta. I used to the following to convert the fastqs to fastas:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nawk 'BEGIN{n=0;}{if(n%4 == 0) print &quot;&gt;&quot; substr($0,2); if(n%4 == 1) print $0;n++;}' input.fastq &gt; output.fasta\r\n<\/pre>\n<p>And finally run the alignment:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n.\/blastn -db ~\/genomics\/myreference.fasta -query .\/output.fasta\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s quite some time since I needed to run BLAST locally on anything. Here are some quick notes. First download BLAST: wget ftp:\/\/ftp.ncbi.nlm.nih.gov\/blast\/executables\/blast+\/LATEST\/ncbi-blast-2.2.30+-x64-linux.tar.gz tar xvzf ncbi-blast-2.2.30+-x64-linux.tar.gz cd ncbi-blast-2.2.30+\/bin Create a new reference database: .\/makeblastdb -in ~\/genomics\/myreference.fasta -dbtype nucl In my case I needed to align fastq files. However BLAST only takes fasta. I used to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-2513","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1RRoU-Ex","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/2513","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/comments?post=2513"}],"version-history":[{"count":1,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/2513\/revisions"}],"predecessor-version":[{"id":2514,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/2513\/revisions\/2514"}],"wp:attachment":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/media?parent=2513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/categories?post=2513"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/tags?post=2513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}