At 12:06 -0800 26/02/2011, Richard Green wrote:
chr1 ucsc exon 226488874 226488906 0.000000
- . gene_id "NM_173083:12345"; transcript_id "NM_173083:12345";
chr1 ucsc exon 226496810 226497198 0.000000
- . gene_id "NM_173083:12345"; transcript_id "NM_173083:12345";
chr1 ucsc exon 2005086 2005368 0.000000 + .
gene_id "NM_001033581:12346"; transcript_id "NM_001033581:12346";
chr1 ucsc exon 2066701 2066786 0.000000 + .
gene_id "NM_001033581:12346"; transcript_id "NM_001033581:12346";
Here is the substitution command I am trying to use:
$data_string=~ s/$gene_id\"NM_173083\"\; transcript_id
\"NM_173083\"\;/\"NM_173083:12345\"\; \"NM_173083:12345\"\;/g;
$data_string=~ s/$gene_id\"NM_001033581\"\; transcript_id
\"NM_001033581\"\;/\"NM_001033581:12346\"\; \"NM_001033581:12346\"\;/g;
I don't know why I am not able to substitute at the end of each row in the
string.
What is $gene_id? Are you by any chance using '$' at the beginning
of your search pattern instead of the end?
Why are you escaping the quote marks?
Why is there no space after 'gene_id'?
JD
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/