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 .
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
}
}
Hi
i am new to scripting. i have a file file.dat with content as :
CONTENT_STORAGE PERCENTAGE FLAG:
/storage_01 64% 0
/storage_02 17% 1
I need to update the value of FLAG for a particular CONTENT_STORAGE value
I have written the following code
#!/bin/sh
threshold=20... (1 Reply)
I have a text file like this:
subject1:LecturerA:10
subject2:LecturerA:40
if I was given string in column 1 and 2 (which are subject 1 and LecturerA) , i need to update 3rd field of that line containing that given string , which is, number 10 need to be updated to 100 ,for example.
The... (6 Replies)
I am trying to add a condition to the below perl that will capture the GTtag and place a specific string in the last field of each line. The problem is that the GT value used is not right after the tag rather it is a few fields away. The values should always be 0/1 or 1/2 and are in bold in the... (12 Replies)
In the tab-delimeted input file below I am trying to use awk to update the value in $2 if TYPE=ins in bold, by adding the value of
HRUN= in italics. In the below since in line 1 TYPE=ins the 117282541 value in $2 has 6 added because that is the value of HRUN=.
Hopefully the awk is a start but I... (2 Replies)
In the perl below I am trying to set/update the value of $14 (last field) in file2, using the matching NM_ in $12
or $9 in file2 with the NM_ in $2 of file1.
The lengths of $9 and $12 can be variable but what is consistent is the start pattern will always be NM_ and the end pattern is always
;... (4 Replies)
In the perl there is a default rule that sets f to VUS, and then a seris of rules that will change f based on the result that is
obtained from the rule. The code below is a rule that is supposed to be applicable to lines 2-4 because this rule just looks at the digit in f. So in line 2 f is 27... (4 Replies)
I have been reading old posts and trying to come up with a solution for the below: Use a tab-delimited input file to assign
point to variables that are used to update a specific field, Rank. I really couldn't find too much in the way of assigning points
to variable, but made an attempt at an awk... (4 Replies)
I have an input file with
A=xyz
B=pqr
I would want the value in Second Field (xyz or pqr) updated with a value present in Shell Variable based on the value passed in the first field. (A or B )
while read line
do
NEW_VALUE = `some functionality done on $line`
If $line=First Field-... (1 Reply)
Hi,
So awk is driving me crazy on this one. I have searched everywhere and read man, docs and every related post Google can find and still no luck. The actual files I need to run this on are sensitive in nature, but it is the same thing as if I needed to calculate weighted grades for multiple... (15 Replies)
Discussion started by: cotilloe
15 Replies
LEARN ABOUT DEBIAN
apache2::sitecontrol::rule
Apache2::SiteControl::Rule(3pm) User Contributed Perl Documentation Apache2::SiteControl::Rule(3pm)NAME
Apache2::SiteControl::Rule - Permission manager access rule.
DESCRIPTION
Each rule is a custom-written class that implements some aspect of your site's access logic. Rules can choose to grant or deny a request.
package sample::Test;
use strict;
use warnings;
use Carp;
use Apache2::SiteControl::Rule;
use base qw(Apache2::SiteControl::Rule);
sub grants($$$$)
{
my $this = shift;
my $user = shift;
my $action = shift;
my $resource = shift;
if($action eq "edit" && $resource->isa("sample::Record")) {
return 1 if($user{name} eq "root");
}
return 0;
}
sub denies($$$$)
{
return 0;
}
1;
The PermissionManager will only give permission if at least one rule grants permission, and no rule denies it.
It is important that your rules never grant or deny a request they do not understand, so it is a good idea to use type checking to prevent
strangeness. Assertions should not be used if you expect different rules to accept different resource types or user types, since each rule
is used on every access request.
EXPORT
None by default.
SEE ALSO
Apache2::SiteControl::UserFactory, Apache::SiteControl::ManagerFactory, Apache2::SiteControl::PermissionManager, Apache::SiteControl
AUTHOR
This module was written by Tony Kay, <tkay@uoregon.edu>.
COPYRIGHT AND LICENSE perl v5.14.2 2006-03-17 Apache2::SiteControl::Rule(3pm)