# Obtaining all protein sequences with a particular domain architecture from Pfam

I want to get the alignment of chain A of 1kf6 (PDB ID) from the pfam database here. This protein chain has two main domains (FAD_binding_2 and Succ_DH_flav_C). In pfam there is a link to one of these domains and after clicking in one of the mentioned domains in the table below the page, another page comes at the top of which there is a link to architectures.

For example, if we click on "FAD_binding_2" in the table, there are 220 architectures that have this domain and after clicking on that button (at the top of page), a page opens here. In this page 7471 sequences with the following architecture: FAD_binding_2, Succ_DH_flav_C, resembles most to my chain (because it has both FAD_binding_2 and Succ_DH_flav_C domains).

If we want to see all 7471 sequences with that architecture we can click on the show button under that architecture and finally we can see all of that 7471 architecture resembling our chain A sequence. Down the page we can see other architectures that all have FAD_binding_2, but some of them do not have both FAD_binding_2 and Succ_DH_flav_C domains (or some of them have other extra domains that we are not interested in) and so we do not need their sequences and their alignments.

When we want to get the alignment of full sequences at the left side of the page, we can see that we can just get the alignment of all 15696 sequences and it seems that there is no way to get the alignment of our favourite 7471 sequences. I would like to know if there is any way to get the alignment or at least the fasta file of our favourite 7471 sequences (which have both of our favourite domains not just one of them)?

I believe you can do this using SQL files of the database.

First you need to get the integer accession of this architecture. architecture table has the following columns:

• auto_architecture (integer id, this is what we need)
• architecture (a string describing the architecture)
• type_example (example sequence)
• no_seqs (number of sequences)
• architecture_acc (accessions of the architectures)

You need the following line:

3900719357      FAD_binding_2~Succ_DH_flav_C    Z9JRB3  7471    PF00890 PF02910


Now you need to get the sequences with this architecture id. First, download the file with all the sequences (warning, this one is more than 7Gb). With this one you need column #1 (pfam sequence accesion), #12 (sequence itself) and #16 (architecture integer id).

If you do not want to import files in the database, you can use awk to export all the sequences to fasta format.

zcat pfamseq.txt.gz | awk -F\\t '{ if ($16=="3900719357") print ">"$1 "\n" \$12}' > sequences.fasta


Of couse, if you need to perform multiple queries like this, it is much easier to import tables into the database. Then you can perform both queries in a single SQL operation (assuming you know the architecture string):

SELECT pfamseq_acc, sequence
FROM architecture
JOIN pfamseq ON pfamseq.auto_architecture=architecture.auto_architecture


(I haven't tried this SQL query, so maybe you need to correct it a bit)

• I think the idea of not importing 7Gb database is better because I have a lot of protein sequences that I want to do similar task on. I prefer trying the second idea, but I don't know why I couldn't get the integer accession of this architecture from above "architecture table" link – Sara Jul 5 '17 at 14:20
• Not sure I understand your comment well. In my example I assume you only have the architecture string. If you already have your auto_architecture accession, you can simply write SELECT pfamseq_acc, sequence FROM pfamseq WHERE auto_architecture=3900719357. – Iakov Davydov Jul 5 '17 at 14:33

An alternative way is using the Hmmer website, and do a hmmsearch with the Pfam accession, forex. (PF02910). Navigate to the domain tab and find the domain architecture that you are interested in and press view scores. That way, only the sequences you are interested in will be downloadable under the tab downloads.

Step-by-Step guide:

2- Search with hmmsearch http://www.ebi.ac.uk/Tools/hmmer/search/hmmsearch

3- Use Accession search and type in PF02910

4- Navigate to Domain

5- To the right side of 9742 sequences with domain architecture: FAD_binding_2, Succ_DH_flav_C

Press View scores.

6- It should show (Your results have been filtered) and Query matches (9742)

8- Repeat for domain architectures of interest.

I hope you find this helpful.

Kind Regards,

Sara

That does not appear to be possible using PFAM. I would suggest trying a different database. I managed to perform the same query using SMART (http://smart.embl-heidelberg.de/), via entering "Pfam:FAD_binding_2 AND Pfam:Succ_DH_flav_C" under "Domain selection" in the "Architecture Analysis" section of the search screen, which resulted in 9921 protein sequences with those two domains as you can see here.

On the results screen you can select all the sequences and under "Action" at the top of the screen choose "Download Protein Sequences as FASTA file".

• It's a good idea but the problem is that it's not specific. I need the proteins that just have these two domains and no more. In these 9921 protein sequences, there are sequences which have other domains that make my search inspecific – Sara Jul 5 '17 at 13:59
• you gave me a good idea. although it's inspecific but I could simply make it specific. First in "action selection" part, I chose "download protein sequences as a fasta file" and downloaded the fasta file of all sequences and then I chose "generate a Newick tree and iTol formatted dataset" . Then in "iTOL protein dataset file" part, I clicked on "download as tab delimited plain text" and downloaded all protein identifiers with the name of their pfam domain – Sara Jul 8 '17 at 8:23
• Then I used python for deleting protein identifiers which had other domains. After that I could go to the fasta file and delete the fasta sequence of extra proteins – Sara Jul 8 '17 at 8:23