本文整理汇总了C#中ISequence.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ISequence.ToString方法的具体用法?C# ISequence.ToString怎么用?C# ISequence.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISequence
的用法示例。
在下文中一共展示了ISequence.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Overlap
/// <summary>
/// Overlap constructor.
/// </summary>
/// <param name="name">Overlap name.</param>
/// <param name="overhang_5">Overhang sequence.</param>
/// <param name="geneSpecific_3">Gene specific sequence.</param>
public Overlap(String name, ISequence overhang_5, ISequence geneSpecific_3, TmThalSettings settings, int pairIndex = -1)
{
this.PairIndex = pairIndex;
this.Settings = settings;
this.Name = name;
this.TemplateSeq_3 = new Sequence(Alphabets.AmbiguousDNA, geneSpecific_3.ToString().ToUpper());
this.TemplateSeq_5 = new Sequence(Alphabets.AmbiguousDNA, overhang_5.ToString().ToLower());
this.Seq_3 = this.TemplateSeq_3;
this.Seq_5 = this.TemplateSeq_5;
this.Sequence = new Sequence(Alphabets.AmbiguousDNA, this.Seq_5.ToString() + this.Seq_3.ToString());
this.TempInit();
this.meltingTemperature = GetMeltingTemperature();
this.hairpinMeltingTemperature = GetHairpinTemperature();
this.homodimerMeltingTemperature = GetDuplexTemperature(this);
}
示例2: CreateItems
public static int CreateItems(UIParameters Up, ISequence rec, int itemId, int seqPos, Collection collection)
{
string queryName = rec.DisplayID.ToString().Split(' ')[0];
// BLAST reports are saved in individual files by query and
// numbered in the same order as they appear in the input FASTA file.
string blastFile = Up.ProjectDir + "\\xml\\" + seqPos + ".xml";
if (!File.Exists(blastFile))
{
throw new Exception("File does not exist.");
}
BlastXmlParser blastParser = new BlastXmlParser();
IList<BlastResult> blastResults = blastParser.Parse(blastFile);
GenBankParser gbParser = new GenBankParser();
int[] annotatedIndex = GetBestAnnotatedIndex(Up, seqPos);
// iterate through the BLAST results.
foreach (BlastResult blastResult in blastResults)
{
foreach (BlastSearchRecord record in blastResult.Records)
{
int hitsProcessed = 0;
// If there are not hits in the BLAST result ...
int rank = 0;
if (record.Hits.Count() > 0)
{
// For each hit
for (int i = 0; i < record.Hits.Count(); i++)
{
Hit blastHit = record.Hits[i];
// For each HSP
for (int j = 0; j < blastHit.Hsps.Count(); j++)
{
Hsp blastHsp = blastHit.Hsps[j];
double percentId = (blastHsp.IdentitiesCount / (double)blastHsp.AlignmentLength) * 100;
double queryCoverage = ((double)(blastHsp.QueryEnd - blastHsp.QueryStart + 1) / record.IterationQueryLength) * 100;
string txt = String.Format("{0} {1} {2} {3} {4} {5} {6} {7}", percentId, Up.BlastMinPercentIdentity,
Up.BlastMaxEvalue, blastHsp.EValue, queryCoverage, Up.BlastMinPercentQueryCoverage,
hitsProcessed, Up.BlastMaxNumHits);
// if HSP passes user-defined thresholds
if ((percentId >= Up.BlastMinPercentIdentity) &&
(Up.BlastMaxEvalue >= blastHsp.EValue) &&
(queryCoverage >= Up.BlastMinPercentQueryCoverage) &&
(hitsProcessed < Up.BlastMaxNumHits))
{
rank += 1;
string nextScore = "no";
if ((i + 1) < record.Hits.Count())
{
if (blastHsp.Score > record.Hits[i + 1].Hsps[0].Score)
{
nextScore = "less than";
}
else
{
nextScore = "equal";
}
}
else
{
nextScore = "non existent";
}
// parse GI numner from hit
long gi = Convert.ToInt64(blastHit.Id.Split('|')[1]);
GenBankItem gitem = new GenBankItem(gi, blastHsp.HitStart, blastHsp.HitEnd);
string gbFile = Up.ProjectDir + "\\gb\\" + gitem.Id.ToString();
gbFile += "_" + gitem.HitStart.ToString();
gbFile += "_" + gitem.HitEnd.ToString();
gbFile += ".gb";
// init item
string img = "#" + itemId.ToString();
Item item = new Item(itemId, img);
string[] headerTokens = parseFastaHeader(rec.DisplayID.ToString());
item.Name = headerTokens[0];
item.Description = headerTokens[1];
// write pairwise alignment
writePairwiseAlignment(Up, blastHit, j, itemId);
// try to parse the GB record associated with the hit and set facet values to data from BLAST/GB record
try
{
Console.WriteLine("GB OK: " + record.Hits[0].Id + " " + i.ToString() + " " + j.ToString());
ISequence gbRecord = gbParser.ParseOne(gbFile);
item.Href = GetNCBIUrl(Up.BlastProgram) + GetGenBankIdentifier(gbRecord);
GenBankMetadata gbMeta = (GenBankMetadata)gbRecord.Metadata["GenBank"];
CodingSequence bestCds = null;
IList<FeatureItem> features = gbMeta.Features.All;
FeatureItem bestItem = getBestFeatureItem(features);
if (gbMeta.Features.CodingSequences.Count > 0)
{
bestCds = gbMeta.Features.CodingSequences[0];
}
//.........这里部分代码省略.........