Ejemplo n.º 1
0
        // Aa変異をvcf形式で取得する
        public static (string vcfString, IEnumerable <VcfAnnotation> aaVariableList) GetAaVariation(IDictionary <string, string> fastaWithAnnotations, ref string message)
        {
            // var message = string.Empty;
            // vcf annotation strings, top3 consensus fasta....
            var resAaVcfList  = new List <string>();
            var aaChangesList = new List <VcfAnnotation>();

            foreach (var seqName2annotNuc in fastaWithAnnotations)
            {
                // mapping reference name. -> Genbank Sequence
                var referenceProperty = GetReferenceProperties(seqName2annotNuc.Key, ref message);
                if (referenceProperty == null)
                {
                    message += "error, ncbi genbank infomations is not found.";
                    resAaVcfList.Add(string.Empty);  //  Top1 取れなかった。エラーはmessageに格納
                    continue;
                }

                // amino properties
                var aaChangeVcf = new List <string>();
                foreach (var aminoProp in referenceProperty.aminoProps)
                {
                    var aaChanges = GetAmminoChanges(
                        aminoProp.AAseq,
                        seqName2annotNuc.Value,
                        aminoProp.SubLocations,
                        ref message);
                    if (!aaChanges.Any())
                    {
                        continue;   // 対象のgene/CDS で変異が無い。
                    }
                    aaChanges.ForEach(a => a.referenceName = aminoProp.Name);

                    // DB格納文字列
                    aaChangeVcf.Add(aminoProp.Name + "[" +
                                    string.Join(",", aaChanges.Select(s => s.GetVcfString)) +
                                    "[");
                    // aaChangeVcf.Add( aminoProp.Name + "[" + string.Join(",",  aaChanges.g + "]");

                    // すべてのAa変異をTablerで保存
                    aaChangesList.AddRange(aaChanges);
                }
                resAaVcfList.Add(string.Join(",", aaChangeVcf));  // top1 分。
            }

            // 表形式でファイルへ書き込み対象

            return(CommonFlow.DbDefaultTop3(resAaVcfList),
                   aaChangesList);
        }
Ejemplo n.º 2
0
 public Home(IWebDriver _driver) : base(_driver)
 {
     _homepageLocator = new HomePageLocators();
     _commonFlow      = new CommonFlow(_driver);
 }