Commits

Sarah Richardson committed 19ba30e

Repeat Smasher going gold

  • Participants
  • Parent commits bf0cccf

Comments (0)

Files changed (2)

bin/BS_RepeatSmasher.pl

 
 my %p;
 GetOptions (
-      'CHROMOSOME=s'   => \$p{CHROMOSOME},
-      'EDITOR=s'       => \$p{EDITOR},
-      'MEMO=s'         => \$p{MEMO},
-      'SCALE=s'        => \$p{SCALE},
-      'STARTPOS=i'     => \$p{STARTPOS},
-      'STOPPOS=i'      => \$p{STOPPOS},
-      'OUTPUT=s'       => \$p{OUTPUT},
-			'help'           => \$p{HELP}
+  'CHROMOSOME=s'   => \$p{CHROMOSOME},
+  'EDITOR=s'       => \$p{EDITOR},
+  'MEMO=s'         => \$p{MEMO},
+  'SCALE=s'        => \$p{SCALE},
+  'STARTPOS=i'     => \$p{STARTPOS},
+  'STOPPOS=i'      => \$p{STOPPOS},
+  'OUTPUT=s'       => \$p{OUTPUT},
+	'help'           => \$p{HELP},
 );
 pod2usage(-verbose=>99, -sections=>'DESCRIPTION|ARGUMENTS') if ($p{HELP});
 
 die "BSERROR: No chromosome was named." unless ($p{CHROMOSOME});
 my $chr    = $BS->set_chromosome(-chromosome => $p{CHROMOSOME});
 my $chrseq = $chr->sequence;
-my $chrlen = length $chrseq;
+my $chrlen = $chr->len;
 my $GD = $chr->GD();
 $p{STARTPOS} = $p{STARTPOS} || 1;
 $p{STOPPOS} = $p{STOPPOS} || $chrlen;
 {
   my $genename = $gene->display_name;
   print "working on gene $genename\n";
-  my $newseq = $GD->repeat_smash($gene);
+  my $newseq = $GD->repeat_smash(-sequence => $gene->seq->seq);
   $newseq = $GD->rcomplement($newseq) if ($gene->strand == -1);
   $newchr->modify_feature(
     -feature      => $gene,
     -new_sequence => $newseq,
-    -tags         => {Note => 'repeat smashed'},
-    -preserve_overlapping_features => 1
+    -tags         => {Note => 'repeatsmashed'},
+    -comments     => ["$genename repeatsmashed"],
+    -preserve_overlapping_features => 1,
   );
   $REPORT->{$genename} = "Repeatsmashed!"
 }
 
 Required arguments:
 
-  -C,   --CHROMOSOME : The chromosome to be modified
-  -E,   --EDITOR : The person responsible for the edits
-  -M,   --MEMO : Justification for the edits
-  -STA, --STARTPOS : The first base eligible for editing
-  -STO, --STOPPOS : The last base eligible for editing
+  --CHROMOSOME : The chromosome to be modified
+  --EDITOR : The person responsible for the edits
+  --MEMO : Justification for the edits
+  --STARTPOS : The first base eligible for editing
+  --STOPPOS : The last base eligible for editing
 
 Optional arguments:
 
-  -SC,  --SCALE : [genome, chrom (def)] Which version number to increment
-  -OU,  --OUTPUT : html or txt
+  --SCALE : [genome, chrom (def)] Which version number to increment
+  --OUTPUT : html or txt
   -h,   --help : Display this message
 
 =cut

lib/Bio/BioStudio/Chromosome.pm

   $self->throw('argument to comments is not array reference')
     if ($comments && ref $comments ne 'ARRAY');
 
+  $self->sequence();
   if ($newseq && $preserve)
   {
     $self->{mask} || $self->feature_mask();
     $f->update();
   }
 
-  $self->add_to_comments($comments) if ($comments);
+  $comments = $comments || $f->display_name . ' modified';
+  $self->add_to_comments($comments);
   
   return;
 }