[Bioperl-guts-l] bioperl commit

Chris Mungall cjm at pub.open-bio.org
Thu May 27 18:27:00 EDT 2004


cjm
Thu May 27 18:26:59 EDT 2004
Update of /home/repository/bioperl/bioperl-live/Bio/SeqFeature/Tools
In directory pub.open-bio.org:/tmp/cvs-serv9993/Bio/SeqFeature/Tools

Modified Files:
	Unflattener.pm 
Log Message:
now deals with pseudogenes

bioperl-live/Bio/SeqFeature/Tools Unflattener.pm,1.23,1.24
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/SeqFeature/Tools/Unflattener.pm,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- /home/repository/bioperl/bioperl-live/Bio/SeqFeature/Tools/Unflattener.pm	2004/05/27 21:39:03	1.23
+++ /home/repository/bioperl/bioperl-live/Bio/SeqFeature/Tools/Unflattener.pm	2004/05/27 22:26:59	1.24
@@ -774,6 +774,10 @@
             CDS => 'mRNA',
 	    exon => 'mRNA',
 	    intron => 'mRNA',
+
+            pseudoexon => 'pseudogene',
+            pseudointron => 'pseudogene',
+            pseudotranscript => 'pseudogene',
            };
 }
 
@@ -1257,6 +1261,28 @@
 
    # -
 
+   # PSEUDOGENES, PSEUDOEXONS AND PSEUDOINTRONS
+   # these are indicated with the /pseudo tag
+   # these are mapped to a different type; they should NOT
+   # be treated as normal genes
+   foreach my $sf (@all_seq_features) {
+       if ($sf->has_tag('pseudo')) {
+           my $type = $sf->primary_tag;
+           # SO type is typically the same as the normal
+           # type but preceeded by "pseudo"
+           if ($type eq 'misc_RNA') {
+               $sf->primary_tag("pseudotranscript");
+           }
+           else {
+               $sf->primary_tag("pseudo$type");
+           }
+       }
+   }
+   # now some of the post-processing that follows which applies to
+   # genes will NOT be applied to pseudogenes; this is deliberate
+   # for example, gene models are normalised to be gene-transcript-exon
+   # for pseudogenes we leave them as pseudogene-pseudoexon
+
    # --- MAGIC ---
    my $need_to_infer_exons = 0;
    my $need_to_infer_mRNAs = 0;
@@ -1361,16 +1387,18 @@
    # --------- FINISHED GROUPING -------------
    # >>>>>>>>>                   <<<<<<<<<<<<<
 
+
+   # TYPE CONTAINMENT HIERARCHY (aka partonomy)
    # set the containment hierarchy if desired
    # see docs for structure_type() method
    if ($structure_type) {
        if ($structure_type == 1) {
 	   $self->partonomy(
-					{CDS => 'gene',
-					 exon => 'CDS',
-					 intron => 'CDS',
-					}
-				       );
+                            {CDS => 'gene',
+                             exon => 'CDS',
+                             intron => 'CDS',
+                            }
+                           );
        }
        else {
 	   $self->throw("structure_type $structure_type is currently unknown");
@@ -1387,7 +1415,6 @@
    }
 
    if ($use_magic) {
-       my @roots = $self->_get_partonomy_roots;
        # point all feature types without a container type to the root type.
        #
        # for example, if we have an unanticipated feature_type, say
@@ -1399,9 +1426,8 @@
 		   my $type = $sf->primary_tag;
 		   next if $type eq 'gene';
 		   my $container_type = $self->get_container_type($type);
-		   my $root = $roots[0];
 		   if (!$container_type) {
-		       $self->partonomy->{$type} = $root;
+		       $self->partonomy->{$type} = 'gene';
 		   }
 	       }
 	   }
@@ -1441,6 +1467,8 @@
 
    # lets see if there are any post-unflattening tasks we need to do
 
+   
+
    # INFERRING mRNAs
    if ($need_to_infer_mRNAs) {
        if ($self->verbose) {
@@ -2014,9 +2042,6 @@
        }
    }
 
-   # CONDITION:
-   # The graph %container 
-
    # DEBUGGING CODE
    if ($self->verbose && scalar(keys %unresolved)) {
        print "UNRESOLVED PAIRS:\n";



More information about the Bioperl-guts-l mailing list