Skip to content

Commit ef55ff4

Browse files
committed
All changes commited. Error messages updated.
1 parent 6e0e276 commit ef55ff4

4 files changed

Lines changed: 13 additions & 12 deletions

File tree

src/alignment/nanopolish_alignment_db.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ void AlignmentDB::_clear_region()
618618

619619
//added by dorukb
620620
bool AlignmentDB::find_event_coords_for_region_for_record(const SequenceAlignmentRecordInfo& sequence_record,
621-
const int start_pos, const int stop_pos, int& event_begin_idx, int& event_end_idx)
621+
const int start_pos, const int stop_pos, int& event_begin_idx, int& event_end_idx, bool& event_mismatch)
622622
{
623623

624624
int r1 = 0, r2 = 0;
@@ -631,7 +631,7 @@ bool AlignmentDB::find_event_coords_for_region_for_record(const SequenceAlignmen
631631
}
632632

633633
std::vector<int> event_inds_for_bases;
634-
bool success = find_scrappie_events_for_basecall(sequence_record, event_inds_for_bases);
634+
bool success = find_scrappie_events_for_basecall(sequence_record, event_inds_for_bases, event_mismatch);
635635

636636
if (success)
637637
{
@@ -649,11 +649,11 @@ bool AlignmentDB::find_event_coords_for_region_for_record(const SequenceAlignmen
649649

650650
//added by dorukb
651651
bool AlignmentDB::find_event_coords_for_given_read_coords(const SequenceAlignmentRecordInfo& sequence_record,
652-
const int r1, const int r2, int& event_begin_idx, int& event_end_idx) const
652+
const int r1, const int r2, int& event_begin_idx, int& event_end_idx, bool& event_mismatch) const
653653
{
654654

655655
std::vector<int> event_inds_for_bases;
656-
bool success = find_scrappie_events_for_basecall(sequence_record, event_inds_for_bases);
656+
bool success = find_scrappie_events_for_basecall(sequence_record, event_inds_for_bases, event_mismatch);
657657

658658
if (success)
659659
{
@@ -672,9 +672,9 @@ bool AlignmentDB::find_event_coords_for_given_read_coords(const SequenceAlignmen
672672
}
673673

674674

675-
bool AlignmentDB::find_scrappie_events_for_basecall(const SequenceAlignmentRecordInfo& sequence_record, std::vector<int>& event_indices_for_bases) const
675+
bool AlignmentDB::find_scrappie_events_for_basecall(const SequenceAlignmentRecordInfo& sequence_record, std::vector<int>& event_indices_for_bases, bool& event_mismatch) const
676676
{
677-
677+
event_mismatch = false;
678678
SquiggleRead* sr;
679679
if (m_squiggle_read_map.find(sequence_record.read_name) != m_squiggle_read_map.end())
680680
{
@@ -687,7 +687,8 @@ bool AlignmentDB::find_scrappie_events_for_basecall(const SequenceAlignmentRecor
687687
std::abort();
688688
}
689689

690-
bool success = map_events_to_basecall(sr, event_indices_for_bases);
690+
691+
bool success = map_events_to_basecall(sr, event_indices_for_bases, event_mismatch);
691692
return success;
692693

693694
}

src/alignment/nanopolish_alignment_db.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ class AlignmentDB
128128

129129
//added by dorukb
130130
bool find_event_coords_for_region_for_record(const SequenceAlignmentRecordInfo& sequence_record,
131-
const int start_pos, const int stop_pos, int& event_begin_idx, int& event_end_idx);
131+
const int start_pos, const int stop_pos, int& event_begin_idx, int& event_end_idx, bool& event_mismatch);
132132

133133

134134

135135
//added by dorukb
136136
bool find_event_coords_for_given_read_coords(const SequenceAlignmentRecordInfo& sequence_record,
137-
const int r1, const int r2, int& event_begin_idx, int& event_end_idx) const;
137+
const int r1, const int r2, int& event_begin_idx, int& event_end_idx, bool& event_mismatch) const;
138138

139139

140140
std::vector<HMMInputData> get_events_aligned_to(const std::string& contig, int position) const;
@@ -187,7 +187,7 @@ class AlignmentDB
187187
const std::string& sequence_bam) const;
188188

189189

190-
bool find_scrappie_events_for_basecall(const SequenceAlignmentRecordInfo& sequence_record, std::vector<int>& event_indices_for_bases) const;
190+
bool find_scrappie_events_for_basecall(const SequenceAlignmentRecordInfo& sequence_record, std::vector<int>& event_indices_for_bases, bool& event_mismatch) const;
191191

192192

193193

src/main/nanopolish.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static std::map< std::string, std::function<int(int, char**)> > programs = {
3131
{"help", print_usage},
3232
{"--help", print_usage},
3333
{"--version", print_version},
34-
//{"index", index_main},
34+
{"index", index_main},
3535
//{"extract", extract_main},
3636
//{"eventalign", eventalign_main},
3737
//{"getmodel", getmodel_main},

0 commit comments

Comments
 (0)