pal.alignment
Class SimpleAnnotatedAlignment

java.lang.Object
  extended by pal.alignment.AbstractAlignment
      extended by pal.alignment.SimpleAlignment
          extended by pal.alignment.SimpleAnnotatedAlignment
All Implemented Interfaces:
java.io.Serializable, Alignment, AnnotationAlignment, IdGroup, Report

public class SimpleAnnotatedAlignment
extends SimpleAlignment
implements AnnotationAlignment

This is the basic implementation of the Annotation interface, which is designed to provide annotation for an alignment. This annotation can include information on chromosomal location, site positions, locus name, and the type of position (exon, intron, etc.) This class is designed for alignments with a single locus but multiple sites within the locus. This class does not permit multiple datatypes per alignment.

Version:
$Id: SimpleAnnotatedAlignment.java,v 1
Author:
Ed Buckler
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface pal.misc.IdGroup
IdGroup.Utils
 
Field Summary
 int chromosome
          used to designate chromosome
 float chromosomePosition
          used to designate position along chromosome
 java.lang.String locusName
          used to designate locus name
 char[] positionType
          used to designate position Type
 float[] weightedPosition
          used to designate weighted position; accounts for gaps
 
Fields inherited from class pal.alignment.AbstractAlignment
idGroup, numSeqs, numSites
 
Fields inherited from interface pal.alignment.Alignment
GAP, GAP_TLA, GAPS, UNKNOWN, UNKNOWN_TLA
 
Constructor Summary
SimpleAnnotatedAlignment(Alignment a)
          Clone constructor from an unannotated alignment.
SimpleAnnotatedAlignment(AnnotationAlignment a)
          Clone constructor.
SimpleAnnotatedAlignment(AnnotationAlignment a, IdGroup newGroup)
          This constructor will subset the alignment based on the taxa in IdGroup
SimpleAnnotatedAlignment(Identifier[] ids, java.lang.String[] sequences, java.lang.String gaps, DataType dt)
          This constructor creates a basic SimpleAnnotatedAlignment.
SimpleAnnotatedAlignment(IdGroup group, java.lang.String[] sequences, DataType dt)
          This constructor creates a basic SimpleAnnotatedAlignment.
SimpleAnnotatedAlignment(IdGroup group, java.lang.String[] sequences, java.lang.String gaps, DataType dt)
          This constructor creates a basic SimpleAnnotatedAlignment.
 
Method Summary
 int getChromosome(int site)
          Returns chromosome
 float getChromosomePosition(int site)
          Return the position along chromosome
 DataType getDataType(int site)
          Returns the datatype (for SimpleAnnotatedAlignment there is only one datatype)
 java.lang.String getLocusName(int site)
          Returns the name of the locus
 int getLocusPosition(int site)
          Return the position along the locus (ignores gaps)
 char getPositionType(int site)
          Returns position type (eg.
 float getWeightedLocusPosition(int site)
          Return the weighted position along the gene (handles gaps)
 void report(java.io.PrintWriter out)
          print human readable report (e.g., on parameters and associated model)
 void setChromosome(int chromosome)
          Sets chromosome
 void setChromosomePosition(float position)
          Set the position along chromosome
 void setLocusName(java.lang.String locusName)
          Sets the name of the locus
 void setPositionType(int site, char posType)
          Set thes position type (eg.
 void setWeightedLocusPosition(int site, float weightedPos)
          Sets the weighted position along the gene (handles gaps)
 
Methods inherited from class pal.alignment.SimpleAlignment
getAlignedSequenceString, getData
 
Methods inherited from class pal.alignment.AbstractAlignment
getChar, getDataType, getIdCount, getIdentifier, getLength, getSequenceCount, getSiteCount, getState, getStates, guessDataType, isGap, isUnknownState, setDataType, setIdentifier, toString, whichIdNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface pal.alignment.Alignment
getAlignedSequenceString, getData, getDataType, getSequenceCount, getSiteCount
 
Methods inherited from interface pal.misc.IdGroup
getIdCount, getIdentifier, setIdentifier, whichIdNumber
 

Field Detail

chromosomePosition

public float chromosomePosition
used to designate position along chromosome


chromosome

public int chromosome
used to designate chromosome


weightedPosition

public float[] weightedPosition
used to designate weighted position; accounts for gaps


positionType

public char[] positionType
used to designate position Type


locusName

public java.lang.String locusName
used to designate locus name

Constructor Detail

SimpleAnnotatedAlignment

public SimpleAnnotatedAlignment(Alignment a)
Clone constructor from an unannotated alignment. All annotation is set to defaults


SimpleAnnotatedAlignment

public SimpleAnnotatedAlignment(AnnotationAlignment a)
Clone constructor.


SimpleAnnotatedAlignment

public SimpleAnnotatedAlignment(AnnotationAlignment a,
                                IdGroup newGroup)
This constructor will subset the alignment based on the taxa in IdGroup


SimpleAnnotatedAlignment

public SimpleAnnotatedAlignment(Identifier[] ids,
                                java.lang.String[] sequences,
                                java.lang.String gaps,
                                DataType dt)
This constructor creates a basic SimpleAnnotatedAlignment. The annotation should be added with the set commands.


SimpleAnnotatedAlignment

public SimpleAnnotatedAlignment(IdGroup group,
                                java.lang.String[] sequences,
                                DataType dt)
This constructor creates a basic SimpleAnnotatedAlignment. The annotation should be added with the set commands.


SimpleAnnotatedAlignment

public SimpleAnnotatedAlignment(IdGroup group,
                                java.lang.String[] sequences,
                                java.lang.String gaps,
                                DataType dt)
This constructor creates a basic SimpleAnnotatedAlignment. The annotation should be added with the set commands.

Method Detail

getChromosomePosition

public float getChromosomePosition(int site)
Return the position along chromosome

Specified by:
getChromosomePosition in interface AnnotationAlignment

setChromosomePosition

public void setChromosomePosition(float position)
Set the position along chromosome


getChromosome

public int getChromosome(int site)
Returns chromosome

Specified by:
getChromosome in interface AnnotationAlignment

setChromosome

public void setChromosome(int chromosome)
Sets chromosome


getWeightedLocusPosition

public float getWeightedLocusPosition(int site)
Return the weighted position along the gene (handles gaps)

Specified by:
getWeightedLocusPosition in interface AnnotationAlignment

setWeightedLocusPosition

public void setWeightedLocusPosition(int site,
                                     float weightedPos)
Sets the weighted position along the gene (handles gaps)


getLocusPosition

public int getLocusPosition(int site)
Return the position along the locus (ignores gaps)

Specified by:
getLocusPosition in interface AnnotationAlignment

getPositionType

public char getPositionType(int site)
Returns position type (eg. I=intron, E-exon, P=promoter, 1=first, 2=second, 3=third, etc.

Specified by:
getPositionType in interface AnnotationAlignment

setPositionType

public void setPositionType(int site,
                            char posType)
Set thes position type (eg. I=intron, E-exon, P=promoter, 1=first, 2=second, 3=third, etc.


getLocusName

public java.lang.String getLocusName(int site)
Returns the name of the locus

Specified by:
getLocusName in interface AnnotationAlignment

setLocusName

public void setLocusName(java.lang.String locusName)
Sets the name of the locus


getDataType

public DataType getDataType(int site)
Returns the datatype (for SimpleAnnotatedAlignment there is only one datatype)

Specified by:
getDataType in interface AnnotationAlignment

report

public void report(java.io.PrintWriter out)
Description copied from interface: Report
print human readable report (e.g., on parameters and associated model)

Specified by:
report in interface AnnotationAlignment
Specified by:
report in interface Report
Overrides:
report in class AbstractAlignment
Parameters:
out - output stream