Reverse Complement utility

Keith James k.james at bangor.ac.uk
Tue Aug 5 08:39:39 EST 1997

magoldst at ix.netcom.com (Marc Goldstein) writes:

> Hi,
> I am looking for a very simple utility that can run in the Win95 
> environment that will take an input sequence of up to a KB and create the 
> reverse-complement of it, and save that. The input could be either ascii 
> or GCG or similar or even just copy-paste into the utility.
> Anyone know of a utility to accomplish this? Please remove NOSPAM in 
> my address if using auto-reply functions.

Ignore this if you don't have Unix (or Windows + win32-Perl + Cygwin32 GNU
fileutils). If you have Perl available you can do:

perl -ln0e 'tr/ACGTNacgtn- /TGCANtgcan/d; print scalar reverse $_;' <infile

This will remove any "-" and spaces, though. To write to a file instead
of the screen, just add >outfile to the end, of course. Only for ascii
files... you will get a horrible mess with a GCG file! It's a handful to
type, so I alias it to something short. If you use GNU csplit you can get
it to take Pearson/Fasta files by splitting on the headers and directing
the output files through this.

Keith James Ph.D. - k.james at bangor.ac.uk  PGP 2.6.2i  Key ID 469A9FA1
Biodegradation Group                         *Encrypt and Survive*  
School of Biological Sciences    Guvf znl znxr ab frafr vs bar bs gur
University of Wales, Bangor, UK  vasvavgr ahzore bs zbaxrlf vf bssyvar

More information about the Bio-soft mailing list

Send comments to us at biosci-help [At] net.bio.net