コード例 #1
0
HC_Repertoire_Ptr CreateMutatedHCRepertoire(HC_InputParams params, HC_Repertoire_Ptr base_repertoire) {
    HC_Repertoire_Ptr mutated_repertoire(new HC_Repertoire());

    // mutated multiplicity creator
//    HC_ExponentialMultiplicityCreator mutated_multiplicity_creator(base_repertoire->NumberAntibodies(),
//        params.basic_repertoire_params.final_repertoire_size);
    HC_PowerLawMultiplicityCreator mutated_multiplicity_creator(base_repertoire->NumberAntibodies(),
                                                          params.basic_repertoire_params.final_repertoire_size);

    // shm creator
    HC_RgywWrcySHMStrategy shm_creation_strategy1(params.pattern_shm_params.min_number_pattern_shm,
                                                 params.pattern_shm_params.max_number_pattern_shm,
                                                 params.pattern_shm_params.substitution_propability);
    HC_CDRBasedRandomSHMStrategy shm_creation_strategy2(params.cdr_shm_params.min_number_mutations,
                                                        params.cdr_shm_params.max_number_mutations,
                                                        params.cdr_shm_params.mutation_in_fr_prop);
    HC_CompositeSHMCreationStrategy composite_shm_strategy(shm_creation_strategy1, shm_creation_strategy2);
    HC_SHMCreator shm_creator(composite_shm_strategy);

    for(auto it = base_repertoire->begin(); it != base_repertoire->end(); it++) {
        for(size_t i = 0; i < it->Multiplicity(); i++) {
            auto variable_region_ptr = it->IgVariableRegion()->Clone();
            variable_region_ptr = shm_creator.CreateSHM(variable_region_ptr);
            size_t multiplicity = mutated_multiplicity_creator.AssignMultiplicity(variable_region_ptr);
            mutated_repertoire->Add(HC_Cluster(variable_region_ptr, multiplicity));
        }
    }
    return mutated_repertoire;
}
コード例 #2
0
    void OutputSHMPositions(string output_fname) const {
        ofstream out(output_fname.c_str());
        for(auto it = begin(); it != end(); it++) {
            auto shm_settings = it->IgVariableRegion()->GetSHMSettings();
            size_t seq_length = it->Sequence().size();
            for(auto shm = shm_settings.begin(); shm != shm_settings.end(); shm++) {
                if(shm->first > seq_length)
                    continue;
                out << shm->first << "\t" << seq_length << endl;
            }

        }
    }
コード例 #3
0
void PrintBaseHCRepertoire(HC_Repertoire_Ptr base_repertoire) {
    for(auto it = base_repertoire->begin(); it != base_repertoire->end(); it++) {
        cout << it->IgVariableRegion()->VDJ_Recombination()->Sequence() << " " << it->Multiplicity() << endl;
        cout << it->IgVariableRegion()->GetCDRSettings();
    }
}
コード例 #4
0
void PrintMutatedHCRepertoire(HC_Repertoire_Ptr mutated_repertoire) {
    for(auto it = mutated_repertoire->begin(); it != mutated_repertoire->end(); it++) {
        cout << it->IgVariableRegion()->VDJ_Recombination()->Sequence() << " " << it->Multiplicity() << endl;
    }
}