This is a test version of Biostars. For the public version, visit https://www.biostars.org.
pdb id and organism

Hello

Could you please tell me one tool can show name of organism with pdb id

Thanks

sequence

You can retrieve this type of information from the 'pdb header' which is found in PDB file itself.

Example

HEADER    TRANSFERASE (CARBAMOYL-P,ASPARTATE)     22-SEP-89   8AT1
TITLE     CRYSTAL STRUCTURES OF ASPARTATE CARBAMOYLTRANSFERASE LIGATED WITH
TITLE    2 PHOSPHONOACETAMIDE, MALONATE, AND CTP OR ATP AT 2.8-ANGSTROMS
TITLE    3 RESOLUTION AND NEUTRAL P*H
COMPND    MOL_ID: 1;
COMPND   2 MOLECULE: ASPARTATE CARBAMOYLTRANSFERASE (R STATE), CATALYTIC CHAIN;
COMPND   3 CHAIN: A, C;
COMPND   4 EC: 2.1.3.2;
COMPND   5 ENGINEERED: YES;
COMPND   6 MOL_ID: 2;
COMPND   7 MOLECULE: ASPARTATE CARBAMOYLTRANSFERASE REGULATORY CHAIN;
COMPND   8 CHAIN: B, D;
COMPND   9 ENGINEERED: YES
SOURCE    MOL_ID: 1;
SOURCE   2 ORGANISM_SCIENTIFIC: ESCHERICHIA COLI;  # this line
SOURCE   3 ORGANISM_TAXID: 562;
SOURCE   4 MOL_ID: 2;
SOURCE   5 ORGANISM_SCIENTIFIC: ESCHERICHIA COLI;
SOURCE   6 ORGANISM_TAXID: 562

Thanks for reply

I know this item exist in pdb id header but I have many pdb id and I want to know that the organism of every one.

Simply this doesn't work ?

grep "ORGANISM_SCIENTIFIC" *.pdb | awk -F":" '{ print $1"\t"$NF}'

1 answer

If you have all pdb files, keep them in a directory, run the following. At the end you will get a file organ.txt, contains the information as follows

3adk
ORGANISM: SUS SCROFA;
5pti
ORGANISM: BOS TAURUS;

Script

#!/bin/bash

for f in *.pdb
do
  sed -n "/ORGANISM_SCIENTIFIC:/p" $f > ""$f".orga"
done

for f in *.orga
do
  echo "$f" >> organisms.txt
  cat $f >> organisms.txt
done

sed "s/.orga//" organisms.txt | sed "s/SOURCE   2 //" | sed "s/_SCIENTIFIC//" > organ.txt

rm *.orga

Otherwise run the following. Keep all ids in a file called pdb_ids.txt. It retrieves the pdb header of every pdb id in your file from PDBeurope database, then the organism name of every id.

pdb_ids.txt

5pti
3adk
..

​Script

#!/bin/bash

while read -r I 
do
  wget -O ""$i".header" "http://www.ebi.ac.uk/pdbe/static/entry/$i.header"
  sed -n "/ORGANISM_SCIENTIFIC:/p" ""$i".header" > ""$i".orga"
done < pdb_ids.txt

for f in *.orga
do
  echo "$f" >> organisms.txt
  cat $f >> organisms.txt
done

sed "s/.orga//" organisms.txt | sed "s/SOURCE 2 //" | sed "s/_SCIENTIFIC//" > organ.txt

rm *.header
rm *.orga

```

Keep the script in a file biostar.bash and execute bash biostar.bash

Thanks for your reply

Could you please description again

First: keep pdb id in text file

Second: add this pdb id-txt to PDBeurope?

If you have all .pdb file of every id, keep them in a directory and run the first script in that directory. If you don't have .pdb file, then keep all ids as shown in above answer run the second script. In both cases you will get the same result.

which line start the second script?

starts with #!/bin/bash

second box - first script starts with #!/bin/bash

fourth box - second script, also starts with #!/bin/bash

Thanks for your reply

This script is linux command?

Could you please more description about how to run

Yes, this is to run in linux.

First script

  • Copy all the pdb files into a folder.
  • Copy the script into a file called biostar.bash
  • Open a terminal in that folder
  • Do bash biostar.bash

    Second Script

  • Keep pdb ids in a file called pdb_ids.txt

  • Copy the second script into a file called biostar.bash
  • Keep pdb_ids.txt in a folder, open terminal in that folder, do bash biostar.bash

Log in to answer this question.