apollo.util
Class SeqFeatureUtil

java.lang.Object
  extended by apollo.util.SeqFeatureUtil

public class SeqFeatureUtil
extends java.lang.Object


Field Summary
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
SeqFeatureUtil()
           
 
Method Summary
static int binarySearch(java.util.Vector v, Comparator c, java.lang.Object o, boolean findSpace)
           
static boolean containsFeature(SeqFeatureI container, SeqFeatureI query)
          Returns true if container contains query (or is query)
static boolean equals(CurationSet a, CurationSet b)
           
static boolean equals(FeaturePairI a, FeaturePairI b)
           
static boolean equals(FeatureSetI a, FeatureSetI b)
           
static boolean equals(SeqFeatureI a, SeqFeatureI b)
           
static boolean equals(SequenceI a, SequenceI b)
           
static boolean equalsFeatures(SeqFeatureI a, SeqFeatureI b)
           
static AnnotatedFeatureI getAnnotRoot(AnnotatedFeatureI annot)
           
static FeatureList getFeatPropLeafFeatures(CurationSet cur, FeatureProperty prop)
          Get all leaf features for the FeatureProperty.
static FeatureList getFeatPropLeafParentFeats(CurationSet cur, FeatureProperty prop)
          return parent features of leaves (often these are transcript or transcript like feats) - the thin line that connects leaf feats/exons
static java.util.Vector getFeaturesOfClass(SeqFeatureI feature, java.lang.Class type, boolean traverseMatches)
           
static java.util.Vector getFeatureVector(CurationSet set)
           
static java.util.Vector getFeatureVector(FeatureSetI set)
           
static java.util.Vector getSortedKids(SeqFeatureI fs)
           
static FeatureList getTranscripts(CurationSet curSet)
          Returns a list of all transcripts in cur set - both strands
static java.lang.String guessResidueTypeFromFeatureLength(int seqLength, int featureLength)
          Calculates residue type by comparing seq length to feat length.
static boolean isAminoAcidAlignment(SeqFeatureI sf)
           
static boolean isAminoAcidAlignment(java.lang.String type)
           
protected static void populateFeaturesOfClass(java.util.Vector out, SeqFeatureI feature, java.lang.Class type, boolean traverseMatches)
           
static boolean scoreCompare(java.util.Hashtable scoresa, java.util.Hashtable scoresb)
           
static void sort(java.util.Vector features, int sortStrand)
           
static void sort(java.util.Vector features, int sortStrand, boolean byLow)
           
static java.util.Vector sortFeaturesAlphabetically(java.util.Vector features)
           
static boolean strcmp(java.lang.String a, java.lang.String b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger
Constructor Detail

SeqFeatureUtil

public SeqFeatureUtil()
Method Detail

getAnnotRoot

public static AnnotatedFeatureI getAnnotRoot(AnnotatedFeatureI annot)

containsFeature

public static boolean containsFeature(SeqFeatureI container,
                                      SeqFeatureI query)
Returns true if container contains query (or is query)


isAminoAcidAlignment

public static boolean isAminoAcidAlignment(java.lang.String type)

isAminoAcidAlignment

public static boolean isAminoAcidAlignment(SeqFeatureI sf)

guessResidueTypeFromFeatureLength

public static java.lang.String guessResidueTypeFromFeatureLength(int seqLength,
                                                                 int featureLength)
Calculates residue type by comparing seq length to feat length. If there is more than 2 base pairs per residue than its assigned AA. Otherwise sets it to DNA. It would be nice if the residue type came from the data itself, but barring that we do this little trick. Michele writes: Nasty hack to tell peptide from dna. Blergh.


getFeaturesOfClass

public static java.util.Vector getFeaturesOfClass(SeqFeatureI feature,
                                                  java.lang.Class type,
                                                  boolean traverseMatches)

populateFeaturesOfClass

protected static void populateFeaturesOfClass(java.util.Vector out,
                                              SeqFeatureI feature,
                                              java.lang.Class type,
                                              boolean traverseMatches)

getSortedKids

public static java.util.Vector getSortedKids(SeqFeatureI fs)

sort

public static void sort(java.util.Vector features,
                        int sortStrand)

sort

public static void sort(java.util.Vector features,
                        int sortStrand,
                        boolean byLow)

equals

public static boolean equals(CurationSet a,
                             CurationSet b)

equals

public static boolean equals(SeqFeatureI a,
                             SeqFeatureI b)

equals

public static boolean equals(FeaturePairI a,
                             FeaturePairI b)

equals

public static boolean equals(FeatureSetI a,
                             FeatureSetI b)

equalsFeatures

public static boolean equalsFeatures(SeqFeatureI a,
                                     SeqFeatureI b)

strcmp

public static boolean strcmp(java.lang.String a,
                             java.lang.String b)

equals

public static boolean equals(SequenceI a,
                             SequenceI b)

scoreCompare

public static boolean scoreCompare(java.util.Hashtable scoresa,
                                   java.util.Hashtable scoresb)

getFeatureVector

public static java.util.Vector getFeatureVector(CurationSet set)

getFeatureVector

public static java.util.Vector getFeatureVector(FeatureSetI set)

binarySearch

public static int binarySearch(java.util.Vector v,
                               Comparator c,
                               java.lang.Object o,
                               boolean findSpace)

sortFeaturesAlphabetically

public static java.util.Vector sortFeaturesAlphabetically(java.util.Vector features)

getFeatPropLeafFeatures

public static FeatureList getFeatPropLeafFeatures(CurationSet cur,
                                                  FeatureProperty prop)
Get all leaf features for the FeatureProperty. FeatureProperty is a visual/gui type. is gui stuff off limits in util? should there be a util for gui stuff? boolean for leaf features?


getFeatPropLeafParentFeats

public static FeatureList getFeatPropLeafParentFeats(CurationSet cur,
                                                     FeatureProperty prop)
return parent features of leaves (often these are transcript or transcript like feats) - the thin line that connects leaf feats/exons


getTranscripts

public static FeatureList getTranscripts(CurationSet curSet)
Returns a list of all transcripts in cur set - both strands