[Biojava-l] Creating an alignment object

Mutlu Dogruel md5 at sanger.ac.uk
Thu May 11 14:51:08 UTC 2006


Hi Nathan,

You need something like this:

BufferedReader br = new BufferedReader(new FileReader("file.txt"));
FastaAlignmentFormat faf = new FastaAlignmentFormat();
Alignment aligned = faf.read( br );
br.close();

Cheers
M.

Nathan S. Haigh wrote:

>Sorry, I think I may have been unclear.
>
>For example I have an alignment file in FASTA format which looks like:
>
>  
>
>>seq1
>>    
>>
>ACGTTGCA
>  
>
>>seq2
>>    
>>
>ATGTTGCG
>  
>
>>seq3
>>    
>>
>AGGTTGCT
>  
>
>>seq4
>>    
>>
>AGGTTGCC
>
>
>How do I get this into an alignment object? Or, better still, can I create
>an alignment object without specifying an alignment file, but somehow
>creating the alignment by hand? Maybe create, a sequence object for each of
>the above sequences and add them to an alignment object?
>
>Something like that! :o)
>
>Nath
>
>  
>
>>-----Original Message-----
>>From: Richard Holland [mailto:richard.holland at ebi.ac.uk]
>>Sent: 11 May 2006 14:56
>>To: n.haigh at sheffield.ac.uk
>>Cc: biojava-l at lists.open-bio.org
>>Subject: Re: [Biojava-l] Creating an alignment object
>>
>>BioJava itself cannot align sequences. It can only create objects that
>>are representations of alignments generated by third-party software.
>>
>>However, there is a third-party addon to BioJava called Strap, which can
>>actually do the alignment work itself from within your Java program and
>>return a BioJava alignment object that represents the results. It is
>>available for download, along with an example of how to use it, from
>>here:
>>
>> http://www.charite.de/bioinf/strap/biojavaInAnger_SequenceAligner.html
>>
>>cheers,
>>Richard
>>
>>On Thu, 2006-05-11 at 14:27 +0100, Nathan S. Haigh wrote:
>>    
>>
>>>I'm new to Java and Biojava, but I've been having a play with writing
>>>      
>>>
>>and
>>    
>>
>>>interface and some classes for an app I'd like to write in Java.
>>>
>>>The part I'm playing around with at the moment deals with alignments and
>>>groups of alignment positions. What is the easiest/best way to create an
>>>alignment that I can then play around with and generate Locations from?
>>>      
>>>
>>A
>>    
>>
>>>self contained working example would be great because as I said, I'm
>>>      
>>>
>>really
>>    
>>
>>>new to java!
>>>
>>>Cheers
>>>Nath
>>>
>>>------------------------------------------------------------------------
>>>      
>>>
>>----
>>    
>>
>>>------
>>>Dr. Nathan S. Haigh
>>>Bioinformatics PostDoctoral Research Associate
>>>
>>>Room B2 211                                            Tel: +44 (0)114
>>>      
>>>
>>22
>>    
>>
>>>20112
>>>Department of Animal and Plant Sciences                Mob: +44 (0)7742
>>>      
>>>
>>533
>>    
>>
>>>569
>>>University of Sheffield                                Fax: +44 (0)114
>>>      
>>>
>>22
>>    
>>
>>>20002
>>>Western Bank                                           Web:
>>>www.bioinf.shef.ac.uk
>>>Sheffield
>>>www.petraea.shef.ac.uk
>>>S10 2TN
>>>------------------------------------------------------------------------
>>>      
>>>
>>----
>>    
>>
>>>------
>>>
>>>---
>>>avast! Antivirus: Outbound message clean.
>>>Virus Database (VPS): 0619-2, 11/05/2006
>>>Tested on: 11/05/2006 14:27:16
>>>avast! - copyright (c) 1988-2006 ALWIL Software.
>>>http://www.avast.com
>>>
>>>
>>>
>>>
>>>
>>>_______________________________________________
>>>Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
>>>http://lists.open-bio.org/mailman/listinfo/biojava-l
>>>
>>>      
>>>
>>--
>>Richard Holland (BioMart Team)
>>EMBL-EBI
>>Wellcome Trust Genome Campus
>>Hinxton
>>Cambridge CB10 1SD
>>UNITED KINGDOM
>>Tel: +44-(0)1223-494416
>>    
>>
>
>---
>avast! Antivirus: Outbound message clean.
>Virus Database (VPS): 0619-2, 11/05/2006
>Tested on: 11/05/2006 15:26:57
>avast! - copyright (c) 1988-2006 ALWIL Software.
>http://www.avast.com
>
>
>
>
>
>_______________________________________________
>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