FRAGMENT ASSEMBLY SYSTEM
8.1.	Introduction
8.1.1.	Goals
A fragment assembly system must accomplish several tasks to be useful in joining together partial sequences obtained from sequencing gels:

It should:
1) Allow easy entry of sequence data.
2) Help manage the data as one group or 'project'
3) Allow for screening gel sequences against accidentally-included vector sequence.
4) Determine overlaps between sequenced fragments.
5) Allow the user to manipulate (edit) aligned fragments easily. 
6) Generate and compare consensus sequences of aligned fragments.

The fragment assembly system departs from the rest of the GCG philosophy by automating many of its data manipulations. It stores backup files, knows where your data are and otherwise hides a lot of the organisation. This allows you to access the data, via the programs, without being concerned with the details of the database design.

8.1.2.	Summary of programs
The system consists of seven programs: NEWGELSTART, GELENTER, GELMERGE, GELASSEMBLE, GELOVERLAP, GELVIEW and GELDISASSEMBLE.

NEWGELSTART must be run at the beginning of each session to identify the project that the programs must work on. If it is a new project then you will notice that a new directory is formed. If it is an existing project then, by providing its name, NEWGELSTART identifies all the relevant files for the other programs.

GELENTER copies existing sequence files into the database. By entering one at a time you can check each sequence for vector sequences.

GELMERGE automatically aligns sequences in the database into groups called contigs. A contig is either a non-overlapped fragment or the consensus sequence of fragments which do overlap.

GELOVERLAP compares all the contigs in a project to one another and determines where their sequences coincide enough to identify overlapping sequences.

GELASSEMBLE is a multiple sequence editor for modifying and manipulating contigs. You can examine individual contigs and join them to, or separate them from, another contig.

GELVIEW shows the state of the database. It lists each contig and its constituent fragments.

GELDISASSEMBLE is the 'forget all alignments and start again' program. It takes apart all the consensus contigs and recreates a database of single fragment contigs.

8.2.	Fragment assembly tutorial
Appendix B describes the DIGISEQ program for reading sequences using a sonic digitiser, and how to transfer them to the VAX. This tutorial assumes those steps have already been done, and begins with a collection of sequences available for assembly in a separate work area. In the demonstration accounts this is directory [.GELS].

[.GELS] should have sequence files in it called MU*.SEQ.

If a collection of files is not available, copy the GCG example set:
$ FETCH MU*.SEQ

8.2.1.	NEWGELSTART
Create a new project called "Museqs".
$ Newgelstart
 What is the name of your fragment assembly project?  museqs
 NEWGELSTART cannot find this project. Is it a new one (* Yes *) ?  
 You have a new project named "MUSEQS". 
 Which vector sequence(s) would you like highlighted?  
 Which restriction site(s) would you like highlighted ?  AAGCTT
 Project MUSEQS has 0 fragments in 0 contigs. 
 You are ready to run the other fragment assembly programs.

AAGCTT is the HindIII restriction endonuclease site. You would use this part of Newgelstart to define linkage regions (eg: polylinker sequences) that should not have remained in the sequence.

8.2.2.	GELENTER
You will see twelve files called *.SEQ in your directory, and one called VEC.DAT. To enter the *.SEQ files into the database, without checking for vector sequence, nor restriction sites:
$ GELENTER/ENTER=MU*.SEQ
 Entering *.Seq into the database.

You will see a message naming each file as it is entered into the database, eg:
"Mu18"  42 nucleotides

8.2.3.	GELMERGE
GELMERGE discovers overlapping contigs in your project by comparing each contig to every other contig, and also each reverse-complement. It then creates the alignment.
$ GELMERGE

 What word size (* 7 *) ?  

 What fraction of the words in an overlap must match (* 0.80 *) ? 

 What is the minimum overlap length (* 14 *) ?  

   Reading ............
 Comparing ............
  Aligning ........
   Writing ....

          Input Contigs:         12
         Output Contigs:          4

The 'word size' is like that used for COMPARE - the number of consecutive residues that must be identical. The default of 7 combined with a minimum overlap of 14 may be unreasonable.

8.2.4.	GELVIEW
GELVIEW displays the CURRENT state of the database.

$ GELVIEW
 What should I call the output file (* Museqs.View *) ? 
 Museqs has 12 Fragments in 4 Contigs

Type the file Museqs.view . Note that the sequence Mu26b is left on its own.

8.2.5.	GELASSEMBLE
GELASSEMBLE first lets you scroll through the different contigs. When you select a contig (it may be a group of aligned gels), the aligned sequences are dispalyed. Use the many commands available to manipulate the contigs.
$ GELASSEMBL

You can see the first cluster displayed.

1) Use the right arrow repeatedly to see the different clusters.

2) Use the right or left arrows until you return to contig 3.

3) Press the ENTER key. (Note: this differs from the RETURN key).

You are now in the editor, with the cursor on gel mu27 (see top centre of the screen). Note the consensus sequence, at the bottom of the stack of fragments, has ambiguity codes. The highlighted areas on the fragments show where each fragment departs from the consensus sequence.

4) Press the up arrow once to reach the fragment name mu18b

5) Press CTRL-H to reach the 'head' of the fragment. (CTRL-E gets to the end)

6) Check the rest of the sequence by moving along it. The '>' moves 50 bases to the right; '<' moves to the left.

7) Move up to fragment mu26. Add and delete '.' (gap characters). Note the letter 'M' (=modified) that appears in the diagram at the bottom-left.

8) Type CTRL-Z. You are now in the command mode of the editor.

9) Enter 4,7 anchor. This anchors the group of fragments together, indicated by the letter 'A' in the lower diagram.

10) Now add and delete '.' to any of the fragments in the group.

11) Enter CTRL-Z 4,7 lock. Now attempt to amend the same group.

12) Move the cursor down to the consensus line. Enter CTRL-Z seqout.

13) Type CTRL-Z Contig to return to the contig selection.

14) CTRL-Z Exit saves all edited changes and ends the program. (If you want to leave the database unchanged CTRL-Z Quit abandons the editing.)

15) The earlier seqout command, when on the consensus line, will have written a file ending in .CONSENSUS. Have a look at it now.

There are many commands available with GELASSEMBLE and it is well worth familiarising yourself with its full potential eg:

REJect removes the current fragment from the contig you are building. ERase removes the fragment or contig PERMANENTLY from the database. Unlock and NOANchor reverse the LOCk and ANChor commands. To position a contig (or fragment) on top of an existing one LOad, and you will be prompted for the fragment name.

8.2.6.	GELOVERLAP
You can re-run GELMERGE with a different set of parameters, such as a smaller word size or smaller overlap, to identify futher joins between existing contigs. The GELOVERLAP program identifies overlaps without changing the database, so you can try out the various parameters.

$ GELOVERLAP
 What word size (* 5 *) ?  6
 What fraction of the words in an overlap must match (* 0.80 *) ?  
 Integrate how many adjacent diagonals (* 3 *) ?  
 What is the minimum overlap length (* 10 *) ?  
 What should I call the output file (* GelOverlap.Dat *) ? 
   Reading ....
 Comparing ....

Type the file GELOVERLAP.DAT.

The prompt 'integrate how many adjacent diagonals' refers to the number of 'windows' used to calculate the final alignment. The 'ratio' figure is the number of bases involved in all the windows / total aligned length. The ratio can therefore be > 1 if there is more than one possible alignment!! GELVIEW/cluster interprets the geloverlap.dat file and displays the alignments. You have not yet made the alignments, you must do this manually with GELASSEMBLE, or using GELMERGE.
$GELVIEW/cluster
 What should I call the output file (* Museqs.view *)

Type the file Museqs.view.

8.2.7.	GELENTER as an editor
Run GELENTER again, without the /ENTER parameter. Then you will receive the prompt:
GELENTER of what sequence? VEC.DAT

By entering VEC.DAT, or any file one at a time, you get the chance to edit the sequence before entering it into the database. If you use the cursor keys to move along the sequence you will find a short region highlighted. The highlighted region has been identified by GELENTER as identical to the HindIII site.

Enter CTRL-Z, then quit to abandon the entry of this sequence. GELENTER is the GCG program SEQED customised to write the output to the gelassembly database.

8.2.8.	Redefining the project
There are two means of detecting for vector sequence: The "official" way is to provide the data to NEWGELSTART: 
$ NEWGELSTART/vec=vecbase:puc19
 What is the name of your fragment assembly project?  museqs
 NEWGELSTART has found your project: [................]
 Project MUSEQS has 12 fragments in 4 contigs. 
 You are ready to run the other fragment assembly programs.

8.2.9.	Detecting vector the unofficial way
Quite simply - enter the vector sequence(s) as part of the assembly project! eg:
 $ GELENTER/enter=VECBASE:PUC19

After entering any set of gels, run the GELOVERLAP program at a low sensitivity of match. (This has the advantage over GELMERGE of not actually creating the alignment). Any fragments containing vector sequence will attach themselves to the vector contig, which can easily be displayed using GELVIEW/CLUSTER. You can then use this information to ERAse fragments using GELASSEMBL.

Overcloned fragments can be copied from the database using seqout and screened out in any of the ways described for vector.

(NB: Unfortunately GELMERGE, introduced in release 7.2, does not like to have such a long sequence as PUC19 in the database. This unofficial screening is currently incompatible with using GELMERGE.).