Hmmm. One way of doing it could be to read each sequence in the file, 
reading the header and the actual sequence in different variables. And then, 
format the sequence variable to remove all newlines using a regular 
expression. And then write them back to another file.

Hope this helps.

Prachi.


----Original Message Follows----
From: s wang <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: how can i get rid of these new line characters?
Date: Fri, 4 Oct 2002 08:00:19 -0700 (PDT)


i have just started writing some scripts in PERL and i am trying to catch a 
deadline, i really wish i could get some help for this problem. any 
suggestion is greatly appreciated.

i have a set of files with sequences aligned in the following format. i 
wonder how i can eliminate the new line characters within each sequence 
without touching those between sequences?

......

2 chr1 10761 10775 chr19 46520370 46520384 + 941
acaGGAAAAGAACAA
acaggaaaagaaggg

3 chr1 10776 11241 chrUn 45411478 45411944 - 12857
AAGAAGGAAGAAGAGGGTAGAGGAGAAGTGCAGCAAGGGTGGAGGGAGGTGCCCGCGCTGGGTCGGAGGAGCAGGAGTAT
GGAGGGAAGACTCCTGGGTGGCATGGAGCTCTTGCACCTCTAGGCACTGCCCAGCCCTGTGTCAGCCAGGGCTGAACCCCCACAGGATAAGGAACCTGTGTGTGTGACCAACAATCAAAG
CTACATCTGTGACACAACAGGACACTGCTATGGGCAGTCTCAGTTCTGGCTCGCGTGGACCATCACCATCA
TCCTGAGCTGCTGCTGTGTCTGCCACCACAGCCAAGCCAGCCCTCAAGTCCAGCAGTAGCAACATGAAATCAA
CCTGCCTGCCTATCCAGAAGCCCGCAATTACTCAGTGCTACCATTTTATTTCACCAAACTATTTATTACCTT
CTTATGAGGAAGTGGTGAAC
AAGAAGGAAGCAGAGGGAAGAAGAAATGAAGGAGGAGGGTGATAGTGCCATGGTGGAGAAACAGGAGGAG
CAGGGGCAGGGGCACTCTACACTGGACACTGTAGTGGACAGTCTCAGTGCTCCAGCTCTGAA
TTCTGGTATAAGTCCTTGCCTAGGGAGTTATTGGCATCCCAGGGTCTCAGTTACTGCCTCTGCTCCACAGGCAGAGG
AAAGCATGGGGTGTCCAGCCTTTTCTCACTCTTAGGGACAATGTTGACTTCTGACTGATGTGGACCATCATCATCT
TCCGGAGCTGCTGCTGTGTCTGCCACCAATGCTGAGCCCAGGCACTGCCTTCAGACCCAGCAATGACAGCATGAAATCAA
ATTGATGGCCTACCAGGAAGCCCACAATTACTCATCACTGCCATTTTAGTTCAGGTTTTTGCCAAACTATTTATTACCTC
CTTATGAGGAAGTGATGAAC

4 11242 11268 25467376 25467402 - 294
TAACCTCCACCTGTTTCCCTCCCTGTC
ATCTTCCAATCCCTTCCCCACCCTACC






---------------------------------
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!




_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to