Sponsored Content
Top Forums Shell Programming and Scripting Perl to change value based on set of rules Post 303003256 by cmccabe on Monday 11th of September 2017 09:51:35 AM
Old 09-11-2017
I think the below will capture lines 2-6, but not line 1 (looks like 018328) is being captured by the regex. Is the syntax correct or is there a better way? Thank you Smilie.

perl
Code:
    if ($FuncrefGene !~ /exonic/i && $GeneDetailrefGene=~/\D(\d+)/) {   # capture the digits into $1
              if ($1 > 11) {   # 
                      $1 ||= 0;  # Give it a value of zero if no numeric value was found.
                        $classification = 'Likely Benign';  # Reclassify intronic variants (with distance only) based on distance to exon > 10 to Likely Benign
         }
     }
    else {
              if ($FuncrefGene !~ /exonic/i && $GeneDetailrefGene=~/(\D\d+)/) {   # capture the digits after any non-digit into $1
                 if ($1 > 11) {   # 
                      $1 ||= 0;  # Give it a value of zero if no numeric value was found.
                        $classification = 'Likely Benign';  # Reclassify intronic variants (with distance only) based on distance to exon > 10 to Likely Benign
         }
     }
    else {
              if ($FuncrefGene !~ /exonic/i) {
                 my ($transcript) = ($GeneDetailrefGene) =~ /(?:\.\d+[+*-])/;   # Get a numeric value if exists using (.) and (+/-) and capture digits into $transcript.
                           $transcript ||= 0;  # Give it a value of zero if no numeric value was found.
                             $classification = 'Likely Benign' if $transcript > 11; # Reclassify intronic variants (following c. nomenclature) to Likely Benign if distance greater than 10
         }
     }

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to change "set" values in perl, windows...

i am using perl in win2000advanced server... --------------------------- perl -version: --------------------------- This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) Copyright 1987-2001, Larry Wall Binary build 638 provided by... (1 Reply)
Discussion started by: sekar sundaram
1 Replies

2. Shell Programming and Scripting

Need to change a set of lines between two given Pattrens

Hi All I have a Small Requiement I wanted to replace all the Follwing lines as follows Input:: file1 EVALUATE WS-TEMP-ATTR(15:1) WHEN 'D' MOVE DFHDARK TO WS-ATTR-COLOR WHEN OTHER MOVE DFHDFT ... (9 Replies)
Discussion started by: pbsrinivas
9 Replies

3. UNIX for Dummies Questions & Answers

Server wide password enforcement rules? 90 day force change.

Using Solaris 9 and 10. What we want to do is set up global rules for our password files to restrict all users, not only new ones set up with the rules but also the ones that have been sitting on the system for years. Is there a global way to force all users to change their password every 90... (1 Reply)
Discussion started by: LordJezo
1 Replies

4. Solaris

help me to change the character set

dears i am using solaris 10 i am facing a problem when i make setup for solaris i choose the country egypt and i select the language north america but i forget to do that the i found the date Jun written in arabic i want to change character set to written in english -rw-r--r-- 1 root ... (4 Replies)
Discussion started by: hosney00ux
4 Replies

5. Shell Programming and Scripting

Matching string on two files based on match rules.

Hi, How to check if a string on file2 exactly matches with a part or complete string on file1, and return a match indicator based on some match rules. 1) only records on file1 with category A should be matched. for other category, the output match indicator should default to 'N' 2) on file2... (13 Replies)
Discussion started by: effay
13 Replies

6. Shell Programming and Scripting

Help with allocated text content based on specific rules...

Input file format: /tag="ABL" /note="abl homolog 2 /tag="ABLIM1" /note="actin binding LIM 1 /tag="ABP1" /note="amiloride binding protein 1 (amine oxidase (copper- containing)) /tag="ABR" /note="active BCR-related /tag="AC003042.1" /note="SDR family member 11 precursor . . . (4 Replies)
Discussion started by: perl_beginner
4 Replies

7. Shell Programming and Scripting

Generating a passwordlist based on rules

Hy there! Some time ago I encrypted the harddrive of my notebook. Now, I can't remember it correctly. I want to create a list with all possible combinations of the words I used (I still remember all the words....). The password was created like this: ... (1 Reply)
Discussion started by: santiago10k
1 Replies

8. Shell Programming and Scripting

Delete lines based on Rules

Hi My requirement is very simple . I juts need to delte some lines from a file. here comes theactual scenario I have some data in file like say srinivasa prabhu kumar antony srinivas king prabhu antony srinivas prabhu king yar venkata venkata kingson srinivas... (6 Replies)
Discussion started by: ptappeta
6 Replies

9. Shell Programming and Scripting

Filtering duplicates based on lookup table and rules

please help solving the following. I have access to redhat linux cluster having 32gigs of ram. I have duplicate ids for variable names, in the file 1,2 are duplicates;3,4 and 5 are duplicates;6 and 7 are duplicates. My objective is to use only the first occurrence of these duplicates. Lookup... (4 Replies)
Discussion started by: ritakadm
4 Replies

10. Shell Programming and Scripting

Perl to update field based on a specific set of rules

In the perl below, which does execute, I am having trouble with the else in Rule 3. The digit in f{8} is extracted and used to update f accordinly along with the value in f. There can be either - * or + before the number that is extracted but the same logic applies, that is if the value is greater... (5 Replies)
Discussion started by: cmccabe
5 Replies
Bio::SeqFeature::Gene::Transcript(3pm)			User Contributed Perl Documentation		    Bio::SeqFeature::Gene::Transcript(3pm)

NAME
Bio::SeqFeature::Gene::Transcript - A feature representing a transcript SYNOPSIS
# See documentation of methods. DESCRIPTION
A feature representing a transcript. 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 one of 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 - Hilmar Lapp Email hlapp@gmx.net APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ promoters Title : promoters() Usage : @proms = $transcript->promoters(); Function: Get the promoter features/sites of this transcript. Note that OO-modeling of regulatory elements is not stable yet. This means that this method might change or even disappear in a future release. Be aware of this if you use it. Returns : An array of Bio::SeqFeatureI implementing objects representing the promoter regions or sites. Args : add_promoter Title : add_promoter() Usage : $transcript->add_promoter($feature); Function: Add a promoter feature/site to this transcript. Note that OO-modeling of regulatory elements is not stable yet. This means that this method might change or even disappear in a future release. Be aware of this if you use it. Returns : Args : A Bio::SeqFeatureI implementing object. flush_promoters Title : flush_promoters() Usage : $transcript->flush_promoters(); Function: Remove all promoter features/sites from this transcript. Note that OO-modeling of regulatory elements is not stable yet. This means that this method might change or even disappear in a future release. Be aware of this if you use it. Returns : the removed features as a list Args : none exons Title : exons() Usage : @exons = $gene->exons(); ($inital_exon) = $gene->exons('Initial'); Function: Get all exon features or all exons of specified type of this transcript. Exon type is treated as a case-insensitive regular expression and is optional. For consistency, use only the following types: initial, internal, terminal. Returns : An array of Bio::SeqFeature::Gene::ExonI implementing objects. Args : An optional string specifying the primary_tag of the feature. exons_ordered Title : exons_ordered Usage : @exons = $gene->exons_ordered(); @exons = $gene->exons_ordered("Internal"); Function: Get an ordered list of all exon features or all exons of specified type of this transcript. Exon type is treated as a case-insensitive regular expression and is optional. For consistency, use only the following types: Returns : An array of Bio::SeqFeature::Gene::ExonI implementing objects. Args : An optional string specifying the primary_tag of the feature. add_exon Title : add_exon() Usage : $transcript->add_exon($exon,'initial'); Function: Add a exon feature to this transcript. The second argument denotes the type of exon. Mixing exons with and without a type is likely to cause trouble in exons(). Either leave out the type for all exons or for none. Presently, the following types are known: initial, internal, terminal, utr, utr5prime, and utr3prime (all case-insensitive). UTR should better be added through utrs()/add_utr(). If you wish to use other or additional types, you will almost certainly have to call exon_type_sortorder() in order to replace the default sort order, or mrna(), cds(), protein(), and exons() may yield unexpected results. Returns : Args : A Bio::SeqFeature::Gene::ExonI implementing object. A string indicating the type of the exon (optional). flush_exons Title : flush_exons() Usage : $transcript->flush_exons(); $transcript->flush_exons('terminal'); Function: Remove all or a certain type of exon features from this transcript. See add_exon() for documentation about types. Calling without a type will not flush UTRs. Call flush_utrs() for this purpose. Returns : the deleted features as a list Args : A string indicating the type of the exon (optional). introns Title : introns() Usage : @introns = $gene->introns(); Function: Get all intron features this gene structure. Note that this implementation generates these features on-the-fly, that is, it simply treats all regions between exons as introns, assuming that exons do not overlap. A consequence is that a consistent correspondence between the elements in the returned array and the array that exons() returns will exist only if the exons are properly sorted within their types (forward for plus- strand and reverse for minus-strand transcripts). To ensure correctness the elements in the array returned will always be sorted. Returns : An array of Bio::SeqFeature::Gene::Intron objects representing the intron regions. Args : poly_A_site Title : poly_A_site() Usage : $polyAsite = $transcript->poly_A_site(); Function: Get/set the poly-adenylation feature/site of this transcript. Returns : A Bio::SeqFeatureI implementing object representing the poly-adenylation region. Args : A Bio::SeqFeatureI implementing object on set, or FALSE to flush a previously set object. utrs Title : utrs() Usage : @utr_sites = $transcript->utrs('utr3prime'); @utr_sites = $transcript->utrs('utr5prime'); @utr_sites = $transcript->utrs(); Function: Get the features representing untranslated regions (UTR) of this transcript. You may provide an argument specifying the type of UTR. Currently the following types are recognized: utr5prime utr3prime for UTR on the 5' and 3' end of the CDS, respectively. Returns : An array of Bio::SeqFeature::Gene::UTR objects representing the UTR regions or sites. Args : Optionally, either utr3prime, or utr5prime for the the type of UTR feature. add_utr Title : add_utr() Usage : $transcript->add_utr($utrobj, 'utr3prime'); $transcript->add_utr($utrobj); Function: Add a UTR feature/site to this transcript. The second parameter is optional and denotes the type of the UTR feature. Presently recognized types include 'utr5prime' and 'utr3prime' for UTR on the 5' and 3' end of a gene, respectively. Calling this method is the same as calling add_exon($utrobj, 'utr'.$type). In this sense a UTR object is a special exon object, which is transcribed, not spliced out, but not translated. Note that the object supplied should return FALSE for is_coding(). Otherwise cds() and friends will become confused. Returns : Args : A Bio::SeqFeature::Gene::UTR implementing object. flush_utrs Title : flush_utrs() Usage : $transcript->flush_utrs(); $transcript->flush_utrs('utr3prime'); Function: Remove all or a specific type of UTR features/sites from this transcript. Cf. add_utr() for documentation about recognized types. Returns : a list of the removed features Args : Optionally a string denoting the type of UTR feature. sub_SeqFeature Title : sub_SeqFeature Usage : @feats = $transcript->sub_SeqFeature(); Function: Returns an array of all subfeatures. This method is defined in Bio::SeqFeatureI. We override this here to include the exon etc features. Returns : An array Bio::SeqFeatureI implementing objects. Args : none flush_sub_SeqFeature Title : flush_sub_SeqFeature Usage : $transcript->flush_sub_SeqFeature(); $transcript->flush_sub_SeqFeature(1); Function: Removes all subfeatures. This method is overridden from Bio::SeqFeature::Generic to flush all additional subfeatures like exons, promoters, etc., which is almost certainly not what you want. To remove only features added through $transcript->add_sub_SeqFeature($feature) pass any argument evaluating to TRUE. Example : Returns : none Args : Optionally, an argument evaluating to TRUE will suppress flushing of all transcript-specific subfeatures (exons etc.). cds Title : cds Usage : $seq = $transcript->cds(); Function: Returns the CDS (coding sequence) as defined by the exons of this transcript and the attached sequence. If no sequence is attached this method will return false. Note that the implementation provided here returns a concatenation of all coding exons, thereby assuming that exons do not overlap. Note also that you cannot set the CDS via this method. Set a single CDS feature as a single exon, or derive your own class if you want to store a predicted CDS. Example : Returns : A Bio::PrimarySeqI implementing object. Args : protein Title : protein() Usage : $protein = $transcript->protein(); Function: Get the protein encoded by the transcript as a sequence object. The implementation provided here simply calls translate() on the object returned by cds(). Returns : A Bio::PrimarySeqI implementing object. Args : mrna Title : mrna() Usage : $mrna = $transcript->mrna(); Function: Get the mRNA of the transcript as a sequence object. The difference to cds() is that the sequence object returned by this methods will also include UTR and the poly-adenylation site, but not promoter sequence (TBD). HL: do we really need this method? Returns : A Bio::PrimarySeqI implementing object. Args : features Title : features Usage : my @features=$transcript->features; Function: returns all the features associated with this transcript Returns : a list of SeqFeatureI implementing objects Args : none features_ordered Title : features_ordered Usage : my @features=$transcript->features_ordered; Function: returns all the features associated with this transcript, in order by feature start, according to strand Returns : a list of SeqFeatureI implementing objects Args : none perl v5.14.2 2012-03-02 Bio::SeqFeature::Gene::Transcript(3pm)
All times are GMT -4. The time now is 02:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy