2013-08-18 58 views
0

我試圖檢索使用biopython中的浮雕比較兩個序列的比對分數。我知道的唯一方法是從浮雕產生的輸出文本文件中檢索它。問題是將會有數百個這樣的文件迭代。有沒有更容易/更清潔的方法來檢索比對分數,而不訴諸於?這是我正在使用的代碼的主要部分。檢索biopython中浮雕產生的序列比對分數

From Bio.Emboss.Applications import StretcherCommandline 
needle_cline = StretcherCommandline(asequence=,bsequence=,gapopen=,gapextend=,outfile=) 
stdout, stderr = needle_cline() 
+0

你對此發表任何進展? – user391339

回答

0

我有同樣的問題,經過一段時間花費在尋找一個整潔的解決方案,我突然出現了一面白旗。

然而,爲了加快輸出文件的顯著的處理,我做了以下幾件事:

1)我以前重新 Python模塊用於處理正則表達式來提取所需要的所有數據。

2)我爲輸出文件創建了ramdisk空間。這裏使用ramdisk允許處理和交換RAM內存中的所有數據(比從硬盤驅動器寫入和讀取輸出文件快得多,更不用說在處理大量路線時節省您的硬盤)。

0

我不知道是否有專門爲您的命令。對於​​,有Primer3。讓你的生活更喜歡的東西更容易:

from Bio.Emboss import Primer3 
inputFile = "./wherever/your/outputfileis.out" 
with open(inputFile) as fileHandle: 
    record = Primer3.parse(fileHandle) 
    # XXX check is len>0 
    primers = record.next().primers 
    numPrimers = len(primers) 
    # you should have access to each primer, using a for loop 
    # to check how to access the data you care about. For example: 

我還要檢查http://biopython.org/wiki/SeqIO#Sequence_Input