[Biojava-l] RES: MultiAlignClustalW tutorial example

Dickson S. Guedes guedes at unisul.br
Wed Jul 26 19:37:06 UTC 2006


Hi Daniel,


The algorithm for MultAlignTest is:

- Instantiate a ClustalWAlign class with some name;
- Add the sequences to be aligned to this class;
- Call the "doMultAlign()" method who make multi-align;

To see the results, you may get a Iterator with the aligned sequences like
this session code:

<code>

SequenceIterator it = alSequences.getIterator();
		
while (it.hasNext()) {
	Sequence seq = it.nextSequence();
	System.out.println(seq.getName() + ": " + seq.seqString());
}
			
System.out.print("GUIDE TREE:" + alSequences.getGuideTree());
</code>

You sad "cannot get any output from this external process.". 

Well, In ClustalWAlign.java there are a session code:

<code>

Process proc = rt.exec(strComando);
			
InputStream stdin = proc.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(stdin));
			
while ( (br.readLine()) != null) {
	// do nothing only read "stdout" from ClustalW
      // you can put a System.out.print here to prints
      // the output from ClustalW to console.
}
			
exitVal = proc.waitFor();
</code>

The loop while hide the output of process but files will be created at path
in the "clustalwPath" constant.

The String "strComando" is an array with the arguments to run ClustalW by
command-line, and contains the follow structure:

<code>
String [] strComando =  
	
{

clustalwPath+"ClustalW.EXE",

"/infile="  + clustalwPath + fileName + ".input",

"/outfile=" + clustalwPath + fileName + ".output",

"/output=" + fileFormat,

"/align"

};
</code>

The First Element is: clustalwPath+"ClustalW.EXE"

clustalwPath is a constant point to Clustal Executable directory and
"ClustalW.EXE" is a String with the name of executable, this value must be
changed in other platforms, sorry but I've used this code in Windows. :(

Well, another change that must be made is at the end of array if you need
more than default multi-alignment (in Windows I can see a list of arguments
by type at command line "ClustalW /help"):

<code>
...

"/align"

};
</code>

You can add more command-line arguments to something like this:

<code>
...

"/align",

"/tossgaps",

"/another_clustal_argument1",

"/another_clustal_argument2"

.
.
.

};
</code>

Yes, the class ClustalWAlign.java need little changes to be portable, and I
will make it, or apologize who can do. ;)

Have you any other questions about? If yes, send me a e-mail and I'll try to
help you.

Thanks,
Dickson S. Guedes <guedes at unisul.br>
-
ATI - Assessoria de Tecnologia da Informação
UNISUL - Universidade do Sul de Santa Catarina
+55 (0xx48) 3621-3200 - http://www.unisul.br

-----Mensagem original-----
De: biojava-l-bounces at lists.open-bio.org
[mailto:biojava-l-bounces at lists.open-bio.org] Em nome de Bornman, Daniel M
Enviada em: quarta-feira, 26 de julho de 2006 14:27
Para: biojava-l at lists.open-bio.org
Assunto: [Biojava-l] MultiAlignClustalW tutorial example

All,

I am currently trying to work through the MultiAlignClustalW example on
the wiki but I am having some problems getting output.
After changing the necessary variable to work on my Linux machine and
choosing to use the ClustalWAlign(BufferedReader,String) construtor from
my test class, I cannot get any output from this external process.

I am using the latest version of ClustalW and I have noticed that when
running it from the command line directly, I am prompted for many
inputs.  Does the java example take these into account?

It seems like it attempts to in this section of code:

String [] strComando =  
	
{clustalwPath+"ClustalW.EXE",
	
"/infile="  + clustalwPath + fileName + ".input",
	
"/outfile=" + clustalwPath + fileName + ".output",
	
"/output=" + fileFormat,
	
"/align"};

...but I don't quite understand what all elements of this array are
intending to do or how if fits into the series of prompts when running
clustalw from the command line?


Thank You for any insight,  

Daniel Bornman
Researcher
Battelle Memorial Institute
505 King Ave
Columbus, OH 43201
614.424.3229

_______________________________________________
Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biojava-l





More information about the Biojava-l mailing list