~ubuntu-branches/ubuntu/trusty/bioperl/trusty

« back to all changes in this revision

Viewing changes to scripts/seq/seqretsplit.PLS

  • Committer: Package Import Robot
  • Author(s): Charles Plessy
  • Date: 2013-09-22 13:39:48 UTC
  • mfrom: (3.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20130922133948-c6z62zegjyp7ztou
Tags: 1.6.922-1
* New upstream release.
* Replaces and Breaks grinder (<< 0.5.3-3~) because of overlaping contents.
  Closes: #722910
* Stop Replacing and Breaking bioperl ( << 1.6.9 ): not needed anymore. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl
2
 
#
3
 
=head1 NAME
4
 
 
5
 
seqretsplit - split a sequence (or stream) into a single file per sequence
6
 
 
7
 
=head1 SYNOPSIS
8
 
 
9
 
  seqretsplit file1 file2 .. 
10
 
  # or
11
 
  seqretsplit < file1 
12
 
 
13
 
=head1 DESCRIPTION 
14
 
 
15
 
The script will split all sequences from fasta file(s) (or stdin) to
16
 
individual files. The filename is the sequence ID (everything before
17
 
the 1st whitespace in a FASTA header).  Currently it doesn't check to
18
 
see that it isn't overwriting an existing file so IDs should be unique
19
 
 
20
 
This is inspired by EMBOSS seqretsplit tool.
21
 
 
22
 
=head1 FEEDBACK
23
 
 
24
 
=head2 Mailing Lists
25
 
 
26
 
User feedback is an integral part of the evolution of this and other
27
 
Bioperl modules. Send your comments and suggestions preferably to
28
 
the Bioperl mailing list.  Your participation is much appreciated.
29
 
 
30
 
  bioperl-l@bioperl.org                  - General discussion
31
 
    http://bioperl.org/wiki/Mailing_lists  - About the mailing lists
32
 
 
33
 
=head2 Reporting Bugs
34
 
 
35
 
Report bugs to the Bioperl bug tracking system to help us keep track
36
 
of the bugs and their resolution. Bug reports can be submitted via
37
 
email or the web:
38
 
 
39
 
https://redmine.open-bio.org/projects/bioperl/
40
 
 
41
 
=head1 AUTHOR
42
 
 
43
 
Jason Stajich E<lt>jason_AT_bioperl_DOT_orgE<gt>
44
 
 
45
 
=cut
46
 
 
47
 
use strict;
48
 
use Bio::SeqIO;
49
 
my $in = Bio::SeqIO->new(-format => 'fasta',
50
 
                         -fh   => \*ARGV);
51
 
while( my $s = $in->next_seq ) {
52
 
    Bio::SeqIO->new(-format => 'fasta',
53
 
                    -file   => ">".$s->id.".fa")->write_seq($s);
54
 
}
55