7 use base qw(Root Read Write Sequence::File);
17 next if /^\s*$/; # Skip blank lines
18 next if /^#/; # skip comment lines
19 # s/#.*//g; # Clear comments
21 my ($head, $field) = split /:/, $_, 2;
23 unless (defined $field and defined $head) {
24 carp "Line $. doesn't match concise file format, skipping";
29 my @fields = split /,/, $field;
31 my $new = Concise->new(id => $head);
33 $self->add_entries($new);
40 for ($self->get_entries) {
44 my $seq = join ',', @seq;
47 print $fh "$id:$seq\n";
57 Concise::File - Module to read Concise file
61 # Read a concise file and print the id's in the file
62 $concise = Concise::File->new(read_file => "path_to_file");
63 for ($concise->get_entries) {
69 This module allows you to read concise files and then get all the information held in the file or to select those entries you want by their IDs.
73 This module inherits from the Root, Read and Write modules. See these for default methods.
77 =item $concise->add_entries(@Concise)
79 Add a list of Concise objects to the Concise::File object.
81 =item $concise->get_entries
83 Returns a list of the entries held in the object. These are held as Concise objects.
85 =item $concise->get_entry_by_id( qr/foo/ )
87 Get entries dependant upon their IDs and a regex. The argument can either be a regex object or a string to be interpreted as a regex. A list of Concise objects is returned.
93 Jonathan Barber (jon@compbio.dundee.ac.uk)