localpdb/utils/prot.py
def parse_gz_fasta(fn):
    """
    Parser for PDB seqres fasta files. Faster than the Bio.SeqIO due to cleaned input format.
    @param fn: filename with seqres records from the PDB
    @return: (pdb_chain, sequence) pairs
    """
    with gzip.open(fn, 'rt') as f:
        data = f.readlines()
        for i in range(0, len(data), 2):
            pdb_chain = data[i].split()[0][1:]
            seq = data[i+1].rstrip()
            yield pdb_chain, seq

    Parser for PDB seqres fasta files. Faster than the Bio.SeqIO due to cleaned input format.
    @param fn: filename with seqres records from the PDB
    @return: (pdb_chain, sequence) pairs
    
Parser for PDB seqres fasta files. Faster than the Bio.SeqIO due to cleaned input format.
Parser for PDB seqres fasta files . Faster than the Bio . SeqIO due to cleaned input format .
def parse_gz_fasta(fn):
    with gzip.open(fn, 'rt') as f:
        data = f.readlines()
        for i in range(0, len(data), 2):
            pdb_chain = data[i].split()[0][1:]
            seq = data[i+1].rstrip()
            yield pdb_chain, seq
def parse_gz_fasta ( fn ) : with gzip . open ( fn , 'rt' ) as f : data = f . readlines ( ) for i in range ( 0 , len ( data ) , 2 ) : pdb_chain = data [ i ] . split ( ) [ 0 ] [ 1 : ] seq = data [ i + 1 ] . rstrip ( ) yield pdb_chain , seq
Parser for PDB seqres fasta files.
Parser for PDB seqres fasta files .
"""
    Parser for PDB seqres fasta files. Faster than the Bio.SeqIO due to cleaned input format.
    @param fn: filename with seqres records from the PDB
    @return: (pdb_chain, sequence) pairs
    """
(pdb_chain, sequence) pairs
( pdb_chain sequence ) pairs
fn
filename with seqres records from the PDB
filename with seqres records from the PDB