Beispiel #1
0
 public override bool Equals(Object o)
 {
     if (o is Kmer <A> )
     {
         Kmer <A> otherKmer = (Kmer <A>)o;
         if (otherKmer.Count == this.Count)
         {
             return(this.Zip(otherKmer, (a, b) => a.Equals(b)).Conjunction());                       //TODO: Is this the right equality operator?  Nulls?
         }
     }
     return(false);
 }
Beispiel #2
0
 public double GetKeyFracLaplace(Kmer <Tyvar> val)
 {
     return(GetKeyFracLaplace(val, 1));
 }
Beispiel #3
0
 public double GetKeyFracLaplace(Kmer <Tyvar> val, double smoothingAmt)
 {
     return(((double)getCount(val) + smoothingAmt) / ((double)sizes[val.Count] + smoothingAmt));             //TODO is this laplacian smoothing?
 }
Beispiel #4
0
 public double GetKeyFrac(Kmer <Tyvar> v)
 {
     //Console.WriteLine ("f(" + v + ") = " + (double)getCount (v) + " / " + (double)sizes[v.Count]);
     return((double)getCount(v) / (double)sizes[v.Count]);
 }
Beispiel #5
0
 public int getCount(Kmer <Tyvar> item)
 {
     return(data[item.Count].getCount(item));
 }
Beispiel #6
0
 public void AddKmer(Kmer <Tyvar> toAdd, int count)
 {
     data[toAdd.Count].Add(toAdd, count);
     sizes[toAdd.Count] += count;
 }
Beispiel #7
0
 public void AddKmer(Kmer <Tyvar> toAdd)
 {
     data[toAdd.Count].Add(toAdd);
     sizes[toAdd.Count]++;
 }