BLAST: Difference between revisions
Jump to navigation
Jump to search
(Created page with "Download necessary files wget -N -c http://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.2bit wget http://hgdownload.soe.ucsc.edu/admin/exe/macOSX.x86_64/twoBitToFa...") |
No edit summary |
||
Line 13: | Line 13: | ||
-title hg38 \ | -title hg38 \ | ||
-out hg38 | -out hg38 | ||
blastp example | |||
blastp \ | |||
-query pep.fa \ | |||
-task blastp-short \ | |||
-db gencode_v39_pc_translations \ | |||
-out pep.blastout \ | |||
-outfmt 7 | |||
Convert output to BED | Convert output to BED |
Latest revision as of 06:34, 6 July 2022
Download necessary files
wget -N -c http://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.2bit wget http://hgdownload.soe.ucsc.edu/admin/exe/macOSX.x86_64/twoBitToFa wget -c -O hg38.refGene.txt.gz http://hgdownload.soe.ucsc.edu/goldenPath/hg38/database/refGene.txt.gz ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/ncbi-blast-2.7.1+-x64-macosx.tar.gz
Create database
makeblastdb -dbtype nucl \ -in hg38.fa \ -input_type fasta \ -title hg38 \ -out hg38
blastp example
blastp \ -query pep.fa \ -task blastp-short \ -db gencode_v39_pc_translations \ -out pep.blastout \ -outfmt 7
Convert output to BED
#!/usr/bin/env perl use strict; use warnings; my $usage = "Usage: $0 <refGene.txt.gz>\n"; my $infile = shift or die $usage; if ($infile =~ /\.gz$/){ open(IN, '-|', "gunzip -c $infile") || die "Could not open $infile: $!\n"; } else { open(IN, '<', $infile) || die "Could not open $infile: $!\n"; } while(<IN>){ chomp; next if /^#/; my ($bin, $name, $chr, $strand, $tx_start, $tx_end, $cds_start, $cds_end, $exon_count, $exon_starts, $exon_ends, $score, $name2, @rest) = split(/\t/); print join("\t", $chr, $tx_start, $tx_end, $name2, 0, $strand), "\n"; } close(IN); exit(0);