This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract Domain Sequences From Multiple Sequences

Hi, I have 100 protein sequences with some conserved domains. I want to extract the domain sequences in a go. is it possible. Although CDD gives us the boundry of the domains but didn't give the sequences of the domain. i am a window user.

domain protein

What do you have as input? Sequences (FASTA or which other format) or a list of accession numbers (Uniprot or which other database)?

Also: do you want the consensus sequence of the conserved domain or the one in your sequences?

no we are not working on the same project :).

OK, Thanks! I will trust you on this. By the way, welcome to Biostars.org!

3 answers

If you know the domain boundary coordinates: than its very simple using input multiple sequence fasta file.

  1. using blast "formatdb" format your fasta files.
  2. use fastacmd with -s sequence name -L start, end :

Example: fastacmd -d refseq_protein -s NP_112245 -L 100,160

input "list_file" file with three columns "seq_id" "start" "end"

   awk '{system("fastacmd -d input_fasta.fa -s "$1" -L "$2","$3"");}' list_file

for additional information check this

Arr, the fastacmd one liner does most of what my 60 line R script does here.

I'm trying to do that with a fasta file but I get the following output with no results:

    ======= Backtrace: =========
   /lib/x86_64-linux-gnu/libc.so.6(+0x7329f)[0x7f29bb75029f]
   /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7f29bb7eb87c]
   /lib/x86_64-linux-gnu/libc.so.6(+0x10d750)[0x7f29bb7ea750]
   /lib/x86_64-linux-gnu/libc.so.6(+0x10cc59)[0x7f29bb7e9c59]
  /lib/x86_64-linux-gnu/libc.so.6(_IO_default_xsputn+0xbc)[0x7f29bb75861c]
  /lib/x86_64-linux-gnu/libc.so.6(_IO_vfprintf+0x1cc5)[0x7f29bb728905]
  /lib/x86_64-linux-gnu/libc.so.6(__vsprintf_chk+0x84)[0x7f29bb7e9ce4]
  /lib/x86_64-linux-gnu/libc.so.6(__sprintf_chk+0x7d)[0x7f29bb7e9c3d]
  /usr/lib/x86_64-linux-gnu/libncbitool.so.6(readdb_acc2fasta+0x166)[0x7f29bbe18e16]
  /usr/lib/x86_64-linux-gnu/libncbitool.so.6(Fastacmd_Search_ex+0x264)[0x7f29bbe1d0c4]
  fastacmd(Nlm_Main+0x1fc)[0x7f29bc2f716c]
  /usr/lib/x86_64-linux-gnu/libncbi.so.6(main+0x20)[0x7f29bbabc310]
  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f29bb6fef45]
  fastacmd(+0xe79)[0x7f29bc2f6e79]
  ======= Memory map: ========
  7f29b9e65000-7f29b9e7b000 r-xp 00000000 08:01 26738717                   /lib/x86_64-linux-gnu/libgcc_s.so.1
  7f29b9e7b000-7f29ba07a000 ---p 00016000 08:01 26738717                   /lib/x86_64-linux-gnu/libgcc_s.so.1
  7f29ba07a000-7f29ba07b000 r--p 00015000 08:01 26738717                   /lib/x86_64-linux-gnu/libgcc_s.so.1
  7f29ba286000-7f29ba287000 rw-p 0000a000 08:01 26743156                   /lib/x86_64-linux-gnu/libnss_files-2.19.so
  7f29ba287000-7f29ba292000 r-xp 00000000 08:01 26743161                   /lib/x86_64-linux-gnu/libnss_nis-2.19.so
  7f29babbd000-7f29bb1c1000 r-xp 00000000 08:01 16526285                   /usr/lib/x86_64-linux-
  gnu/libncbiobj.so.6.1.20120620
  7f29bb1c1000-7f29bb3c0000 ---p 00604000 08:01 16526285                   /usr/lib/x86_64-linux-
  gnu/libncbiobj.so.6.1.20120620zsh: abort      
  *** buffer overflow detected ***: fastacmd terminated

Do you have any idea whats going on?

Have you tried Batch CDD search option ?

To expand on that: if you want the exact hit positions, use the rpsblast command-line tool.

My answer here

Finding The Sequence Of A Domain

solves your question.

actually I have problem with r script. Do you know any perl solution for that?

Log in to answer this question.