예제 #1
0
        protected static void SendToStaticFKPM(PreSampleDefinition p, BioSample bios)
        {
            bios.HasExprs = true;
            if (LatestFKPMColIndexed == null)
            {
                LatestFKPMColIndexed = new Dictionary <string, BioSample[]> ();
            }

            foreach (string st in p.FileNames)
            {
                if (!LatestFKPMColIndexed.ContainsKey(st))
                {
                    LatestFKPMColIndexed.Add(st, new BioSample[p.TotalColumns]);
                }
                foreach (int ii in p.ColIDs)
                {
                    int index = ii - 9;

                    if (index != 0)
                    {
                        index /= 4;
                    }

                    LatestFKPMColIndexed [st] [index] = bios;
                }
            }
            hasFKPMSomethingToLoad = true;
        }
예제 #2
0
 public void MergeSamp(PreSampleDefinition other)
 {
     FileNames.AddRange(other.FileNames);
     FileNames.Add(other.singleFName);
     ColIDs.Add(other.singleColIndex);
     ColIDs.AddRange(other.ColIDs);
 }
예제 #3
0
        protected void OnFkpmLoad(object sender, EventArgs e)
        {
            if (MainData.FPKMFileNames.Count > 0)
            {
                List <PreSampleDefinition> prels = new List <PreSampleDefinition> ();

                foreach (string st in MainData.FPKMFileNames)
                {
                    List <string> cols = null;
                    FKPM.GetSampleNames(st, out cols);
                    int cnt = 0;
                    foreach (string ss in cols)
                    {
                        PreSampleDefinition pef = new PreSampleDefinition(SampleType.Expr);
                        pef.singleFName    = st;
                        pef.singleColID    = ss;
                        pef.singleColIndex = cnt + 9;
                        pef.IsGenotyped    = false;
                        pef.TotalColumns   = cols.Count;
                        prels.Add(pef);
                        cnt += 4;
                    }
                }

                SampleAllocationWindow swind = new SampleAllocationWindow(prels);

                swind.ShowAll();
            }
            else
            {
                MainData.ShowMessageWindow("You need to add some files to load first!", false);
            }
        }
예제 #4
0
 public PreSampleDefinition(PreSampleDefinition other, string _ID)
 {
     singleColIndex = other.singleColIndex;
     singleColID    = other.singleColID;
     FileNames      = other.FileNames;
     FileNames.Add(other.singleFName);
     ColIDs = other.ColIDs;
     ColIDs.Add(other.singleColIndex);
     IsGenotyped  = other.IsGenotyped;
     TotalColumns = other.TotalColumns;
     SType        = other.SType;
     TotalColumns = other.TotalColumns;
     ID           = _ID;
 }
예제 #5
0
 public void RecieveDefinition(PreSampleDefinition pres)
 {
     if (pres.SType == SampleType.BAM)
     {
         SendBAMs(pres.FileNames);
     }
     else if (pres.SType == SampleType.Expr)
     {
         SendToStaticFKPM(pres, this);
     }
     else if (pres.SType == SampleType.Vcf)
     {
         SendToStatic(pres, this);
     }
 }
예제 #6
0
        protected void OnVcfLoad(object sender, EventArgs e)
        {
            if (MainData.VariantFileNames.Count > 0)
            {
                List <PreSampleDefinition> prels = new List <PreSampleDefinition> ();

                foreach (string st in MainData.VariantFileNames)
                {
                    List <string> cols = null;

                    if (Variant.IsGenotyped(st, ref cols))
                    {
                        int cnt = 0;
                        foreach (string ss in cols)
                        {
                            PreSampleDefinition pef = new PreSampleDefinition(SampleType.Vcf);
                            pef.singleFName    = st;
                            pef.singleColID    = ss;
                            pef.singleColIndex = cnt + 9;
                            pef.IsGenotyped    = true;
                            pef.TotalColumns   = cols.Count;
                            prels.Add(pef);
                            cnt++;
                        }
                    }
                    else
                    {
                        PreSampleDefinition pef = new PreSampleDefinition(SampleType.Vcf);
                        pef.singleFName  = st;
                        pef.IsGenotyped  = false;
                        pef.TotalColumns = 0;
                        prels.Add(pef);
                    }
                }

                SampleAllocationWindow swind = new SampleAllocationWindow(prels);

                swind.ShowAll();
            }
            else
            {
                MainData.ShowMessageWindow("You need to add some files to load first!", false);
            }
        }
예제 #7
0
        protected void OnBamLoad(object sender, EventArgs e)
        {
            if (MainData.BAMFileNames.Count > 0)
            {
                List <PreSampleDefinition> prels = new List <PreSampleDefinition> ();

                foreach (string st in MainData.BAMFileNames)
                {
                    PreSampleDefinition pef = new PreSampleDefinition(SampleType.BAM);
                    pef.singleFName = st;
                    prels.Add(pef);
                }

                SampleAllocationWindow swind = new SampleAllocationWindow(prels);

                swind.ShowAll();
            }
            else
            {
                MainData.ShowMessageWindow("You need to add some files to load first!", false);
            }
        }
예제 #8
0
 protected static void SendToStatic(PreSampleDefinition p, BioSample bios)
 {
     bios.HasVars = true;
     if (LatestVarColIndexed == null)
     {
         LatestVarColIndexed = new Dictionary <string, BioSample[]> ();
     }
     if (IsGenotypedNames == null)
     {
         IsGenotypedNames = new Dictionary <string, bool> ();
     }
     if (p.IsGenotyped)
     {
         if (!LatestVarColIndexed.ContainsKey(p.FileNames [0]))
         {
             LatestVarColIndexed.Add(p.FileNames [0], new BioSample[p.TotalColumns]);
         }
         foreach (int ii in p.ColIDs)
         {
             LatestVarColIndexed [p.FileNames [0]] [ii - 9] = bios;
         }
         if (!IsGenotypedNames.ContainsKey(p.FileNames [0]))
         {
             IsGenotypedNames.Add(p.FileNames [0], p.IsGenotyped);
         }
     }
     else
     {
         foreach (string s in p.FileNames)
         {
             if (!IsGenotypedNames.ContainsKey(s))
             {
                 IsGenotypedNames.Add(s, p.IsGenotyped);
             }
         }
     }
     hasVarSomethingToLoad = true;
 }
예제 #9
0
 public EntryDefPair(Entry e, PreSampleDefinition p)
 {
     Ent  = e;
     Pres = p;
 }