Sakti has asked for the wisdom of the Perl Monks concerning the following question:
I've been struggling with generating hashes where after each Term the id becomes the key of a hash, and the is_a: fields after ! become the elements contained within an array in this key. something like:############### [ Term ] id: HP:0000007 name: Autosomal recessive inheritance alt_id: HP:0001416 alt_id: HP:0001526 def: "A mode of inheritance that is observed for traits related to a g +ene encoded on one of the autosomes (i.e., the human chromosomes 1-22 +) in which a trait manifests in homozygotes. In the context of medica +l genetics, autosomal recessive disorders manifest in homozygotes (wi +th two copies of the mutant allele) or compound heterozygotes (whereb +y each copy of a gene has a distinct mutant allele)." [ HPO:curators] synonym: "Autosomal recessive" EXACT [ ] synonym: "AUTOSOMAL RECESSIVE FORM" RELATED [ HPO:skoehler] synonym: "Autosomal recessive predisposition" RELATED [] is_a: HP:0000005 ! Mode of inheritance<br> [ Term ] id: HP:0000008 name: Abnormality of female internal genitalia def: "An abnormality of the female internal genitalia." [HPO:probinson +] is_a: HP:0000812 ! Abnormal internal genitalia is_a: HP:0010460 ! Abnormality of the female genitalia property_value: HP:0040005 "An abnormality of the `female internal gen +italia` (FMA:45654)." xsd:string {xref="HPO:probinson"} ##################
Another alternative to the array is to generate a hash of hashes where I save all values associated with an id and can access the is_a: fields directly. Can one of our advanced brothers enlighten me?? Thanks a lot!!! Saktihash{HP:0000007}[0]="Mode of inheritance" hash{HP:0000008}[0]="Abnormal internal genitalia" hash{HP:0000008}[1]="Abnormality of the female genitalia"
|
|---|