程序报错 LoadError: InexactError: Int64(6115.5)应该怎么修改

请教各位大佬程序应该怎么修改,可以实现运行?

arg1 = String("F:/code_phylo_resampling/2021_08_p_h_0.965_MSA_f_uniq.dat")###msa fasta file
arg2 = String("F:/code_phylo_resampling/dist_mat_2021_08_p_h_0965_MSA_f_uniq.txt")## target distance matrix

using Null_models_I_and_II
using DelimitedFiles


num_samples=1
for i in 1:num_samples
result=sample_from_Null_model_II(arg1,target_dist=arg2,shuffle_temp=1.0)
DelimitedFiles.writedlm("msa_phylo_$(i).dat",result)
end

ERROR: LoadError: InexactError: Int64(6115.5)
Stacktrace:
[1] Int64
@ .\float.jl:723 [inlined]
[2] translate_fasta_to_num_matrix(msa_fasta::String)
@ Null_models_I_and_II C:\Users\DELL.julia\packages\Null_models_I_and_II\AROYE\src\utils.jl:45
[3] sample_from_Null_model_II(infile::String; outfile::String, target_dist::String, shuffle::Int64, shuffle_temp::Float64, T_factor_slow::Float64, T_factor_fast::Float64, min_temp::String, num_iter_max::Int64)
@ Null_models_I_and_II C:\Users\DELL.julia\packages\Null_models_I_and_II\AROYE\src\Null_models_I_and_II.jl:381
[4] top-level scope
@ F:\code_phylo_resampling\make_phyo_samples.jl:10
[5] include(fname::String)
@ Base.MainInclude .\client.jl:444
[6] top-level scope
@ REPL[2]:1
in expression starting at F:\code_phylo_resampling\make_phyo_samples.jl:9

不清楚 Null_models_I_and_II 这个包里是怎么写的,但是出错的地方可以参考:

很有可能是转换 *.5 的数字时出错。

julia> convert(Int, 1.5)
ERROR: InexactError: Int64(1.5)
Stacktrace:
 [1] Int64
   @ .\float.jl:812 [inlined]
 [2] convert(#unused#::Type{Int64}, x::Float64)
   @ Base .\number.jl:7
 [3] top-level scope
   @ REPL[1]:1

按照StackOverflow里的回答,可以考虑用floor()或者round()代替。

备案号:京ICP备17009874号-2