我從基因組FASTA文件創建序列的貨架文件:擱置字典大小是> 100Gb的一個2Gb的文本文件
# Import necessary libraries
import shelve
from Bio import SeqIO
# Create dictionary of genomic sequences
genome = {}
with open("Mus_musculus.GRCm38.dna.primary_assembly.fa") as handle:
for record in SeqIO.parse(handle, "fasta"):
genome[str(record.id)] = str(record.seq)
# Shelve genome sequences
myShelve = shelve.open("Mus_musculus.GRCm38.dna.primary_assembly.db")
myShelve.update(genome)
myShelve.close()
文件本身是2.6GB,但是當我嘗試擱置,一個> 100Gb的文件正在製作中,另外我的電腦會拋出一些關於內存不足和啓動磁盤已滿的抱怨。這似乎只發生在我嘗試在OSX Yosemite下運行時,在Ubuntu上它按預期工作。任何建議,爲什麼這是行不通的?我正在使用Python 3.4.2
你使用哪個python版本? – Daniel 2014-11-23 12:42:17
@Daniel Python 3.4.2 – jma1991 2014-11-23 12:43:26
可能與此相關? http://stackoverflow.com/questions/26574954/virtualenv-fails-on-os-x-yosemite-with-oserror – Ashalynd 2014-11-23 15:21:58