Chem-Structure-Parser
view release on metacpan or search on metacpan
â âââ pmid '9571026'
â âââ doi '10.1006/JMBI.1998.1669'
âââ compound COMPND, by MOL_ID
â âââ 1
â â âââ mol_id '1'
â â âââ molecule 'GROWTH HORMONE'
â â âââ chain [ 'A' ]
â â âââ engineered 'YES'
â â âââ mutation 'YES'
â âââ 2 { molecule 'GROWTH HORMONE RECEPTOR', chain [ 'B' ],
â fragment 'EXTRACELLULAR DOMAIN', engineered 'YES' }
âââ source SOURCE, by MOL_ID
â âââ 1 { organism_scientific 'HOMO SAPIENS', organism_common
â 'HUMAN', organism_taxid '9606', mol_id '1',
â expression_system 'ESCHERICHIA COLI',
â expression_system_taxid '562' }
âââ entity_of_chain COMPND and SOURCE, by chain
â âââ A { mol_id '1', molecule 'GROWTH HORMONE', fragment undef,
â â ec undef, organism 'HOMO SAPIENS', taxid '9606',
â â expressed_in 'ESCHERICHIA COLI' }
â âââ B { ..., fragment 'EXTRACELLULAR DOMAIN' }
âââ seqres what SEQRES says was in the crystal
â âââ A
â â âââ sequence 'FPTIPLSRLFDNAMLRAHRLHQLAFDTYQEFEEAYIPKEQKYSFLQ...'
â â âââ residues [ 'PHE', 'PRO', 'THR', 'ILE', ... ] 191 of them
â â âââ length 191
â âââ B { sequence, residues, length 238 }
âââ dbref
â âââ A [ { database 'UNP', accession 'P01241',
â db_id 'SOMA_HUMAN', seq_begin '1', seq_end '191',
â db_begin '27', db_end '217', chain 'A' } ]
â âââ missing_residues
â â [ 130, 131, 132, 133, 134, 135,
â â 149, 150, 151, 152, 153 ]
â âââ first 1 the first and last polymer residue keys
â âââ last 191
â âââ residue_types { amino_acid 180, water 26 }
â âââ molecule 'GROWTH HORMONE' from COMPND
â âââ organism 'HOMO SAPIENS' from SOURCE
â âââ mol_id '1'
â âââ dbref [ { ... } ] as in the top-level dbref
â â ec and fragment are here too, in a
â â chain whose file gives them
â âââ residue_order [ '1', '2', '3', ... '574' ] file order, 206
â âââ residues keyed number + insertion code
â âââ 54
â â âââ resname 'PHE'
â â âââ number 54
â â âââ icode ''
â â âââ key '54'
â â âââ chain 'A'
â â âââ one 'F' '' when there is no letter for it
lib/Chem/Structure/Parser.pm view on Meta::CPAN
my $c = $info->{chains}{$cid};
if (my $s = $info->{seqres}{$cid}) {
$c->{seqres} = $s->{sequence};
$c->{seqres_length} = $s->{length};
$c->{n_missing} = $s->{length} - $c->{n_polymer} if defined $s->{length};
}
if (my $e = $info->{entity_of_chain}{$cid}) {
$c->{mol_id} = $e->{mol_id};
$c->{molecule} = $e->{molecule} if defined $e->{molecule};
$c->{organism} = $e->{organism} if defined $e->{organism};
$c->{fragment} = $e->{fragment} if defined $e->{fragment};
$c->{ec} = $e->{ec} if defined $e->{ec};
}
$c->{dbref} = $info->{dbref}{$cid} if $info->{dbref}{$cid};
}
return $info;
}
sub _id_from {
my ($info, $file) = @_;
return $info->{header}{id_code} if length($info->{header}{id_code} || '');
lib/Chem/Structure/Parser.pm view on Meta::CPAN
sub _entities {
my ($info) = @_;
my %by_chain;
for my $id (keys %{ $info->{compound} }) {
my $c = $info->{compound}{$id};
my $s = $info->{source}{$id} || {};
for my $cid (@{ $c->{chain} || [] }) {
$by_chain{$cid} = {
mol_id => $id,
molecule => $c->{molecule},
fragment => $c->{fragment},
ec => $c->{ec_number} || $c->{ec},
organism => $s->{organism_scientific},
taxid => $s->{organism_taxid},
expressed_in => $s->{expression_system},
};
}
}
$info->{entity_of_chain} = \%by_chain;
return $info;
}
lib/Chem/Structure/Parser.pm view on Meta::CPAN
â âââ pmid '9571026'
â âââ doi '10.1006/JMBI.1998.1669'
âââ compound COMPND, by MOL_ID
â âââ 1
â â âââ mol_id '1'
â â âââ molecule 'GROWTH HORMONE'
â â âââ chain [ 'A' ]
â â âââ engineered 'YES'
â â âââ mutation 'YES'
â âââ 2 { molecule 'GROWTH HORMONE RECEPTOR', chain [ 'B' ],
â fragment 'EXTRACELLULAR DOMAIN', engineered 'YES' }
âââ source SOURCE, by MOL_ID
â âââ 1 { organism_scientific 'HOMO SAPIENS', organism_common
â 'HUMAN', organism_taxid '9606', mol_id '1',
â expression_system 'ESCHERICHIA COLI',
â expression_system_taxid '562' }
âââ entity_of_chain COMPND and SOURCE, by chain
â âââ A { mol_id '1', molecule 'GROWTH HORMONE', fragment undef,
â â ec undef, organism 'HOMO SAPIENS', taxid '9606',
â â expressed_in 'ESCHERICHIA COLI' }
â âââ B { ..., fragment 'EXTRACELLULAR DOMAIN' }
âââ seqres what SEQRES says was in the crystal
â âââ A
â â âââ sequence 'FPTIPLSRLFDNAMLRAHRLHQLAFDTYQEFEEAYIPKEQKYSFLQ...'
â â âââ residues [ 'PHE', 'PRO', 'THR', 'ILE', ... ] 191 of them
â â âââ length 191
â âââ B { sequence, residues, length 238 }
âââ dbref
â âââ A [ { database 'UNP', accession 'P01241',
â db_id 'SOMA_HUMAN', seq_begin '1', seq_end '191',
â db_begin '27', db_end '217', chain 'A' } ]
lib/Chem/Structure/Parser.pm view on Meta::CPAN
â âââ missing_residues
â â [ 130, 131, 132, 133, 134, 135,
â â 149, 150, 151, 152, 153 ]
â âââ first 1 the first and last polymer residue keys
â âââ last 191
â âââ residue_types { amino_acid 180, water 26 }
â âââ molecule 'GROWTH HORMONE' from COMPND
â âââ organism 'HOMO SAPIENS' from SOURCE
â âââ mol_id '1'
â âââ dbref [ { ... } ] as in the top-level dbref
â â ec and fragment are here too, in a
â â chain whose file gives them
â âââ residue_order [ '1', '2', '3', ... '574' ] file order, 206
â âââ residues keyed number + insertion code
â âââ 54
â â âââ resname 'PHE'
â â âââ number 54
â â âââ icode ''
â â âââ key '54'
â â âââ chain 'A'
â â âââ one 'F' '' when there is no letter for it
# chain, every residue, every atom, and the counts over them.
#
# What is taken back out is the handful of things _chain_stats() folds into a
# chain from the header, because those are the header's answer and not the
# coordinates', and the header section below tests them against each other one
# at a time. A fixture pair cannot be equal on all of them anyway -- mini.cif
# names the entity every ligand belongs to and mini.pdb has no record that
# does -- and burying that in this comparison would only make it say
# 'structures differ' about something the header tests say properly.
my @FROM_HEADER = qw(seqres seqres_length n_missing mol_id molecule organism
fragment ec dbref);
sub coords {
my ($i) = @_;
my %s = %{ $i->{stats} };
delete $s{n_lines}; # an mmCIF row and a PDB record are not the same line
my $strip = sub {
my ($set) = @_;
return { map {
my %c = %{ $set->{$_} };
delete @c{@FROM_HEADER};
t/real_cif.t view on Meta::CPAN
my ($i) = @_;
canon_charges($i);
my %s = %{ $i->{stats} };
delete $s{n_lines}; # an mmCIF row and a PDB record are not the same line
my %c;
for my $cid (keys %{ $i->{chains} }) {
my %x = %{ $i->{chains}{$cid} };
# what _chain_stats() folded in from the header, which the conversion
# below does not carry across and which t/cif.t tests on its own
delete @x{qw(seqres seqres_length n_missing mol_id molecule organism
fragment ec dbref)};
$c{$cid} = \%x;
}
return { chains => \%c, chain_order => $i->{chain_order}, stats => \%s };
}
# --- consistency, for a structure with nothing to compare it against -------
sub adds_up {
my ($info, $name) = @_;
my $atoms = 0;
$atoms += $info->{chains}{$_}{n_atoms} for @{ $info->{chain_order} };
( run in 1.767 second using v1.01-cache-2.11-cpan-364913b4093 )