In article <3221DDDE.3F2B631E at llnl.gov>, Chris Barry <chbarry at llnl.gov> writes:
>Is there an easy way to convert an ABI file to a GCG file? REFORMAT
>doesn't seem to work for me. Thanks in advance.
Are you talking about the trace file or the text file? Assuming the latter
here is a DCL procedure that will do the trick. It worked the last few
times I tried it - I don't know if ABI has messed around with the format
since then. If you are on a Unix system it will at least show you what
needs to be done. One key thing - some ABI files have a ";" in them, some
don't.
Regards,
David Mathog
mathog at seqaxp.bio.caltech.edu
Manager, sequence analysis facility, biology division, Caltech
**********************************************************************
$! ***************************************************************
$! ABITOGCG.COM
$!
$! David Mathog, Biology Division, Caltech
$!
$! Command procedure to convert ABI format sequence to GCG sequence.
$! It will accept the name of the ABI file as a parameter, otherwise
$! it tells the user what the correct usage is.
$!
$! A different GCG file name can be applied by supplying it as a second
$! parameter.
$!
$! Legal Formats: ABItoGCG abi.seq
$! Legal Formats: ABItoGCG abi.seq;23 gcg.seq
$! Legal Formats: ABItoGCG <wildcarded> (NO P2 !)
$!
$! Also takes care of the case where there is no header info (straight
$! sequence)
$!
$!
$!
$! David Mathog, CalTech Biology, 3-JAN-1994
$! ************************************************************
$
$ on control_y then goto terminate
$ ws := "write sys$output"
$ iq := inquire/nopunctuation
$ my_ed := edit/edt/nocommand
$
$ lastfile = "nla0:"
$ if (P1 .eqs."")
$then
$ ws "ABItoGCG: fatal error: no ABI file specified"
$ ws ""
$ ws " Legal Formats: ABItoGCG abi.seq"
$ ws " ABItoGCG abi.seq;23 gcg.seq"
$ ws " ABItoGCG *.seq (no second parameter!)"
$ exit
$else
$ abifile = P1
$endif
$okabiname:
$!
$! make sure that this file exists!
$!
$ count = 1
$top:
$ file = F$SEARCH(abifile)
$ if(file.eqs."")
$ then
$ if(count .eq. 0)
$ then
$ ws "ABItoGCG: fatal error: the file ''abifile' does not exist"
$ exit
$ else
$ ws "ABItoGCG: done"
$ exit
$ endif
$ endif
$ if(file .eqs. lastfile)then exit
$ lastfile = file
$ count = count + 1
$
$
$ if (P2 .eqs."")
$then
$!
$! make up a GCG file name
$!
$ FILESPEC = F$PARSE(file,,,"NAME")
$ gcgfile = filespec + ".seq"
$else
$ gcgfile = P2
$endif
$okgcgname:
$!
$ write sys$Output "converting ''file' to ''gcgfile'"
$ chopup/infile='file'/outfile=killmeabitogcg.seq/default
$!
$! take care of those with/without ";" records
$!
$ define/user sys$Output nla0:
$ define/user sys$error nla0:
$ search killmeabitogcg.seq ";"
$ if($STATUS .eqs. "%X00000001")then goto hascomma
$ define/user sys$output nla0:
$ my_ed killmeabitogcg.seq
INSERT .; NO ABI COMMENTS
INSERT .;..
SUBS /-/N/R
EXIT
$goto doit
$!
$hascomma:
$ define/user sys$output nla0:
$ my_ed killmeabitogcg.seq
FIND ";>"
SUBS /-/N/R
FIND END
INSERT -";"+1;..
EXIT
$!
$doit:
$ define/user sys$output nla0:
$ reformat/outfile='gcgfile' killmeabitogcg.seq
$ delete killmeabitogcg.seq.*
$ goto top
$!
$terminate: