package org.biojava.bio.structure.align;

import java.util.List;

import org.biojava.bio.structure.Atom;
import org.biojava.bio.structure.Calc;
import org.biojava.bio.structure.Group;
import org.biojava.bio.structure.StructureException;
import org.biojava.bio.structure.align.ce.ConfigStrucAligParams;
import org.biojava.bio.structure.align.model.AFPChain;
import org.biojava.bio.structure.jama.Matrix;

public abstract class AbstractStructureAlignment implements StructureAlignment {

	public static String newline = System.getProperty("line.separator");

	abstract public  AFPChain align(Atom[] ca1, Atom[] ca2) throws StructureException ;

	abstract public AFPChain align(Atom[] ca1, Atom[] ca2, Object params) throws StructureException;

	

	abstract public String getAlgorithmName() ;

	abstract public ConfigStrucAligParams getParameters() ;

	abstract public String getVersion() ;

	abstract public void setParameters(ConfigStrucAligParams parameters);

	public String printHelp() {
		StringBuffer buf = new StringBuffer();

		buf.append("-------------------" + newline);
		buf.append(getAlgorithmName() + " v." + getVersion() + " help: " + newline);
		buf.append("-------------------" + newline);
		buf.append(newline);
		buf.append(getAlgorithmName() + " accepts the following parameters:" + newline);
		buf.append(newline);
		buf.append("--- pairwise alignments ---");
		buf.append("-pdbFilePath (mandatory) Path to the directory in your file system that contains the PDB files." + newline);
		buf.append("-pdb1 (mandatory) PDB ID of target structure. Chain IDs are optional. In order to specify chain IDs write e.g: 5pti.A" + newline);
		buf.append("-pdb2 (mandatory) PDB ID of query structure. Chain IDs are optional. In order to specify chain IDs write e.g: 5pti.A" + newline);		
		buf.append("-h / -help / --help : print this help string." + newline);
		buf.append("-printXML true/false print the XML representation of the alignment on stdout." + newline);
		buf.append("-printFatCat true/false print the original FATCAT output to stdout." + newline);
		buf.append("-printCE true/false print the result in CE style" + newline);
		buf.append("-show3d print a 3D visualisation of the alignment (requires jmolapplet.jar in classpath)" + newline);
		buf.append("-outFile file to write the output to (writes XML representation)." + newline);
		buf.append("-autoFetch true/false if set to true PDB files will automatically get downloaded and stored in the right location. (default: false)" + newline);		
		buf.append("-pdbDirSplit true/false the directory containing PDB files has all PDBs in one level or is split into multiple subdirs, like the ftp site. (default: true)" + newline);
		buf.append("-showMenu displays the menu that allows to run alignments through a user interface.");
		buf.append("-maxGapSize (jCE specific): set the maximum gap size parameter G during AFP extension. default: 30. Set to 0 for unrestricted. ");
		buf.append(newline);
		buf.append("--- database searches ---");
		buf.append(newline);
		buf.append("-alignPairs (mandatory) path to a file that contains a set of pairs to compair");		
		buf.append("-outFile (mandatory) a file that will contain the summary of all the pairwise alignments");
		buf.append("-pdbFilePath (mandatory) Path to the directory in your file system that contains the PDB files." + newline);
		buf.append(newline);
		buf.append("  Once DB seaches are complete it is possible to view the results with:" +newline);
		buf.append(newline);
		buf.append("-viewDBresult (optional) path to a DB outFile to show. Also provide the -pdbFilePath parameter to enable visualisation of results." + newline);
		buf.append(newline);
		buf.append("For boolean arguments: if neither the text >true< or >false< is provided it is assumed to mean >true<. Instead of >-argument false< it is also possible to write -noArgument." + newline);		
		buf.append("--- How to specify what to align ---");
		buf.append(newline);
		buf.append(" If only a PDB code is provided, the whole structure will be used for the alignment." + newline);
		buf.append(" To specify a particular chain write as: 4hhb.A (chain IDs are case sensitive, PDB ids are not)"  + newline);
		buf.append(" To specify that the 1st chain in a structure should be used write: 4hhb:0 ." + newline);

		return buf.toString();


	}



}

@@ -39,32 +39,8 @@
 n;%0A%0A
-import java.util.List;%0A%0A
 impo
@@ -78,87 +78,8 @@
 om;%0A
-import org.biojava.bio.structure.Calc;%0Aimport org.biojava.bio.structure.Group;%0A
 impo
@@ -250,54 +250,8 @@
 ain;
-%0Aimport org.biojava.bio.structure.jama.Matrix;
 %0A%0Apu
@@ -590,11 +590,8 @@
 n;%0A%0A
-%09%0A%0A
 %09abs
@@ -1226,32 +1226,339 @@
 ;%0A%09%09buf.append(%22
+ two files to align can be specified by providing a path to a file, or a URL:%22 + newline);%0A%09%09buf.append(%22-file1 the first file to align%22 + newline);%0A%09%09buf.append(%22-file2 the second file to align%22+newline);%0A%09%09buf.append(%22alternatively you can specify PDB files by their PDB ids:%22 + newline);%09%09%0A%09%09buf.append(%22
 -pdbFilePath (ma
@@ -1550,35 +1550,24 @@
 pdbFilePath 
-(mandatory)
  Path to the
@@ -1659,27 +1659,16 @@
 (%22-pdb1 
-(mandatory)
  PDB ID 
@@ -1793,27 +1793,16 @@
 (%22-pdb2 
-(mandatory)
  PDB ID 
@@ -1897,32 +1897,33 @@
 i.A%22 + newline);
+%0A
 %09%09%0A%09%09buf.append(
@@ -2908,16 +2908,26 @@
 erface.%22
+ + newline
 );%0A%09%09buf
@@ -3063,16 +3063,153 @@
 icted. %22
+ + newline);%0A%09%09buf.append(%22-showAFPRanges (jCE specific): show the raw Aligned Fragment Pair positions, prior to optimization.%22 + newline
 );%0A%09%09buf
@@ -3385,16 +3385,26 @@
 compair%22
+ + newline
 );%09%09%0A%09%09b
@@ -3503,16 +3503,26 @@
 gnments%22
+ + newline
 );%0A%09%09buf

better help text