public List <Beneficiary> GetBeneficiariesList(int genomeID)
        {
            using (GenomeManagerData db = new GenomeManagerData())
            {
                var gdataList = db.genomedatas.Where(_ => _.genomeid == genomeID).ToList();
                var allben    = db.coding_ns_stem_bendef.ToList();

                var benList = (from b in allben
                               join g in gdataList on b.gdataid equals g.id
                               select b).ToList();

                var distinctBen     = benList.GroupBy(x => x.name).Select(x => x.FirstOrDefault());
                var beneficiaryList = new List <Beneficiary>();

                var count = 0;
                foreach (var ben in distinctBen)
                {
                    var beneficiary = new Beneficiary();
                    beneficiary.BeneficiaryID = count;
                    beneficiary.Name          = ben.name;
                    beneficiaryList.Add(beneficiary);
                    count++;
                }
                return(beneficiaryList);
            }
        }
Exemplo n.º 2
0
        private void ProcessCodingGroupItems(Effects effects)
        {
            using (GenomeManagerData db = new GenomeManagerData())
            {
                var codingItems = db.coding_groups_items.Where(_ => _.groupid == effects.CodingGroupID);

                foreach (var item in codingItems)
                {
                    switch (item.objkey)
                    {
                    case "program_bendef":
                        break;

                    case "program_outcome":
                        break;

                    case "program_characteristics":
                        break;

                    case "program_activities":
                        break;
                    }
                }
            }
        }
        public List <Characteristic> GetCharacteristicsList(int genomeID)
        {
            using (GenomeManagerData db = new GenomeManagerData())
            {
                var gdataList = db.genomedatas.Where(_ => _.genomeid == genomeID).ToList();

                var allChar = db.coding_program_characteristics.ToList();

                var charList = (from c in allChar
                                join g in gdataList on c.gdataid equals g.id
                                select c).ToList();

                var distinctChar       = charList.GroupBy(x => x.name).Select(x => x.FirstOrDefault());
                var charateristicsList = new List <Characteristic>();

                var count = 0;
                foreach (var c in distinctChar)
                {
                    var characteristic = new Characteristic();
                    characteristic.CharacteristicID = count;
                    characteristic.Name             = c.name;
                    charateristicsList.Add(characteristic);
                }

                return(charateristicsList);
            }
        }
Exemplo n.º 4
0
        public static void ProcessOutcomes(Effects effects)
        {
            var max = 0;

            using (GenomeManagerData db = new GenomeManagerData())
            {
                //var codingItems = db.coding_groups_items.Where(_ => _.groupid == effects.CodingGroupID && _.objkey == "program_outcome").FirstOrDefault();

                var codingItems = db.coding_groups_items.Where(_ => _.groupid == effects.CodingGroupID && _.objkey == "program_outcome").ToList();

                if (codingItems.Count() != 0)
                {
                    for (int i = 0; i < codingItems.Count(); ++i)
                    {
                        var objID   = codingItems[i].objkeyid;
                        var outcome = db.coding_ns_stem_outcomes.Where(_ => _.id == objID).FirstOrDefault();

                        foreach (var o in effects.Outcomes)
                        {
                            if (outcome.standardized_outcome == o.Name)
                            {
                                o.IsPresent = true;
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 5
0
 private genomedata GetDocumentInfo(long gDataID)
 {
     using (GenomeManagerData db = new GenomeManagerData())
     {
         var doc = db.genomedatas.Where(_ => _.id == gDataID).FirstOrDefault();
         return(doc);
     }
 }
Exemplo n.º 6
0
        public List <master_universalgene_types> GetGeneList(int genomeID)
        {
            using (GenomeManagerData db = new GenomeManagerData())
            {
                var uGenes = db.master_universalgene_types.Where(_ => _.genomeid == genomeID).ToList();

                return(uGenes);
            }
        }
        private static void GetActivities(long objKeyID)
        {
            using (GenomeManagerData db = new GenomeManagerData())
            {
                var activities = db.coding_program_activities.Where(_ => _.id == objKeyID).FirstOrDefault();

                var gene = db.coding_activities_ugs.Where(_ => _.pactid == activities.id).FirstOrDefault();
            }
        }
        private static void ProcessCodingGroups(long gDataID)
        {
            using (GenomeManagerData db = new GenomeManagerData())
            {
                var groups = db.coding_groups.Where(_ => _.gdataid == gDataID).Select(x => x.id);

                foreach (var groupID in groups)
                {
                    //ProcessCodingGroupItems(groupID);
                }
            }
        }
        public static void GetAllGenes(int genomeID)
        {
            using (GenomeManagerData db = new GenomeManagerData())
            {
                var genes = db.master_universalgene_types.Where(_ => _.genomeid == genomeID);

                foreach (var g in genes)
                {
                    Console.WriteLine(g.ugtname);
                }
            }
        }
Exemplo n.º 10
0
        public List <long> GetCodingGroupIDs(int genomeID)
        {
            using (GenomeManagerData db = new GenomeManagerData())
            {
                var codingGroups = from g in db.genomedatas
                                   join cg in db.coding_groups on g.id equals cg.gdataid
                                   where g.genomeid == genomeID
                                   select cg.id;

                return(codingGroups.ToList());
            }
        }
Exemplo n.º 11
0
 private List <Gene> BuildGeneList(int genomeID)
 {
     using (GenomeManagerData db = new GenomeManagerData())
     {
         var uGenelist = GetGeneList(genomeID);
         var genes     = new List <Gene>();
         foreach (var g in uGenelist)
         {
             var gene = new Gene();
             gene.GeneID   = g.id;
             gene.Name     = g.ugtname;
             gene.GenomeID = g.genomeid;
             genes.Add(gene);
         }
         return(genes);
     }
 }
        public static void GetGeneList(int genomeID)
        {
            using (GenomeManagerData db = new GenomeManagerData())
            {
                var distinctActivities = from cpa in db.coding_program_activities
                                         join cgi in db.coding_groups_items on cpa.id equals cgi.objkeyid
                                         join cg in db.coding_groups on cgi.groupid equals cg.id
                                         join g in db.genomedatas on cg.gdataid equals g.id
                                         where g.genomeid == genomeID
                                         select cpa;

                foreach (var a in distinctActivities)
                {
                    Console.WriteLine(a.name);
                }
            }
        }
Exemplo n.º 13
0
        public List <Effects> GetEffects(long cgID, int genomeID)
        {
            using (GenomeManagerData db = new GenomeManagerData())
            {
                var            groupEffects = db.coding_groups_items.Where(_ => _.groupid == cgID && _.objkey == "program_effects").ToList();
                List <Effects> effects      = new List <Effects>();

                foreach (var ge in groupEffects)
                {
                    var coding_Program_Effects = db.coding_program_effects.Where(_ => _.id == ge.objkeyid).FirstOrDefault();
                    if (coding_Program_Effects != null)
                    {
                        effects.Add(new Effects(coding_Program_Effects, cgID, genomeID));
                    }
                }
                return(effects);
            }
        }
        public List <Gene> GetGeneList(int genomeID)
        {
            using (GenomeManagerData db = new GenomeManagerData())
            {
                var uGenelist = db.master_universalgene_types.Where(_ => _.genomeid == genomeID).ToList();

                var genes = new List <Gene>();
                foreach (var g in uGenelist)
                {
                    var gene = new Gene();
                    gene.GeneID   = g.id;
                    gene.Name     = g.ugtname;
                    gene.GenomeID = g.genomeid;
                    genes.Add(gene);
                }
                return(genes);
            }
        }
Exemplo n.º 15
0
        //Processing blocks
        public static void ProcessActivityGenes(Effects effects)
        {
            using (GenomeManagerData db = new GenomeManagerData())
            {
                //var activities = db.coding_groups_items.Where(_ => _.gdataid == document.GDataID && _.objkey == "program_activities");

                var docGenes = db.coding_activities_ugs.Where(_ => _.gdataid == effects.GDataID);

                foreach (var g in docGenes)
                {
                    var gene = effects.Genes.Where(_ => _.GeneID == g.ugtid).FirstOrDefault();
                    if (gene != null)
                    {
                        gene.IsPresent = true;
                        //Console.WriteLine(gene.GeneID + " | " + gene.IsPresent);
                    }
                }
            }
        }
Exemplo n.º 16
0
        public List <DocumentInfo> GetDocuments(int genomeID)
        {
            using (GenomeManagerData db = new GenomeManagerData())
            {
                var docs = from g in db.genomedatas
                           join cg in db.coding_groups on g.id equals cg.gdataid
                           where g.genomeid == genomeID
                           select new DocumentCodingGroup
                {
                    GDataID       = g.id,
                    CodingGroupID = cg.id,
                    CreatedBy     = cg.createdby
                };

                var documents = new List <DocumentInfo>();
                foreach (var doc in docs)
                {
                    documents.Add(new DocumentInfo(doc));
                }
                return(documents);
            }
        }
        public List <Outcome> GetOutcomesList(int genomeID)
        {
            using (GenomeManagerData db = new GenomeManagerData())
            {
                var uOutcomesList = db.master_outcome_list.Where(_ => _.genomeid == genomeID).ToList();
                var outcomes      = new List <Outcome>();

                foreach (var item in uOutcomesList)
                {
                    //ignore dead outcomes
                    if (item.outcomeid != 51 && item.outcomeid != 52)
                    {
                        var outcome = new Outcome();
                        outcome.OutcomeID = item.outcomeid;
                        outcome.Name      = item.std_outcome_name;

                        outcomes.Add(outcome);
                    }
                }
                return(outcomes);
            }
        }