Skip to content

Parsing issue #2

Description

@jeanrjc

Hello,

I encountered a typo in the doc and a bug in the parser that prevent cosi2 to run properly:

  1. The <label> is missing in the doc for selective sweep. One should read (I believe):
    pop_event sweep <label> <pop> <Tend> <selection coefficient> <position of causal allele (0.0-1.0)> <freq at Tend>
    Otherwise it outputs the following error:

    orig seed=239239
    got seed239239
    orig seed=4069885732
    got seed4069885732
    genMap::readFrom - caught UNKNOWN exception of type NSt8ios_base7failureB5cxx11E demangled std::ios_base::failure[abi:cxx11] ; exception is basic_ios::clear: iostream error
    cosi error: ./cosi/file.cc(342): Throw in function int cosi::ParamFileReader::file_get_data(FILE*, FILE*)
    Dynamic exception type: boost::exception_detail::clone_impl<cosi::cosi_param_file_error>
    std::exception::what: std::exception
    [cosi::errinfo_param_name_*] = pop_event
    [cosi::errinfo_param_details_*] = sweep 1 0 0.001 0.5 0.5
    0, "Success"[boost::errinfo_at_line_*] = 9
    [boost::errinfo_file_name_*] = params_bug
    
    
  2. the parameter file requires two newlines at the end of the file. The first example will work while the second won't:

    pop_define 1 my_pop
    pop_size 1 10000
    sample_size 1 50
    length 2000000
    
    mutation_rate 0.000000001
    recomb_file model.test
    
    pop_event sweep "sweep1" 1 0 0.001 0.5 0.5
    
    
    
    pop_define 1 my_pop
    pop_size 1 10000
    sample_size 1 50
    length 2000000
    
    mutation_rate 0.000000001
    recomb_file model.test
    
    pop_event sweep "sweep1" 1 0 0.001 0.5 0.5
    

    The latter produces the following error:

    orig seed=239239
    got seed239239
     sim 0 of 1
    orig seed=2451515636
    got seed2451515636
    genMap::readFrom - caught UNKNOWN exception of type NSt8ios_base7failureB5cxx11E demangled std::ios_base::failure[abi:cxx11] ; exception is basic_ios::clear: iostream error
    cosi error: ./cosi/file.cc(342): Throw in function int cosi::ParamFileReader::file_get_data(FILE*, FILE*)
    Dynamic exception type: boost::exception_detail::clone_impl<cosi::cosi_param_file_error>
    std::exception::what: std::exception
    [cosi::errinfo_param_name_*] = pop_event
    [cosi::errinfo_param_details_*] = sweep "sweep1" 1 0 0.001 0.5 0.5
    0, "Success"[boost::errinfo_at_line_*] = 9
    [boost::errinfo_file_name_*] = params_bug
    

Notice the similarity between the 2 error messages. The second error also occurs with other pop_event events.

I believe these are just a typo and a bug in the parser.

Best

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions