我在Ubuntu中運行一個依賴於正在安裝的軟件包的python腳本。這些都安裝,因爲我可以調用它們,但腳本不能。在Ubuntu中執行python腳本默認爲shell而不是bash
我想這是因爲該腳本使用shell(SH),而不是在bash version.i收到此錯誤信息進行:
sh: genomeCoverageBed: command not found
,但可以在猛砸手動調用genomeCoverageBed:
[email protected]:~/jonathan/scripty$ genomeCoverageBed
Tool: bedtools genomecov (aka genomeCoverageBed)
Version: v2.26.0
Summary: Compute the coverage of a feature file among a genome.
我的問題#1這部分是誤導和錯誤的!:
我加入這個家當的明星!我的python腳本的T:不過這並沒有影響結果
#/斌/慶典
,
考慮了這一點,我的劇本還是引起了同樣的錯誤消息 下面是部分腳本:
for filename in os.listdir(folder):
if filename.endswith(".sorted.bam"):
namefile = filename.replace(".sorted.bam", "_ncoverage.txt")
folder_name = filename.replace(".sorted.bam", "")
os.system("mkdir " + folder_name)
os.system("coverageBed -s -d -a bam " + folder + filename + " -b " + gff_file + " > " + folder_name + "/" + namefile)
這裏是當我運行此腳本會發生什麼:
[email protected]:~/jonathan/script$ sudo python2.7 script1.py ./Folder/ ./Folder/ref.fasta genbank.gff
sh: coverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
sh: coverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
sh: coverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
sh: coverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
sh: coverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
sh: coverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
sh: coverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
sh: coverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
sh: coverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
sh: genomeCoverageBed: command not found
對於我能做什麼,或者即使我走上正軌,你有什麼建議嗎? 感謝您的幫助!
恩,你把'#!/ bin/sh'放在python腳本的頂部?它運行一個子shell,而不是python。 – tdelaney
確切地說,你的腳本是用什麼語言編寫的,'python'或'bash'? – jojo
這個腳本是用python –