本文整理汇总了C#中Chain.CreateChainString方法的典型用法代码示例。如果您正苦于以下问题:C# Chain.CreateChainString方法的具体用法?C# Chain.CreateChainString怎么用?C# Chain.CreateChainString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chain
的用法示例。
在下文中一共展示了Chain.CreateChainString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CuttMoleculeToSEQ
public Chain CuttMoleculeToSEQ(string seq,char selChain)
{
int start, end;
foreach(var item in chains)
{
if(item.ChainIdentifier==selChain)
{
StreamWriter er = new StreamWriter("query");
er.WriteLine(">test");
er.WriteLine(seq);
er.Close();
er = new StreamWriter("baza");
er.WriteLine(">baza");
er.WriteLine(item.chainSequence);
er.Close();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "C:\\Blast\\bin\\formatdb.exe";
startInfo.Arguments = "-i baza -p T";
startInfo.ErrorDialog = false;
startInfo.RedirectStandardOutput = true;
startInfo.UseShellExecute = false;
startInfo.CreateNoWindow = true;
try
{
Process exeProcess = Process.Start(startInfo);
exeProcess.WaitForExit();
startInfo.FileName = "C:\\Blast\\bin\\blastpgp";
startInfo.Arguments = "-i query -j 1 -d baza -o align";
exeProcess = Process.Start(startInfo);
exeProcess.WaitForExit();
}
catch(Exception ex)
{
Console.WriteLine("UPS");
return null;
}
using (StreamReader rr = new StreamReader("align"))
{
string line = "";
while (line != null && !line.Contains("Sbjct:"))
{
line = rr.ReadLine();
}
if (line == null)
return null;
line = line.Replace(" ", " ");
string[] tmp = line.Split(' ');
start = Convert.ToInt32(tmp[1]);
end = Convert.ToInt32(tmp[tmp.Length-1]);
while (line != null)
{
line = rr.ReadLine();
if (line.Contains("Score") || line.Contains("Database"))
break;
if (line.Contains("Sbjct:"))
{
line = line.Replace(" ", " ");
tmp = line.Split(' ');
end = Convert.ToInt32(tmp[tmp.Length - 1]);
}
}
}
if (end - start > item.chainSequence.Length)
return null;
Chain c = new Chain(selChain);
c.residues=item.CuttChain(start - 1, end - 1);
c.ChainIdentifier = selChain;
c.CreateChainString();
//Console.WriteLine("seq="+seq + "\nend=" +item.chainSequence);
return c;
}
}
return null;
}