[BioPython] -->Problem using Bio.PDB "Dice"

olav.zimmermann at fz-juelich.de olav.zimmermann at fz-juelich.de
Wed Mar 12 19:28:49 UTC 2008


Hi Florian,

the accept_residue method of the ChainSelector class which is used by Dice.extract deliberately skips het residues (see Dice.py line 37ff):
<cite>

def accept_residue(self, residue):
        # residue - between start and end
        hetatm_flag, resseq, icode=residue.get_id()
        if hetatm_flag!=" ":
            # skip HETATMS
            return 0
        if icode!=" ":
            print "WARNING: Icode at ", residue.get_id()
        if self.start<=resseq<=self.end:
            return 1
        return 0
<\cite>

As the selector is not a parameter for Dice.extract, you should do your own overwrite of ChainSelector and pass it to PDBIO.save

Best regards

Olav

----- Original Message -----
From: Florian Koelling <florian.koelling at tu-bs.de>
Date: Wednesday, March 12, 2008 1:23 pm
Subject: [BioPython] -->Problem using Bio.PDB "Dice"

> Hi Folks!
> 
> I tried to grab the following line from a pdb file - (in order  to 
> create a new one)  using "dice"
> 
> HETATM 3427  O11 GNF  1001      36.457  27.002  14.788  1.00
> 27.60           O 
> 
> The code i tried:
> from Bio.PDB import*
> 
> parser = PDBParser()
> structure =parser.get_structure('s','2F1G.pdb')   
> 
> y = extract(structure ,"  ", 1001, 1001 ,'2out.pdb')
> 
> I only receive an empty file.
> Is there any possibility to use dice  when  a  chain specification 
> is 
> obviously missing?
> 
> Thanx alot!
> 
> Florian
> _______________________________________________
> BioPython mailing list  -  BioPython at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biopython
> 
> 



-------------------------------------------------------------------
-------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich

Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr. Harald Bolt,
Dr. Sebastian M. Schmidt
-------------------------------------------------------------------
-------------------------------------------------------------------



More information about the Biopython mailing list