Core iTOps Tube

Wednesday, 9 May 2012

help to print all the contents under chosen records in perl

Hi,

I have a file in which I have to separate genes from phenotype data. I have written a program as given below which prints just the gene records.

1. But I want to print all the data under each specified record to the output file. So the file has all the data like for every record. An example of a record with all the data is given below.

2.The program below gives me only the gene list but I want all the data as given below also in my output file. Every separate record starts with the line *RECORD*.



*RECORD*

*FIELD* NO

100050

*FIELD* TI

100050 AARSKOG SYNDROME, AUTOSOMAL DOMINANT

*FIELD* TX

Grier et al. (1983) reported father and 2 sons with typical Aarskog

syndrome, including short stature, hypertelorism, and shawl scrotum.

They tabulated the findings in 82 previous cases. X-linked recessive

inheritance has repeatedly been suggested (see 305400). The family

reported by Welch (1974) had affected males in 3 consecutive

generations. Thus, there is either genetic heterogeneity or this is an

autosomal dominant with strong sex-influence and possibly ascertainment

bias resulting from use of the shawl scrotum as a main criterion.

Stretchable skin was present in the cases of Grier et al. (1983).



Teebi et al. (1993) reported the case of an affected mother and 4 sons

(including a pair of monozygotic twins) by 2 different husbands. They

suggested that the manifestations were as severe in the mother as in the

sons and that this suggested autosomal dominant inheritance. Actually,

the mother seemed less severely affected, compatible with X-linked

inheritance.



*FIELD* RF

1. Grier, R. E.; Farrington, F. H.; Kendig, R.; Mamunes, P.: Autosomal

dominant inheritance of the Aarskog syndrome. Am. J. Med. Genet. 15:

39-46, 1983.



2. Teebi, A. S.; Rucquoi, J. K.; Meyn, M. S.: Aarskog syndrome: report

of a family with review and discussion of nosology. Am. J. Med. Genet. 46:

501-509, 1993.



3. Welch, J. P.: Elucidation of a 'new' pleiotropic connective tissue

disorder. Birth Defects Orig. Art. Ser. X(10): 138-146, 1974.



*FIELD* CS



Growth:

Mild to moderate short stature



Head:

Normocephaly



Hair:

Widow's peak



Facies:

Maxillary hypoplasia;

Broad nasal bridge;

Anteverted nostrils;

Long philtrum;

Broad upper lip;

Curved linear dimple below the lower lip



Eyes:

Hypertelorism;

Ptosis;

Down-slanted palpebral fissures;

Ophthalmoplegia;

Strabismus;

Hyperopic astigmatism;

Large cornea



Ears:

Floppy ears;

Lop-ears



Mouth:

Cleft lip/palate



GU:

Shawl scrotum;

Saddle-bag scrotum;

Cryptorchidism



Limbs:

Brachydactyly;

Digital contractures;

Clinodactyly;

Mild syndactyly;

Transverse palmar crease;

Lymphedema of the feet



Joints:

Ligamentous laxity;

Osteochondritis dissecans;

Proximal finger joint hyperextensibility;

Flexed distal finger joints;

Genu recurvatum;

Flat feet



Skin:

Stretchable skin



Spine:

Cervical spine hypermobility;

Odontoid anomaly



Heme:

Macrocytic anemia;

Hemochromatosis



GI:

Hepatomegaly;

Portal cirrhosis;

Imperforate anus;

Rectoperineal fistula



Pulmonary:

Interstitial pulmonary disease



Thorax:

Sternal deformity



Inheritance:

Sex-influenced autosomal dominant form;

also X-linked form



*FIELD* CD

Victor A. McKusick: 6/4/1986



*FIELD* ED

carol: 02/16/2011

alopez: 6/3/1997

mimadm: 3/11/1994

carol: 7/7/1993

supermim: 3/16/1992

supermim: 3/20/1990

ddp: 10/26/1989

marie: 3/25/1988



[

#!/usr/bin/perl

open(DATA, 'omim.txt');

# or die("Could not open omim file.");

open(MYOUTPUT, ">omimgenes.txt");

# or die ("could not open omimgenes file.");

while(<DATA>)

{

if (/^\*FIELD\*\sTI$/)

{

my $gene_record=readline(DATA);

foreach ($gene_record =~m/^\*/)

{

print MYOUTPUT $gene_record;

}

}

}

close(MYOUTPUT);

close(DATA);

]




No comments:

Post a Comment