Sponsored Content
Top Forums Programming REQUIRE HELP IN WRITING A PERL SCRIPT Post 302633341 by kaav06 on Tuesday 1st of May 2012 08:03:05 PM
Old 05-01-2012
REQUIRE HELP IN WRITING A PERL SCRIPT

Hi everyone

I am a beginner in perl and I am trying to write a perl script. Basically I want to separate gene entries from phenotype entries in a text file which contains huge number of records and copy them in a separate file. The gene entries will have * symbol after the line FIELD TI. A sample of a record is given below.

Code:
*RECORD*
*FIELD* NO
100050
*FIELD* TI
100050 AARSKOG SYNDROME, AUTOSOMAL DOMINANT
*FIELD* TX

It would be really great if someone could help me with this.

Last edited by Scrutinizer; 05-03-2012 at 02:09 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Perl Unix Script Writing

Hi Folks, I posted a few days ago, thanks for the responses. My original question was for renaming files of sort 3p2325294.dgn in a directory containing multiple files. I need to drop the first 2 characters and the last in a unix script using Perl. How does it differ from using the Unix... (1 Reply)
Discussion started by: Dinkster
1 Replies

2. Shell Programming and Scripting

Require Help for Shell Script

Hi friends, i am trying to print warning for partition size which exceed limit of 90% & other are ok. i m using below command which print partition which exceed 90% # df -h | sort -k5 | head -1 | awk 'END{ print $1" :- Not Having more space on This Partition"}' i want to print... (14 Replies)
Discussion started by: jagnikam
14 Replies

3. Shell Programming and Scripting

help for a perl script - writing to a data file

Hi, Here is my problem.. i have 2 files (file1, file2).. i have wrote the last two lines and first 4 lines of "file2" into two different variables .. say.. my $firstrec = `head -4 $file2`; my $lastrec = `tail -2 $file2`; and i write the rest of the file2 to a tmpfile and cat it with head... (2 Replies)
Discussion started by: meghana
2 Replies

4. Shell Programming and Scripting

Need help with writing a perl script

Hi all! I have to write a perl script that gets trashholds from a file and match them with an output of a command. The trashhold file looks like this: "pl-it_prod.GW.Sync.reply.*" "500" "-1" "" "" "pl-it_prod.A.*" "100" "-1" "" "" "application.log" ... (29 Replies)
Discussion started by: eliraza6
29 Replies

5. Shell Programming and Scripting

Require script to create two files

Hi folks, I have a input.file with the following contents:- flor geor enta vpal domi pegl cars mted four rose annc gabi ward dalv elph beac (8 Replies)
Discussion started by: mithalr
8 Replies

6. Shell Programming and Scripting

Writing a Perl Script that processes multiple files

I want to write a Perl script that manipulates multiple files. In the directory, I have files 250.*chr$.ped where * is from 1 to 1000 and $ is from 1-22 for a total of 22 x 10,000 = 22,000 files. I want to write a script that only manipulates files 250.1chr*.ped where * is from 1 to 22.... (10 Replies)
Discussion started by: evelibertine
10 Replies

7. Shell Programming and Scripting

Perl script for Calling a function and writing all its contents to a file

I have a function which does awk proceessing sub mergeDescription { system (q@awk -F'~' ' NR == FNR { A = $1 B = $2 C = $0 next } { n = split ( C, V, "~" ) if... (3 Replies)
Discussion started by: crypto87
3 Replies

8. Shell Programming and Scripting

Need help in writing perl script

Hi, I am new to perl. I am trying to write a small perl script for search and replace in a file : ======================================================== #!/usr/bin/perl my $searchStr = "register_inst\.write_t\("; my $replaceStr = "model\.fc_block\."; open(FILE,"temp.sv") ||... (2 Replies)
Discussion started by: chettyravi
2 Replies

9. Shell Programming and Scripting

How to automate a script that would require authentication?

Hey everyone... I'm just stretching my wings a bit and seeing how things work. If I wanted to write a script that had me ssh to my remote computer, how can this be done? If the script runs without me, how can I enter the required password? the same is true for any time of authentication method like... (2 Replies)
Discussion started by: Lost in Cyberia
2 Replies

10. Shell Programming and Scripting

Writing xml from excel sheet .xls using perl script

Hi all. I am working on the below requirement of generating .xml file from .xls file which i have , can someone please help me or in writing the perl script for the same: The xls file format is as below which has two columns and number of rows are not fixed: Fixlet Name ... (12 Replies)
Discussion started by: omkar.jadhav
12 Replies
Bio::Phenotype::Phenotype(3pm)				User Contributed Perl Documentation			    Bio::Phenotype::Phenotype(3pm)

NAME
Bio::Phenotype::Phenotype - A class for modeling phenotypes SYNOPSIS
#get Bio::Phenotype::PhenotypeI somehow print $phenotype->name(), " "; print $phenotype->description(), " "; my @keywords = ( "achondroplasia", "dwarfism" ); $phenotype->add_keywords( @keywords ); foreach my $keyword ( $phenotype->each_keyword() ) { print $keyword, " "; } $phenotype->remove_keywords(); foreach my $gene_symbol ( $phenotype->each_gene_symbol() ) { print $gene_symbol, " "; } foreach my $corr ( $phenotype->each_Correlate() ) { # Do something with $corr } foreach my $var ( $phenotype->each_Variant() ) { # Do something with $var (mutation) } foreach my $measure ( $phenotype->each_Measure() ) { # Do something with $measure } DESCRIPTION
This superclass implements common methods for classes modelling phenotypes. Bio::Phenotype::OMIM::OMIMentry is an example of an instantiable phenotype class (the design of this interface was partially guided by the need to model OMIM entries). Please note. This class provides methods to associate mutations (methods "each_Variant", ...) and genotypes (methods "each_Genotype", ...) with phenotypes. Yet, these aspects might need some future enhancements, especially since there is no "genotype" class yet. FEEDBACK
Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing lists Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists Support Please direct usage questions or support issues to the mailing list: bioperl-l@bioperl.org rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. Reporting Bugs report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR
Christian M. Zmasek Email: czmasek-at-burnham.org or cmzmasek@yahoo.com WWW: http://monochrome-effect.net/ Address: Genomics Institute of the Novartis Research Foundation 10675 John Jay Hopkins Drive San Diego, CA 92121 APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ new Title : new Usage : $obj = Bio::Phenotype::Phenotype->new( -name => "XY", -description => "This is ..." ); Function: Creates a new Phenotype object. Returns : A new Phenotype object. Args : -name => the name -description => the description of this phenotype -species => ref to the the species -comment => a comment init Title : init() Usage : $obj->init(); Function: Initializes this OMIMentry to all "" and empty lists. Returns : Args : name Title : name Usage : $obj->name( "r1" ); or print $obj->name(); Function: Set/get for the name or id of this phenotype. Returns : A name or id [scalar]. Args : A name or id [scalar] (optional). description Title : description Usage : $obj->description( "This is ..." ); or print $obj->description(); Function: Set/get for the description of this phenotype. Returns : A description [scalar]. Args : A description [scalar] (optional). species Title : species Usage : $obj->species( $species ); or $species = $obj->species(); Function: Set/get for the species of this phenotype. Returns : A species [Bio::Species]. Args : A species [Bio::Species] (optional). comment Title : comment Usage : $obj->comment( "putative" ); or print $obj->comment(); Function: Set/get for a comment about this phenotype. Returns : A comment [scalar]. Args : A comment [scalar] (optional). each_gene_symbol Title : each_gene_symbol() Usage : @gs = $obj->each_gene_symbol(); Function: Returns a list of gene symbols [scalars, most likely Strings] associated with this phenotype. Returns : A list of scalars. Args : add_gene_symbols Title : add_gene_symbols Usage : $obj->add_gene_symbols( @gs ); or $obj->add_gene_symbols( $gs ); Function: Pushes one or more gene symbols [scalars, most likely Strings] into the list of gene symbols. Returns : Args : scalar(s). remove_gene_symbols Usage : $obj->remove_gene_symbols(); Function: Deletes (and returns) the list of gene symbols [scalars, most likely Strings] associated with this phenotype. Returns : A list of scalars. Args : each_Variant Title : each_Variant() Usage : @vs = $obj->each_Variant(); Function: Returns a list of Bio::Variation::VariantI implementing objects associated with this phenotype. This is for representing the actual mutation(s) causing this phenotype. {* The "variants" data member and its methods will/might need to be changed/improved in one way or another, CZ 09/06/02 *} Returns : A list of Bio::Variation::VariantI implementing objects. Args : add_Variants Usage : $obj->add_Variants( @vs ); or $obj->add_Variants( $v ); Function: Pushes one or more Bio::Variation::VariantI implementing objects into the list of Variants. Returns : Args : Bio::Variation::VariantI implementing object(s). remove_Variants Title : remove_Variants Usage : $obj->remove_Variants(); Function: Deletes (and returns) the list of Bio::Variation::VariantI implementing objects associated with this phenotype. Returns : A list of Bio::Variation::VariantI implementing objects. Args : each_Reference Title : each_Reference() Usage : @refs = $obj->each_Reference(); Function: Returns a list of Bio::Annotation::Reference objects associated with this phenotype. Returns : A list of Bio::Annotation::Reference objects. Args : add_References Title : add_References Usage : $obj->add_References( @refs ); or $obj->add_References( $ref ); Function: Pushes one or more Bio::Annotation::Reference objects into the list of References. Returns : Args : Bio::Annotation::Reference object(s). remove_References Title : remove_References() Usage : $obj->remove_References(); Function: Deletes (and returns) the list of Bio::Annotation::Reference objects associated with this phenotype. Returns : A list of Bio::Annotation::Reference objects. Args : each_CytoPosition Title : each_CytoPosition() Usage : @cps = $obj->each_CytoPosition(); Function: Returns a list of Bio::Map::CytoPosition objects associated with this phenotype. Returns : A list of Bio::Map::CytoPosition objects. Args : add_CytoPositions Title : add_CytoPositions Usage : $obj->add_CytoPositions( @cps ); or $obj->add_CytoPositions( $cp ); Function: Pushes one or more Bio::Map::CytoPosition objects into the list of CytoPositions. Returns : Args : Bio::Map::CytoPosition object(s). remove_CytoPositions Title : remove_CytoPositions Usage : $obj->remove_CytoPositions(); Function: Deletes (and returns) the list o fBio::Map::CytoPosition objects associated with this phenotype. Returns : A list of Bio::Map::CytoPosition objects. Args : each_Correlate Title : each_Correlate() Usage : @corrs = $obj->each_Correlate(); Function: Returns a list of Bio::Phenotype::Correlate objects associated with this phenotype. (Correlates are correlating phenotypes in different species; inspired by mouse correlates of human phenotypes in the OMIM database.) Returns : A list of Bio::Phenotype::Correlate objects. Args : add_Correlates Title : add_Correlates Usage : $obj->add_Correlates( @corrs ); or $obj->add_Correlates( $corr ); Function: Pushes one or more Bio::Phenotype::Correlate objects into the list of Correlates. Returns : Args : Bio::Phenotype::Correlate object(s). remove_Correlates Title : remove_Correlates Usage : $obj->remove_Correlates(); Function: Deletes (and returns) the list of Bio::Phenotype::Correlate objects associated with this phenotype. Returns : A list of Bio::Phenotype::Correlate objects. Args : each_Measure Title : each_Measure() Usage : @ms = $obj->each_Measure(); Function: Returns a list of Bio::Phenotype::Measure objects associated with this phenotype. (Measure is for biochemically defined phenotypes or any other types of measures.) Returns : A list of Bio::Phenotype::Measure objects. Args : add_Measures Title : add_Measures Usage : $obj->add_Measures( @ms ); or $obj->add_Measures( $m ); Function: Pushes one or more Bio::Phenotype::Measure objects into the list of Measures. Returns : Args : Bio::Phenotype::Measure object(s). remove_Measures Title : remove_Measures Usage : $obj->remove_Measures(); Function: Deletes (and returns) the list of Bio::Phenotype::Measure objects associated with this phenotype. Returns : A list of Bio::Phenotype::Measure objects. Args : each_keyword Title : each_keyword() Usage : @kws = $obj->each_keyword(); Function: Returns a list of key words [scalars, most likely Strings] associated with this phenotype. Returns : A list of scalars. Args : add_keywords Title : add_keywords Usage : $obj->add_keywords( @kws ); or $obj->add_keywords( $kw ); Function: Pushes one or more keywords [scalars, most likely Strings] into the list of key words. Returns : Args : scalar(s). remove_keywords Title : remove_keywords Usage : $obj->remove_keywords(); Function: Deletes (and returns) the list of key words [scalars, most likely Strings] associated with this phenotype. Returns : A list of scalars. Args : each_DBLink Title : each_DBLink() Usage : @dbls = $obj->each_DBLink(); Function: Returns a list of Bio::Annotation::DBLink objects associated with this phenotype. Returns : A list of Bio::Annotation::DBLink objects. Args : add_DBLinks Title : add_DBLinks Usage : $obj->add_DBLinks( @dbls ); or $obj->add_DBLinks( $dbl ); Function: Pushes one or more Bio::Annotation::DBLink objects into the list of DBLinks. Returns : Args : Bio::Annotation::DBLink object(s). remove_DBLinks Title : remove_DBLinks Usage : $obj->remove_DBLinks(); Function: Deletes (and returns) the list of Bio::Annotation::DBLink objects associated with this phenotype. Returns : A list of Bio::Annotation::DBLink objects. Args : each_Genotype Title : each_Reference() Usage : @gts = $obj->each_Reference(); Function: Returns a list of "Genotype" objects associated with this phenotype. {* the "genotypes" data member and its methods certainly will/needs to be changed/improved in one way or another since there is no "Genotype" class yet, CZ 09/06/02 *} Returns : A list of "Genotype" objects. Args : add_Genotypes Title : add_Genotypes Usage : $obj->add_Genotypes( @gts ); or $obj->add_Genotypes( $gt ); Function: Pushes one or more "Genotypes" into the list of "Genotypes". Returns : Args : "Genotypes(s)". remove_Genotypes Title : remove_Genotypes Usage : $obj->remove_Genotypes(); Function: Deletes (and returns) the list of "Genotype" objects associated with this phenotype. Returns : A list of "Genotype" objects. Args : _check_ref_type Title : _check_ref_type Usage : $self->_check_ref_type( $value, "Bio::Annotation::DBLink" ); Function: Checks for the correct type. Returns : Args : The value to be checked, the expected class. perl v5.14.2 2012-03-02 Bio::Phenotype::Phenotype(3pm)
All times are GMT -4. The time now is 09:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy