pal.alignment
Class StrippedAnnotatedAlignment

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

public class StrippedAnnotatedAlignment
extends StrippedAlignment
implements AnnotationAlignment

This is the stripped implementation of the Annotation interface, which is designed to provide stripped and annotated alignments. This annotation can include information on chromosomal location, site positions, locus name, and the type of position (exon, intron, etc.) This class also add some methods for stripping sites based on frequency, count, and a range of positions.

Version:
$Id: StrippedAnnotatedAlignment.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
protected  int firstSite
           
protected  int lastSite
           
protected  int minimumCount
           
protected  double minimumProportion
           
 
Fields inherited from class pal.alignment.StrippedAlignment
alias, notDropped
 
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
StrippedAnnotatedAlignment(AnnotationAlignment a)
          Simple constructor
 
Method Summary
 int getChromosome(int site)
          Returns chromosome
 float getChromosomePosition(int site)
          Return the position along chromosome
 DataType getDataType(int site)
          Returns the 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 removeConstantSitesIgnoreGapsMissing()
          remove constant sites but ignore gaps and missing data (- and ?)
 void removeSitesBasedOnFreqIgnoreGapsMissing(double minimumProportion, int minimumCount)
          remove sites based on minimum frequency (the count of good bases) and based on the proportion of good sites different from consensus
 void removeSitesOutsideRange(int firstSite, int lastSite)
          Remove sites based on site position (excluded sites are lastSite) This not effect any prior exclusions.
 void report(java.io.PrintWriter out)
          print human readable report (e.g., on parameters and associated model)
 
Methods inherited from class pal.alignment.StrippedAlignment
dropSite, getData, removeConstantSites, removeGaps, removeNoninformativeSites, removeSites, removeUnknowns
 
Methods inherited from class pal.alignment.AbstractAlignment
getAlignedSequenceString, 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

minimumProportion

protected double minimumProportion

minimumCount

protected int minimumCount

firstSite

protected int firstSite

lastSite

protected int lastSite
Constructor Detail

StrippedAnnotatedAlignment

public StrippedAnnotatedAlignment(AnnotationAlignment a)
Simple constructor

Method Detail

getChromosomePosition

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

Specified by:
getChromosomePosition in interface AnnotationAlignment

getChromosome

public int getChromosome(int site)
Returns chromosome

Specified by:
getChromosome in interface AnnotationAlignment

getWeightedLocusPosition

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

Specified by:
getWeightedLocusPosition in interface AnnotationAlignment

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

getLocusName

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

Specified by:
getLocusName in interface AnnotationAlignment

getDataType

public DataType getDataType(int site)
Returns the datatype

Specified by:
getDataType in interface AnnotationAlignment

removeSitesOutsideRange

public void removeSitesOutsideRange(int firstSite,
                                    int lastSite)
Remove sites based on site position (excluded sites are lastSite) This not effect any prior exclusions.

Parameters:
firstSite - first site to keep in the range
lastSite - last site to keep in the range

removeConstantSitesIgnoreGapsMissing

public void removeConstantSitesIgnoreGapsMissing()
remove constant sites but ignore gaps and missing data (- and ?)


removeSitesBasedOnFreqIgnoreGapsMissing

public void removeSitesBasedOnFreqIgnoreGapsMissing(double minimumProportion,
                                                    int minimumCount)
remove sites based on minimum frequency (the count of good bases) and based on the proportion of good sites different from consensus

Parameters:
minimumProportion - minimum proportion of sites different from the consensus
minimumCount - minimum number of sequences with a good bases (not - or ?)

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