INNER CODE UNIT · Python
contamination
PKU-EMBL/BASALT · Bin_quality_evaluation.py:104
contamination=100*(float(bin_length[test_bin])-float(aligned_length[test_bin]))/float(bin_length[standard_bin])
CPN_CTN=float(aligned_ratio_standard_bin)-float(contamination)
CPN_CTN3=float(aligned_ratio_standard_bin)-3*float(contamination)
CPN_CTN5=float(aligned_ratio_standard_bin)-5*float(contamination)
# print(str(str(vs_bin)+'\t'+str(bin_length[standard_bin])+'\t'+str(bin_length[test_bin])))
f.write(str(standard_bin)+'\t'+str(test_bin)+'\t'+str(bin_length[standard_bin])+'\t'+str(bin_length[test_bin]))
f.write('\t'+str(aligned_length[standard_bin])+'\t'+str(aligned_length[test_bin])+'\t'+str(aligned_ratio_standard_bin)+'\t'+str(aligned_ratio_test_bin))
f.write('\t'+str(contamination)+'\t'+str(CPN_CTN)+'\t'+str(CPN_CTN3)+'\t'+str(CPN_CTN5)+'\n')
f.close()
os.system('rm '+blast_output)
def ORF_predict(contig_file, pwd, standard_bin_orfs_folder):
try:
print('Predicting ORFs of '+str(contig_file))
os.system('prodigal -i '+str(contig_file)+' -d '+str(contig_file)+'.orfs.fna -m -p meta -q')
os.system('mv '+str(contig_file)+'.orfs.fna '+pwd+'/'+standard_bin_orfs_folder)
except:
print('ORFs prediction error! Please make sure prodigal is installed in your system')