in reply to Re^2: concatenating multiple lines without using . operator
in thread concatenating multiple lines without using . operator

My impression is that s/he wanted the sequence to be on a single line, whereas write_seq auto-formats fasta output to columns of 60 of nucleotides/amino acids. That's why I settled with:

say $fasta_out $seq_hash{$seq_id};

You should be able to set the width with $seq_obj->Bio::SeqIO::fasta::width($new_width). I'm able to set a new width and $seq_obj->Bio::SeqIO::fasta::width() returns this new width; however, I can't get it to actually print using the new width... it just reverts to 60. Any suggestions?

-Mike

edit: btw, the code I posted does keep the sequences in Fasta format.

Replies are listed 'Best First'.
Re^4: concatenating multiple lines without using . operator
by Cristoforo (Curate) on Jun 16, 2012 at 16:08 UTC
    Hi Mike

    I meant no critcism towards your post, but I'm not sure whether Bio::SeqIO can read a file where all the sequence is on 1 line rather than 60 chars to a line. Perhaps it can.    :-)

    I just wanted readers to know that there is a 'write_seq()' method so they don't have to manually, (and without error), write out the 'id', 'decscription' or 'sequence'.

    Again, I didn't mean to be critical of your post, but just to make readers aware of the write_seq method. (And I wasn't aware of the 'width' method and how it might be used).

    Chris

      Oh, no worries. I didn't feel criticized. ^__^ And ya, I had no idea about the 'width' call either, so I'm not sure if the inability for write_seq to properly use the custom width setting is a bug in the module or in the chair-keyboard interface.