ANARCI Python 2.7.13 - 引发child_exception // OSError:[Errno 2]

时间:2017-06-26 22:31:24

标签: python numpy biopython

我正在尝试验证ANARCI - 抗体编号工具 - 有效。它需要Python 2.6+(运行2.7.13),HMMER3和Biopython(Numpy除此之外)。我已成功设置了每个,当我运行ANARCI的一个示例脚本时,我得到上述错误。以下是来自Python shell的完整消息:

RESTART: /path/anarci_API_example.py 

Traceback (most recent call last):
    File "/Users/BioAtla-Intern/Downloads/anarci-1.1/Example_scripts_and_sequences/anarci_API_example.py", line 12, in <module>
        results = anarci(sequences, scheme="imgt", output=False)
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/anarci/anarci.py", line 554, in anarci
        alignments = run_hmmer( sequences, hmm_database=database, hmmerpath=hmmerpath, ncpu=ncpu, bit_score_threshold=bit_score_threshold )
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/anarci/anarci.py", line 382, in run_hmmer
        process = Popen( command, stdout=PIPE, stderr=PIPE  )
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 390, in __init__
        errread, errwrite)
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1024, in _execute_child
        raise child_exception
OSError: [Errno 2] No such file or directory

我无法找到此工具的任何帮助或之前的问题。对于那些对示例文件感兴趣的人,这里是:

# Import the anarci function.
from anarci import anarci

# Format the sequences that we want to number. 
sequences = [("12e8:H","EVQLQQSGAEVVRSGASVKLSCTASGFNIKDYYIHWVKQRPEKGLEWIGWIDPEIGDTEYVPKFQGKATMTADTSSNTAYLQLSSLTSEDTAVYYCNAGHDYDRGRFPYWGQGTLVTVSAAKTTPPSVYPLAP"),
          ("12e8:L","DIVMTQSQKFMSTSVGDRVSITCKASQNVGTAVAWYQQKPGQSPKLMIYSASNRYTGVPDRFTGSGSGTDFTLTISNMQSEDLADYFCQQYSSYPLTFGAGTKLELKRADAAPTVSIFPPSSEQLTSGGASV"),
          ("scfv:A","DIQMTQSPSSLSASVGDRVTITCRTSGNIHNYLTWYQQKPGKAPQLLIYNAKTLADGVPSRFSGSGSGTQFTLTISSLQPEDFANYYCQHFWSLPFTFGQGTKVEIKRTGGGGSGGGGSGGGGSGGGGSEVQLVESGGGLVQPGGSLRLSCAASGFDFSRYDMSWVRQAPGKRLEWVAYISSGGGSTYFPDTVKGRFTISRDNAKNTLYLQMNSLRAEDTAVYYCARQNKKLTWFDYWGQGTLVTVSSHHHHHH"),
          ("lysozyme:A","KVFGRCELAAAMKRHGLDNYRGYSLGNWVCAAKFESNFNTQATNRNTDGSTDYGILQINSRWWCNDGRTPGSRNLCNIPCSALLSSDITASVNCAKKIVSDGNGMNAWVAWRNRCKGTDVQAWIRGCRL")]

# Hand the list of sequences to the anarci function. Number them with the IMGT scheme
results = anarci(sequences, scheme="imgt", output=False)

# Unpack the results. We get three lists
numbering, alignment_details, hit_tables = results

# Each has the same number of elements as the number of sequences submitted
assert len(numbering) == len(alignment_details) == len(hit_tables) == len( sequences )

print 'I am using the anarci function to number and get all the details about the following sequences'
print sequences

print '\n'
# Iterate over the sequences
for i in xrange(len(sequences)):    
    if numbering[i] is None:
        print 'ANARCI did not number', sequences[i][0]
    else:
        print 'ANARCI numbered', sequences[i][0]
        print 'It identified %d domain(s)'%len(numbering[i])

        # Iterate over the domains
        for j in xrange(len(numbering[i])):
            domain_numbering, start_index, end_index = numbering[i][j]
            print 'This is the IMGT numbering for the %d\'th domain:'%j, domain_numbering
            print 'This is the bit of the sequence it corresponds to:', sequences[i][1][start_index:end_index+1]
            print 'These are the details of the alignment:'
         for (key,value) in alignment_details[i][j].iteritems():
              print key, ':', value
            print 'This is the summary of the hits that HMMER found'
         for line in hit_tables[i]:
              print line      
  print '\n','_'*40

print 'Do with this infomation as you wish'

print '\n','*'*40

# Want to just get a quick numbering without caring about the other details?
from anarci import number

seq = "EVQLQQSGAEVVRSGASVKLSCTASGFNIKDYYIHWVKQRPEKGLEWIGWIDPEIGDTEYVPKFQGKATMTADTSSNTAYLQLSSLTSEDTAVYYCNAGHDYDRGRFPYWGQGTLVTVSAAKTTPPSVYPLAP"
numbering, chain_type = number( seq, scheme = 'kabat' )
print 'Alternatively we can simply number the first domain of a sequence with the number function'
print 'I gave it this sequence\n', seq
print 'ANARCI told me it was a', chain_type, 'chain'
print 'This is the first domain\'s Kabat numbering:'
print numbering

任何帮助都表示赞赏,因为ANARCI似乎相当模糊。

1 个答案:

答案 0 :(得分:2)

阅读一些文档和错误日志,我发现在安装完所有内容后,最后一个参数是HMMER数据库的名称,在这种情况下,有一个名为“ALL”,所以如果你改变了来自:

results = anarci(sequences, scheme="imgt", output=False)

为:

results = anarci(sequences, "imgt", "ALL")

如果之后你还有问题,那是因为你没有正确安装HMMER。我像这样安装:

在终端中输入

命令:

wget http://eddylab.org/software/hmmer3/3.1b2/hmmer-3.1b2.tar.gz

tar -zxvf hmmer-3.1b2.tar.gz

cd hmmer-3.1b2

./configure && make && sudo make install

cd easel && make check && sudo make install

就是这样,对我而言,它正在发挥作用。

  

更新

如果您有权限问题,可以从此处下载源代码:http://hmmer.org/download.html,然后运行以下命令:

cd hmmer-3.1b2
./configure --prefix=$HOME/
make -j 4
make check
make install

我的脚本输出返回此列表:

[((1, ' '), 'E'), ((2, ' '), 'V'), ((3, ' '), 'Q'), ((4, ' '), 'L'),
((5, ' '), 'Q'), ((6, ' '), 'Q'), ((7, ' '), 'S'), ((8, ' '), 'G'),
((9, ' '), 'A'), ((10, ' '), 'E'), ((11, ' '), 'V'), ((12, ' '), 'V'),
((13, ' '), 'R'), ((14, ' '), 'S'), ((15, ' '), 'G'), ((16, ' '), 'A'),
((17, ' '), 'S'), ((18, ' '), 'V'), ((19, ' '), 'K'), ((20, ' '), 'L'),
((21, ' '), 'S'), ((22, ' '), 'C'), ((23, ' '), 'T'), ((24, ' '), 'A'),
((25, ' '), 'S'), ((26, ' '), 'G'), ((27, ' '), 'F'), ((28, ' '), 'N'),
((29, ' '), 'I'), ((30, ' '), 'K'), ((31, ' '), 'D'), ((32, ' '), 'Y'),
((33, ' '), 'Y'), ((34, ' '), 'I'), ((35, ' '), 'H'), ((36, ' '), 'W'),
((37, ' '), 'V'), ((38, ' '), 'K'), ((39, ' '), 'Q'), ((40, ' '), 'R'),
((41, ' '), 'P'), ((42, ' '), 'E'), ((43, ' '), 'K'), ((44, ' '), 'G'),
((45, ' '), 'L'), ((46, ' '), 'E'), ((47, ' '), 'W'), ((48, ' '), 'I'),
((49, ' '), 'G'), ((50, ' '), 'W'), ((51, ' '), 'I'), ((52, ' '), 'D'),
((52, 'A'), 'P'), ((53, ' '), 'E'), ((54, ' '), 'I'), ((55, ' '), 'G'),
((56, ' '), 'D'), ((57, ' '), 'T'), ((58, ' '), 'E'), ((59, ' '), 'Y'),
((60, ' '), 'V'), ((61, ' '), 'P'), ((62, ' '), 'K'), ((63, ' '), 'F'),
((64, ' '), 'Q'), ((65, ' '), 'G'), ((66, ' '), 'K'), ((67, ' '), 'A'), 
((68, ' '), 'T'), ((69, ' '), 'M'), ((70, ' '), 'T'), ((71, ' '), 'A'), 
((72, ' '), 'D'), ((73, ' '), 'T'), ((74, ' '), 'S'), ((75, ' '), 'S'), 
((76, ' '), 'N'), ((77, ' '), 'T'), ((78, ' '), 'A'), ((79, ' '), 'Y'), 
((80, ' '), 'L'), ((81, ' '), 'Q'), ((82, ' '), 'L'), ((82, 'A'), 'S'), 
((82, 'B'), 'S'), ((82, 'C'), 'L'), ((83, ' '), 'T'), ((84, ' '), 'S'), 
((85, ' '), 'E'), ((86, ' '), 'D'), ((87, ' '), 'T'), ((88, ' '), 'A'), 
((89, ' '), 'V'), ((90, ' '), 'Y'), ((91, ' '), 'Y'), ((92, ' '), 'C'), 
((93, ' '), 'N'), ((94, ' '), 'A'), ((95, ' '), 'G'), ((96, ' '), 'H'), 
((97, ' '), 'D'), ((98, ' '), 'Y'), ((99, ' '), 'D'), ((100, ' '), 'R'), 
((100, 'A'), 'G'), ((100, 'B'), 'R'), ((100, 'C'), 'F'), ((101, ' '), 'P'), 
((102, ' '), 'Y'), ((103, ' '), 'W'), ((104, ' '), 'G'), ((105, ' '), 'Q'), 
((106, ' '), 'G'), ((107, ' '), 'T'), ((108, ' '), 'L'), ((109, ' '), 'V'), 
((110, ' '), 'T'), ((111, ' '), 'V'), ((112, ' '), 'S'), ((113, ' '), 'A')]