Mailfasta in the rerun

Thon de Boer deboer at balaena.bio.vu.nl
Tue Jul 17 12:36:51 EST 1990


The posting of yesterday of my program 'mailfasta' had some bugs so here it is again. Sorry for the double posting !

I wrote a program which uses the services offered by GenBank and EMBL for 
doing FASTA searches. It will send a sequence to a mail-server which will do a
sequence similarity search against the specified databases using the FASTA
program written by William Pearson and David Lipman.
The program runs interactive and is easy to use.
It can read files in the Pearson format, DNA strider files or plain DNA and
PROTEIN files with no comment lines.
For more information about the FASTA mail servers you can contact GenBank 
or EMBL. (send "HELP" in the subject field of a mail message to
SEARCH at GENBANK.BIO.NET or FASTA at EMBL (bitnet/EARN etc))
or FASTA at EMBL (bitnet/EARN etc))

Hope you can use it

-------------------------------------------------------------------------------
 _______                 ___           Thon de Boer
    /                   /__/           Dept. of Microbiological physiology
   //   __ __  _   __  /  \ __ __ __   Biological Faculty
  //-- / // / / \ /_/ /   // //_//  '  Vrije Universiteit, Amsterdam, Holland
 //  //_// / /__//_  /___//_//_ /      deboer at bio.vu.nl
-------------------------------------------------------------------------------
#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  mfasta mfasta/cid.c mfasta/getentry mfasta/mailfasta
#   mfasta/mailfasta.doc
# Wrapped by deboer at bio.vu.nl on Tue Jul 17 19:22:46 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test ! -d 'mfasta' ; then
    echo shar: Creating directory \"'mfasta'\"
    mkdir 'mfasta'
fi
if test -f 'mfasta/cid.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mfasta/cid.c'\"
else
echo shar: Extracting \"'mfasta/cid.c'\" \(580 characters\)
sed "s/^X//" >'mfasta/cid.c' <<'END_OF_FILE'
X#include <stdio.h>
X
Xmain ()
X{
X int ca,cc,cg,ct,total,i;
X float result;
X char ch;
X ca=cc=cg=ct=total=i=0;
X while((ch = getchar()) == ';') readln();
X if (ch =='>') readln();
X while((ch = getchar()) != EOF)
X { switch (ch)
X   { case 'a':
X     case 'A': ca++; break;
X     case 'c':
X     case 'C': cc++; break;
X     case 't':
X     case 'T': ct++; break;
X     case 'g':
X     case 'G': cg++; break;
X   }
X   if (((ch>=65)&&(ch<=90))||((ch>=97)&&(ch<=122))) total++;
X}
X result = (float)(ca+cc+ct+cg)/total;
X if (result>=.85) exit(0);
X else exit(1);
X}
X
Xreadln()
X{
X while(getchar() != 10);
X}
END_OF_FILE
if test 580 -ne `wc -c <'mfasta/cid.c'`; then
    echo shar: \"'mfasta/cid.c'\" unpacked with wrong size!
fi
chmod +x 'mfasta/cid.c'
# end of 'mfasta/cid.c'
fi
if test -f 'mfasta/getentry' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mfasta/getentry'\"
else
echo shar: Extracting \"'mfasta/getentry'\" \(294 characters\)
sed "s/^X//" >'mfasta/getentry' <<'END_OF_FILE'
X#!/bin/csh
Xif ($1 != '') then
X  foreach i ($*)
X    echo $i | mail retrieve at genbank.bio.net
X    end
Xelse
X  echo getentry: Retrieve a sequence database entry via mail from GenBank
X  echo 'Usage: getentry  entry [entry entry ....]'
X  echo ' entry can be an accession number or a locus name'
Xendif
END_OF_FILE
if test 294 -ne `wc -c <'mfasta/getentry'`; then
    echo shar: \"'mfasta/getentry'\" unpacked with wrong size!
fi
chmod +x 'mfasta/getentry'
# end of 'mfasta/getentry'
fi
if test -f 'mfasta/mailfasta' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mfasta/mailfasta'\"
else
echo shar: Extracting \"'mfasta/mailfasta'\" \(6214 characters\)
sed "s/^X//" >'mfasta/mailfasta' <<'END_OF_FILE'
X#!/bin/csh
Xecho ' '
Xecho ' '
Xecho '                                 MailFasta'
Xecho '                                 *********'
Xecho By Thon de Boer
Xecho Department of Microbiological physiology
Xecho Vrije universiteit AMSTERDAM  Holland.
Xecho This program is in the Public Domain
Xecho 'Send comments to deboer at bio.vu.nl (email).'
Xecho ' '
Xecho Use \'mailfasta -q\' to get the queue from the fasta mail server
Xecho " or 'mailfasta [sequencefile1 sequencefile2 ..]'"
Xecho ' '
Xecho This program will read a sequence file and mail it to
Xecho 'GenBank (or EMBL) were it will be scanned against the sequence databases'
Xecho 'using the FASTA program'
Xecho ' '
Xecho ' '
Xset stop = false
Xwhile ($stop == false)
Xif ($1 == '') then
X  set argument = empty
Xelse
X  set argument = $1
Xendif
Xswitch ($argument)
Xcase -q:
X        echo QUEUE | mail SEARCH at GENBANK.BIO.NET
X        echo Queue command send
X        exit
X        breaksw
Xcase -*:
X        echo mailfasta: Unknow flag \'$argument\'
X        echo Use \'mailfasta -q\' to get the queue from the fasta mail server
X        echo " or 'mailfasta [sequencefile1 sequencefile2 ..]'"
X        exit
X        breaksw
Xendsw
Xif ($argument == empty) then
Xset good=false
Xwhile ($good == false)
Xecho Enter the filename wich contains the sequence
Xset file=$<
Xif ($file != '') then
X  if !(-f $file) then
X    echo mailfasta: File \'$file\' does not exist
X  else
X    echo ' '
X    more $file
X    echo ' '
X    echo 'Is this the right file ? ([yes]/no)'
X    set choice = $<
X    switch ($choice)
X    case n*:
X         breaksw
X    default:
X         set good=true
X         breaksw
X    endsw
X  endif
Xendif
Xend
Xelse if !(-f $argument) then
X  echo mailfasta: File \'$argument\' does not exist
X  exit
Xelse
X  set file = $argument
Xendif
Xif {(cid < $file)} then
X      set type = DNA
X    else
X      set type = PROTEIN
X    endif
Xecho ' '
Xecho Now using $type file: $file
Xecho '*********'
Xgrep '>' $file
Xgrep ';' $file
Xecho ' '
Xendif
Xset db1 = (genbank/all genbank/new genpept/all genpept/new embl/all embl/new swiss-prot/all nbrf genbank/primate genbank/rodent genbank/other_mammalian genbank/other_vertebrate genbank/invertebrate genbank/plant genbank/organelle genbank/bacterial)
Xset db2 = (genbank/structural_rna genbank/viral genbank/phage genbank/synthetic genbank/unannotated)
Xset db = ($db1 $db2)
Xecho 'Which database(s) do you want to search ?'
Xecho ' '
Xif ($type == DNA) echo '    1   All GenBank sequences (including new seq since latest release)'
Xif ($type == DNA) echo '    2   The new GenBank entries'
Xif ($type == PROTEIN) echo '    3   All translated protein reading frames from GenBank'
Xif ($type == PROTEIN) echo '    4   The new entries of translated protein reading frames'
Xif ($type == DNA) echo '    5   All EMBL sequences (including the new sequences)'
Xif ($type == DNA) echo '    6   The new EMBL entries'
Xif ($type == PROTEIN) echo '    7   All SWISS-PROT protein entries'
Xif ($type == PROTEIN) echo '    8   All NBRF/PIR protien entries (results return very slow) '
Xecho ' '
Xif ($type == DNA) then
Xecho ' GenBank subdivisions (for faster searching)'
Xecho ' '
Xecho '    9   The primate sequences            16  The bacterial sequences'
Xecho '    10  The rodent sequences             17  The structural RNA sequences'
Xecho '    11  The other mammalian sequences    18  The viral sequences'
Xecho '    12  The other vertebrate seq         19  The phage sequences'
Xecho '    13  The invertebrate sequences       20  The synthetic sequences'
Xecho '    14  The plant sequences              21  The unannotated sequences'
Xecho '    15  The organelle sequences'
Xecho ' '
Xendif
Xset good=false
Xwhile ($good == false)
X  echo 'Enter the number(s) of your choice (seperated by a <SPACE>)'
X  set choice=$<
X  if ("$choice" != "") set good



More information about the Bio-soft mailing list