How to change Bioperl's Bio::SeqIO default sequence folding?
1
0
Entering edit mode
6.7 years ago
predeus ★ 1.9k

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.4k views
ADD COMMENT
1
Entering edit mode
6.7 years ago
Chris Fields ★ 2.2k

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.

ADD COMMENT
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode

It's under:

perldoc Bio::SeqIO::fasta

Look for the width function.

ADD REPLY
0
Entering edit mode

Ahh, was staring right at it. Thanks again.

ADD REPLY

Login before adding your answer.

Traffic: 2084 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6