static public KmerProperties GetInstance() { if (Singleton == null) { Singleton = new KmerProperties(); Singleton.Init(); } return(Singleton); }
public static Set <char> PropertyNameToAASet(string propertyName) { KmerProperties kmerProperties = KmerProperties.GetInstance(); int propertyNum = kmerProperties.PropertyToNumber[propertyName]; Set <char> aaSet = Set <char> .GetInstance(); foreach (KeyValuePair <string, bool[]> aaAndBits in kmerProperties.AABits) { if (aaAndBits.Value[propertyNum]) { char aa = Biology.GetInstance().ThreeLetterAminoAcidAbbrevTo1Letter[aaAndBits.Key]; aaSet.AddNew(aa); } } return(aaSet); }
public static Dictionary <string, List <string> > CreateAAToPropList() { Dictionary <string, List <string> > aaToPropList = new Dictionary <string, List <string> >(); foreach (string aa in Biology.GetInstance().AminoAcidCollection.Keys) { if (aa == "STOP" || aa == "DELETE") { continue; } bool[] rgsBit = KmerProperties.GetInstance().AABits[aa]; List <string> probList = new List <string>(); for (int iProperty = 0; iProperty < rgsBit.Length; ++iProperty) { if (rgsBit[iProperty]) { string property = KmerProperties.GetInstance().AAPropertyCollection[iProperty]; probList.Add(property); } } aaToPropList.Add(aa, probList); } return(aaToPropList); }