home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / apps / science / readseq / stdfiles < prev    next >
Text File  |  1992-12-30  |  4KB  |  135 lines

  1. /* Stdfiles 
  2.     generate standard files to test readseq
  3. */
  4.  
  5. C
  6. #include <stdio.h>
  7. /* no sequence formats use chars > #126, ignore these */
  8. main(void)
  9. {
  10.     int c;
  11.     puts("> alphabet['!'..'~']");
  12.     for (c = '!'; c <= '~'; c++) putc(c,stdout);
  13.     putc('\n', stdout);
  14. }
  15.  
  16. link  -w  -t MPST -c 'MPS ' c.o  À
  17.         "{Libraries}"Interface.o  "{Libraries}"ToolLibs.o À
  18.         "{Libraries}"Runtime.o  "{CLibraries}"StdClib.o 
  19. link.out > alphabet.orig
  20.  
  21.  
  22. C
  23. #include <stdio.h>
  24. main(void)
  25. {
  26. /* note: symbols "*" and "/" removed as terminators for various formats */
  27. const char *aminos        = "ABCDEFGHIKLMNPQRSTVWXYZ";  
  28. const char *primenuc    = "ACGTU";
  29. const char *allsymbols     = "_.-?<>{}[]()!@#$%^&=+;:'|`~\"\\";
  30.  
  31.     char *c, all[256];
  32.     int    count;
  33.     
  34.     strcpy(all, aminos);
  35.     strcat(all, primenuc);
  36.     strcat(all, allsymbols);
  37.     puts("> nucleic/amino test");
  38.     for (count=0; count<4; count++) {
  39.         for (c = all; *c!=0; c++) putc(*c, stdout);
  40.         putc('\n', stdout);
  41.         }
  42. }
  43.  
  44. link  -w  -t MPST -c 'MPS ' c.o  À
  45.         "{Libraries}"Interface.o  "{Libraries}"ToolLibs.o À
  46.         "{Libraries}"Runtime.o  "{CLibraries}"StdClib.o 
  47. link.out > nucleic.std
  48.  
  49. #--------------------------
  50.  
  51. #standards (ship w/ readseq)
  52. #note: not all alphabet.orig chars are expected to be passed by
  53. #     readseq.  Numbers are dropped.
  54. readseq -p alphabet.orig > alphabet.std
  55. readseq -p -C  alphabet.std > upper.std
  56.  
  57. cat alphabet.orig
  58.     > alphabet['!'..'~']
  59.     !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
  60.  
  61. cat alphabet.std
  62.     >alphabet['!'..'~'], 83 bases, 9429 checksum.
  63.     !"#$%&'()*+-./:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]
  64.     ^_`abcdefghijklmnopqrstuvwxyz{|}~
  65.  
  66. cat upper.std
  67.     >alphabet['!'..'~'], 83 bases, 9429 checksum.
  68.     !"#$%&'()*+-./:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]
  69.     ^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~
  70.  
  71. cat nucleic.std
  72.     > nucleic/amino test
  73.     ABCDEFGHIKLMNPQRSTVWXYZACGTU_.-?<>{}[]()!@#$%^&=+;:'|`~"\
  74.     ABCDEFGHIKLMNPQRSTVWXYZACGTU_.-?<>{}[]()!@#$%^&=+;:'|`~"\
  75.     ABCDEFGHIKLMNPQRSTVWXYZACGTU_.-?<>{}[]()!@#$%^&=+;:'|`~"\
  76.     ABCDEFGHIKLMNPQRSTVWXYZACGTU_.-?<>{}[]()!@#$%^&=+;:'|`~"\
  77.  
  78. readseq -p nucleic.std
  79.     >nucleic/amino test, 228 bases, 5952 checksum.
  80.     ABCDEFGHIKLMNPQRSTVWXYZACGTU_.-?<>{}[]()!@#$%^&=+;
  81.     :'|`~"\ABCDEFGHIKLMNPQRSTVWXYZACGTU_.-?<>{}[]()!@#
  82.     $%^&=+;:'|`~"\ABCDEFGHIKLMNPQRSTVWXYZACGTU_.-?<>{}
  83.     []()!@#$%^&=+;:'|`~"\ABCDEFGHIKLMNPQRSTVWXYZACGTU_
  84.     .-?<>{}[]()!@#$%^&=+;:'|`~"\
  85.  
  86.  
  87. #----------------------------------
  88.  
  89. #test for general read/write of all chars:
  90. readseq -p alphabet.std -otest.alpha
  91. diff test.alpha alphabet.std
  92.  
  93. #test for valid toupper, general read/write:
  94. readseq -p -C  alphabet.std -otest.upper
  95. diff test.upper upper.std
  96. #for vms, use "-C" to preserve case
  97. # readseq -p "-C"  alphabet.std -otest.upper
  98.  
  99. #test for multiple sequence file conversions
  100. # leave out gcg, raw; 
  101. # test of long seq conversion ?
  102. # test of mail-header seq conversion ?
  103.  
  104. #test for valid format conversions
  105. readseq -v -p -f1 nucleic.std -otest.f1
  106. readseq -v -p -f2 test.f1 -otest.f2
  107. readseq -v -p -f3 test.f2 -otest.f3
  108. readseq -v -p -f4 test.f3 -otest.f4
  109. readseq -v -p -f5 test.f4 -otest.f5
  110. readseq -v -p -f6 test.f5 -otest.f6
  111. readseq -v -p -f7 test.f6 -otest.f7
  112. readseq -v -p -f8 test.f7 -otest.f8
  113. readseq -v -p -f1 test.f8 -otest.f1b   
  114. diff test.f1 test.f1b
  115. compare test.f1 test.f1b
  116.  
  117. readseq -v -p -f13 test.f8 -otest.f13   # raw, drops name
  118. readseq -v -p -f9 test.f8 -otest.f9       # zuker, little used
  119. #readseq -v -p -f10 test.f9 -otest.f10  # olsen, input only (output=raw)
  120. readseq -v -p -f11 test.f8 -otest.f11    # phylip 3.2, output only
  121. readseq -v -p -f12 test.f8 -otest.f12    # phylip 3.3, output only
  122. readseq -v -p -f14 test.f8 -otest.f14    # phylip 3.4, output only
  123.  
  124.  
  125. #clean up
  126. rm test.ד
  127.  
  128.  
  129. #-----------------------------
  130. # some general tests
  131.  
  132. readseq -h 
  133.  
  134. readseq
  135.