| 1 | # POD documentation - main docs before the code | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | GenOO - A Modern Perl Framework for High Throughput Sequencing analysis | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | GenOO [jee-noo] is an object-oriented framework developed for the analysis of High Throughput Sequencing (HTS) data. | ||
| 10 | The primary aim of GenOO is to make simple HTS analyses easy and complicated analyses possible. | ||
| 11 | |||
| 12 | =head1 DESCRIPTION | ||
| 13 | |||
| 14 | GenOO models biological entities into objects and provides methods for the manipulation of high throughput | ||
| 15 | sequencing data. Using GenOO as a core development module reduces the overhead and complexity of managing | ||
| 16 | the data and the biological entities at hand. GenOO has been designed to be flexible, easily extendable with modular | ||
| 17 | structure and minimal requirements for external tools and libraries. | ||
| 18 | |||
| 19 | Source code: The source has been deposited in GitHub L<https://github.com/genoo/GenOO>. | ||
| 20 | |||
| 21 | Documentation: A cookbook with basic ideas and examples is available in GitHub L<https://github.com/genoo/GenOO/tree/master/cookbook> | ||
| 22 | |||
| 23 | Contribute: Please fork the GitHub repository and provide patches, features or tests. | ||
| 24 | |||
| 25 | Bugs: Please open issues in the GitHub repository | ||
| 26 | |||
| 27 | =head1 EXAMPLES | ||
| 28 | |||
| 29 | #################### | ||
| 30 | # Parse a BED file. Similar for SAM, Fasta, FastQ etc. | ||
| 31 | my $bed_parser = GenOO::Data::File::BED->new( | ||
| 32 | file => 'input_file.bed' | ||
| 33 | ); | ||
| 34 | while (my $record = $file_parser->next_record) { | ||
| 35 | # $record is an instance of GenOO::Data::File::BED::Record | ||
| 36 | print $record->name."\n"; # name | ||
| 37 | print $record->strand."\n"; # strand | ||
| 38 | print $record->length."\n"; # length | ||
| 39 | print $record->head_position."\n"; # genomic location of the 5'end of the read | ||
| 40 | print $record->to_string."\n"; # prints the record back in BED format | ||
| 41 | } | ||
| 42 | |||
| 43 | #################### | ||
| 44 | # Create gene models from a GTF file | ||
| 45 | my $transcript_collection = GenOO::TranscriptCollection::Factory->create('GTF', { | ||
| 46 | file => 'transcripts_file.gtf' | ||
| 47 | })->read_collection; | ||
| 48 | |||
| 49 | # The gene models are now in a region collection type object | ||
| 50 | # Loop on the collection and execute some code for each transcript | ||
| 51 | $transcript_collection->foreach_record_do(sub{ | ||
| 52 | my ($transcript) = @_; | ||
| 53 | |||
| 54 | print $transcript->id."\n" if $transcript->is_coding; | ||
| 55 | # more code | ||
| 56 | }); | ||
| 57 | |||
| 58 | #################### | ||
| 59 | # Remember the BED parser before? Now instead of parsing the file line by line we | ||
| 60 | # want to add its entries in a collection so we can perform range queries on it. | ||
| 61 | my $reads_collection = GenOO::RegionCollection::Factory->create('BED', { | ||
| 62 | file => 'input_file.bed' | ||
| 63 | })->read_collection; | ||
| 64 | |||
| 65 | # Get the reads of the BED file that overlap with a specified region | ||
| 66 | my @overlapping_reads = $reads_collection->records_overlapping_region($strand, $chromosome, $start, $stop) | ||
| 67 | |||
| 68 | # Any collection can be used to perform range queries on it, including the transcript collection above. | ||
| 69 | |||
| 70 | ... | ||
| 71 | # For more information and examples check the cookbook in L<https://github.com/genoo/GenOO/tree/master/cookbook> | ||
| 72 | |||
| 73 | =cut | ||
| 74 | |||
| 75 | # Let the code begin... | ||
| 76 | |||
| 77 | |||
| 78 | package GenOO; | ||
| 79 | $GenOO::VERSION = '1.5.0'; | ||
| 80 | use Modern::Perl; | ||
| 81 | |||
| 82 | 1; |