[Biococoa-dev] Using an untyped class sequence

John Timmer jtimmer at bellatlantic.net
Mon Jul 4 18:02:09 EDT 2005


Ah, but good user interface would dictate that the menu item enabling method
should check the resident sequence type and disable non-functional menu
items, such as reverse complement, when a protein is loaded ;).


> Here is one situation where an untyped sequence class can be simpler
> to use. You have a BCSequence displayed in a nice BCSequenceView. The
> user chooses 'Reverse Complement' in the toolbar of the sequence
> window (the delegate is thus first responder and is self below). You
> want to create a new sequence from it.
> 
> - (IBAction)reverseComplement:(id)sender
> {
>      BCSequence *initialSequence = [self sequence];
>      [MyDocument newSequenceWindowWithSequence:[initialSequence
> reverseComplement]];
> }
> 
> 
> Now, I tried to think of how to implement that with typed sequences,
> though the overall architecture of the app might end up being quite
> different.
> 
> - (IBAction)reverseComplement:(id)sender
> {
>      BCSequence *initialSequence = [self selectedSequence];
>      BCSequence *newSequence;
>      if ( [originalSequence type] == BCSequenceDNA )
>          newSequence = [(BCDNASequence *)initialSequence
> reverseComplement]; //cast to avoid compiler warnings
>      else if ( [originalSequence type] == BCSequenceDNA )
>          newSequence = [(BCDNASequence *)initialSequence
> reverseComplement]; //cast to avoid compiler warnings
>      else
>          return;
>      [MyDocument newSequenceWindowWithSequence:newSequence];
> }
> 
> I know it is a contrived example, but I am just thinking a general
> sequence view program à-la DNAStrider.
> 
> charles
> 
> --
> Xgrid-at-Stanford
> Help science move fast forward:
> http://cmgm.stanford.edu/~cparnot/xgrid-stanford
> 
> Charles Parnot
> charles.parnot at gmail.com
> 
> 
> 
> _______________________________________________
> Biococoa-dev mailing list
> Biococoa-dev at bioinformatics.org
> https://bioinformatics.org/mailman/listinfo/biococoa-dev

_______________________________________________
This mind intentionally left blank





More information about the Biococoa-dev mailing list