Tutorial:Parsing HMMER output
0
1
Entering edit mode
8 months ago
I0110 ▴ 160

I am using HMMER recently and somehow found the output (space delimited) difficult to parse. There are several tools I found but seem not working. I figured out some simple code for linux terminal to make the HMMER output to tab delimited.

#Parse HMMER
#remove all lines start with #
sed '/^#/ d' < ~/Desktop/data/HMMER.txt > ~/Desktop/data/HMMER2.txt
#make multiple spaces to one space
tr -s " " < ~/Desktop/data/HMMER2.txt > ~/Desktop/data/HMMER3.txt
#replace space with tab
tr ' ' '\t' < ~/Desktop/data/HMMER3.txt > ~/Desktop/data/HMMER_tab.txt
#you need to add the column names back

You can add the column names back in R like:

HMMER <- read.delim(file="~/Desktop/data/HMMER_tab.txt",header=F,stringsAsFactors=F,sep="\t")
colnames(HMMER) <- c("target_name","t_accession","query_name",
                "q_accession","full_seq_E_value","full_score",
                "full_bias","best_1_E_value","best_1_score",
                "best_1_bias","exp","reg","clu","ov","env",
                "dom","rep","inc","description_of_target")
HMMER • 481 views
ADD COMMENT
0
Entering edit mode

Nice, thank you so much!

ADD REPLY

Login before adding your answer.

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