This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to change Bioperl's Bio::SeqIO default sequence folding?

Hello all,

I've been using Bioperl for some time, but not too much. A simple question came up and I'm not sure how to handle it.

When using write_seq function, it folds the sequence at 60 characters by default. How can I change this number or stop folding completely? I can re-fold the sequence with another script later, but that's not neat.

Thank you for any suggestions.

bioperl fasta fastq

1 answer

You should be able to set the width parameter on the output stream to be what you want:

    my $out = Bio::SeqIO->new(-file => ">outputfilename" ,
                           -width  => 100,
                           -format => 'fasta');

I think if this is set to 0, the sequence is printed to one line.

great, thanks. Where in the docs is it? Couldn't find it when I looked

It's under:

perldoc Bio::SeqIO::fasta

Look for the width function.

Ahh, was staring right at it. Thanks again.

Log in to answer this question.