Hi Aditi.

During the split, what you have specifid is to match:

gi OR 37182815 OR gb OR AY358849.1 ...

That's what is giving the result you have. I.e. the | means OR in a
regexp like the one used in split...

Easiest solution is to escape the pipe character, i.e.:

@seqs=split(/gi\|37182815\|gb\|AY358849.1\|/,$seq);

Should lead you closer to a solution to your headaches..

//Anders//


On Fri, 2004-06-11 at 08:51, aditi gupta wrote:
> hi to all,
>  
> i have a file $seq,  in following format:
>  
> gi|37182815|gb|AY358849.1| gi|2353725|gb|AF015490.1|AF015490 100.00 16 0 0 544 559 
> 320 335   4.2 32.21
> gi|37182815|gb|AY358849.1| gi|1335960|gb|U55203.1|BTU55203 100.00 16 0 0 544 559 380 
> 395   4.2 32.21
> gi|37182815|gb|AY358849.1| gi|1335958|gb|U55202.1|BTU55202 100.00 16 0 0 544 559 443 
> 458   4.2 32.21
>  
> 
> i split it into arrays using:
>  
> @seqs=split(/gi|37182815|gb|AY358849.1|/,$seq);
>  
> but when i printed the array,it was:
>  
> ||||    |2353725||AF015490.1|AF015490   100.00  16      0       0       544
> 559     320     335       4.2   32.21
> ||||    |1335960||U55203.1|BTU55203     100.00  16      0       0       544
> 559     380     395       4.2   32.21
> ||||    |1335958||U55202.1|BTU55202     100.00  16      0       0       544
> 559     443     458       4.2   32.21
> 
>  
> i.e. the second occurance of gi is also being deleted. Also ' | ' separators present 
> in  /gi|37182815|gb|AY358849.1|/
> is still present.can these be removed?and can the second gi,since it is an accession 
> no. and will be required later, be from deletion?
>  
> 
> please help!!
>  
> -aditi
> 
> Yahoo! India Matrimony: Find your partner online.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to