Hattori Hanzo <[email protected]> [09-12-12 11:16]:
>
> Hello,
>
> I am molecular biologist, so I'm frequently dealing with large sequence
> strings in fasta-format. Unfortunately, I'm not an IT expert.
> Fasta files are textfiles beginning with > followed by a header. After the
> first "return", sequence strings start until the end of the file or until
> the next > occurs marking the header of the next sequence. Here I give a
> short example:
>
> >Seq1
> CCACATCGCTCAGACACCATGGGGAAGGTGAAGGTCGG...
> >Seq2
> GCTGAGTACGTCGTGGAGTCCACTGGCGTCTTCACCACCATGGAGAAGGCTGGGGCTCATTTGCAGGGGGGAGCCAAAAGGGTCATCATCTCTGCC
>
> Mostly, sequences are received from online databases. The files contain
> "returns", which make it hard to easily process the files. I found out, that
> with the vim command :x,yj! I can join all lines from x to y without spaces.
> As i want the fasta file to consist of only two lines (header and sequence)
> I wonder if it's possible to tell vim to join all lines from line 2 to the
> last line of the file without having to look up the line number of the file.
> I imagine somting like :2,"last line of the file"j!. Is that possible?
>
> Second thing: Now i have a file consisting of the header in the first line
> and sequence in the second line. For further processing i would like to
> again introduce "returns" after a defined number of characters, e.g. 49, 69.
> I tried to find a solution in the web but didn't succeed. So i hope that you
> can help me with that problem.
>
> If you need additional information, please let me know.
>
> Ah, maybe it's important that I use vim on Windows platforms.
>
> With kind regards,
>
> David
> --
> View this message in context:
> http://old.nabble.com/Adjusting-line-lengths-tp26756335p26756335.html
> Sent from the Vim - General mailing list archive at Nabble.com.
>
> --
> You received this message from the "vim_use" maillist.
> For more information, visit http://www.vim.org/maillist.php
>
Hi David,
An answer to your first question may be:
Instead of saying
: x,yj!
use
: 2,$j!
which is translated to English:
from line two up to the end of the file join lines!
In case of your second question I am not quite sure but is seems
to me that it may be possible to tell vim to reformat the paragraph
-- in you case one loooooooooong sequence into lines of identical
lengths by using
gqap
on the according line.
:h gqap will telöl you more than I know :)
Have a nice weekend!
Best regards,
mcc
--
Please don't send me any Word- or Powerpoint-Attachments
unless it's absolutely neccessary. - Send simply Text.
See http://www.gnu.org/philosophy/no-word-attachments.html
In a world without fences and walls nobody needs gates and windows.
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php