Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use Bio::Phenotype::OMIM::OMIMparser;
- $omim_parser = Bio::Phenotype::OMIM::OMIMparser->new( -genemap => "genemap",
- -omimtext => "omim.txt" );
- my $parsedOMIM="parsed.OMIM.txt";
- open my $fh, ">", $parsedOMIM or die "Can't open $parsedOMIM: $!";
- print $fh "ID" . "\t" . "Disease" . "\t" . "Genes" . "\n";
- while ( my $omim_entry = $omim_parser->next_phenotype() ) {
- # This prints everything.
- #~ print( $omim_entry->to_string() );
- #~ print "\n\n";
- # This gets individual data (some of them object-arrays)
- # (and illustrates the relevant methods of OMIMentry).
- my $numb = $omim_entry->MIM_number(); # *FIELD* NO
- my $title = $omim_entry->title(); # *FIELD* TI - first line
- my $alt = $omim_entry->alternative_titles_and_symbols(); # *FIELD* TI - additional lines
- my $mtt = $omim_entry->more_than_two_genes(); # "#" before title
- my $sep = $omim_entry->is_separate(); # "*" before title
- my $desc = $omim_entry->description(); # *FIELD* TX
- my $mm = $omim_entry->mapping_method(); # from genemap
- my $gs = $omim_entry->gene_status(); # from genemap
- my $cr = $omim_entry->created(); # *FIELD* CD
- my $cont = $omim_entry->contributors(); # *FIELD* CN
- my $ed = $omim_entry->edited(); # *FIELD* ED
- my $sa = $omim_entry->additional_references(); # *FIELD* SA
- my $cs = $omim_entry->clinical_symptoms_raw(); # *FIELD* CS
- my $comm = $omim_entry->comment(); # from genemap
- my $mini_mim = $omim_entry->miniMIM(); # *FIELD* MN
- # A Bio::Phenotype::OMIM::MiniMIMentry object.
- # class Bio::Phenotype::OMIM::MiniMIMentry
- # provides the following:
- # - description()
- # - created()
- # - contributors()
- # - edited()
- #
- # Prints the contents of the MINI MIM entry (most OMIM entries do
- # not have MINI MIM entries, though).
- #~ print $mini_mim->description()."\n";
- #~ print $mini_mim->created()."\n";
- #~ print $mini_mim->contributors()."\n";
- #~ print $mini_mim->edited()."\n";
- my @corrs = $omim_entry->each_Correlate(); # from genemap
- # Array of Bio::Phenotype::Correlate objects.
- # class Bio::Phenotype::Correlate
- # provides the following:
- # - name()
- # - description() (not used)
- # - species() (always mouse)
- # - type() ("OMIM mouse correlate")
- # - comment()
- my @refs = $omim_entry->each_Reference(); # *FIELD* RF
- # Array of Bio::Annotation::Reference objects.
- my @avs = $omim_entry->each_AllelicVariant(); # *FIELD* AV
- # Array of Bio::Phenotype::OMIM::OMIMentryAllelicVariant objects.
- # class Bio::Phenotype::OMIM::OMIMentryAllelicVariant
- # provides the following:
- # - number (e.g ".0001" )
- # - title (e.g "ALCOHOL INTOLERANCE" )
- # - symbol (e.g "ALDH2*2" )
- # - description (e.g "The ALDH2*2-encoded protein has a change ..." )
- # - aa_ori (used if information in the form "LYS123ARG" is found)
- # - aa_mut (used if information in the form "LYS123ARG" is found)
- # - position (used if information in the form "LYS123ARG" is found)
- # - additional_mutations (used for e.g. "1-BP DEL, 911T")
- my @cps = $omim_entry->each_CytoPosition(); # from genemap
- # Array of Bio::Map::CytoPosition objects.
- my @gss = $omim_entry->each_gene_symbol(); # from genemap
- # Array of strings.
- ### A handy string to store gene symbols
- my $geneSymbols = join(",", @gss);
- ### My query (this is just an example, I actually need to perform more complex queries)
- if ($title =~ /^#/) {
- print $fh $numb . "\t" . $title . "\t" . $geneSymbols . "\n";
- }
- }
- close $fh;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement