biobee07 has asked for the wisdom of the Perl Monks concerning the following question:
input line: hg19_ensGene_ENST00000237247 range=chr1:67208779-67210057 5'pad=0 3'pad=0 strand=+ repeatMasking=none
info to be extracted: chr1:67208779-67210057:+
The perl code i use till now that works successfully is:while(<LOC>){ chomp; if(/^>(\w+)\s\w+\=(chr\w+)\:(\d+)\-(\d+)/) $loc{$1} = "$2:$3:$4:$5"; print $loc{$1}."\n"; } }
extracts the following info:chr1:67208779-67210057
however i am unable to extract + info from the input line above.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using regular expression to extract info from input line
by toolic (Bishop) on Mar 19, 2010 at 00:18 UTC | |
by biobee07 (Novice) on Mar 19, 2010 at 01:23 UTC | |
|
Re: Using regular expression to extract info from input line
by ww (Archbishop) on Mar 19, 2010 at 00:37 UTC | |
by biobee07 (Novice) on Mar 19, 2010 at 01:40 UTC | |
|
Re: Using regular expression to extract info from input line
by jethro (Monsignor) on Mar 19, 2010 at 00:33 UTC | |
by biobee07 (Novice) on Mar 19, 2010 at 01:20 UTC |