If  you split the line like this:

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

It means the fields are separated by 'gi' or '37182815' or 'gb' or 'AY358849.1'. I don't think this is what you are looking for...

From the previous post, it seems the file is separated by tabs, so 'gi|37182815|gb|AY358849.1|' is the first field.

Then, to get the fields all you need to do is:

@seqs=split(/\t/,$seq);






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