From 207a5e739794218635f9b5d0d4642b7447f2fcd8 Mon Sep 17 00:00:00 2001 From: Hasindu Gamaarachchi Date: Mon, 9 Sep 2024 19:48:41 +1000 Subject: [PATCH] revert some changes --- src/eventalign.c | 80 ++++++++++++++++++++++++------------------------ src/f5c.h | 2 +- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/eventalign.c b/src/eventalign.c index 9978cedb..7b59471a 100644 --- a/src/eventalign.c +++ b/src/eventalign.c @@ -1263,32 +1263,32 @@ struct EventAlignmentParameters }; -static inline int32_t *get_ref_to_read_map(AlignedSegment& aligned_pairs, int32_t *ref_seg_len_ptr){ - - int32_t ref_start = aligned_pairs.front().ref_pos; - int32_t ref_end = aligned_pairs.back().ref_pos; - int32_t ref_seg_len = ref_end - ref_start + 1; - *ref_seg_len_ptr = ref_seg_len; - assert(ref_start < ref_end); - assert(ref_seg_len > 0); - - int32_t *ref_to_read_map = (int32_t*)malloc(sizeof(int32_t)*ref_seg_len); - MALLOC_CHK(ref_to_read_map); - for(int32_t i=0; i 0); + +// int32_t *ref_to_read_map = (int32_t*)malloc(sizeof(int32_t)*ref_seg_len); +// MALLOC_CHK(ref_to_read_map); +// for(int32_t i=0; i align_read_to_ref(const EventAlignmentParameters& params, char *ref) { @@ -1346,8 +1346,8 @@ static inline int32_t *get_ref_to_read_map(AlignedSegment& aligned_pairs, int32_ AlignedSegment& aligned_pairs = aligned_segments[segment_idx]; - int32_t ref_seg_len = 0; - int32_t *ref_to_read_map = get_ref_to_read_map(aligned_pairs, &ref_seg_len); + //int32_t ref_seg_len = 0; + //int32_t *ref_to_read_map = get_ref_to_read_map(aligned_pairs, &ref_seg_len); if(params.region_start != -1 && params.region_end != -1) { //fprintf(stderr, "params.region_start = %d params.region_end = %d\n",params.region_start,params.region_end); @@ -1498,8 +1498,8 @@ static inline int32_t *get_ref_to_read_map(AlignedSegment& aligned_pairs, int32_ ea.ref_position = curr_start_ref + as.kmer_idx; std::string ref__kmer = ref_seq.substr(ea.ref_position - ref_offset, k); kmer_cpy(ea.ref_kmer, ref__kmer.c_str(),k); - assert(as.kmer_idx < ref_seg_len - params.kmer_size + 1); - ea.read_position = ref_to_read_map[as.kmer_idx]; + //assert(as.kmer_idx < ref_seg_len - params.kmer_size + 1); + //ea.read_position = ref_to_read_map[as.kmer_idx]; // event ea.read_idx = params.read_idx; @@ -1560,7 +1560,7 @@ static inline int32_t *get_ref_to_read_map(AlignedSegment& aligned_pairs, int32_ tester_i++; } // for realignmentsegment // fprintf(stderr, "tester_i = %d\n",tester_i); - free(ref_to_read_map); + //free(ref_to_read_map); } // for bam aligned segment // fprintf(stderr, "alignment_output len = %d\n",alignment_output.size()); // assert(alignment_output.size() == 4451); @@ -2098,18 +2098,18 @@ std::vector get_scaled_samples_for_event(const event_table* events,scalin // } -static inline void sprintf_read_kmer(kstring_t *sp, int32_t read_pos, char *read, int32_t read_len, uint32_t kmer_size){ +// static inline void sprintf_read_kmer(kstring_t *sp, int32_t read_pos, char *read, int32_t read_len, uint32_t kmer_size){ - if(read_pos == -1){ - sprintf_append(sp, "\t.\t."); - return; - } else { - char kmer[kmer_size+1]; - kmer_cpy(kmer, read+read_pos, kmer_size); - sprintf_append(sp, "\t%d\t%s", read_pos, kmer); - } +// if(read_pos == -1){ +// sprintf_append(sp, "\t.\t."); +// return; +// } else { +// char kmer[kmer_size+1]; +// kmer_cpy(kmer, read+read_pos, kmer_size); +// sprintf_append(sp, "\t%d\t%s", read_pos, kmer); +// } -} +// } char *emit_event_alignment_tsv(uint32_t strand_idx, const event_table* et, model_t* model, uint32_t kmer_size, scalings_t scalings, @@ -2245,7 +2245,7 @@ char *emit_event_alignment_tsv(uint32_t strand_idx, sample_str.resize(sample_str.size() - 1); sprintf_append(sp, "\t%s", sample_str.c_str()); } - sprintf_read_kmer(sp, ea.read_position, read, read_len, kmer_size); + //sprintf_read_kmer(sp, ea.read_position, read, read_len, kmer_size); sprintf_append(sp, "\n"); } diff --git a/src/f5c.h b/src/f5c.h index dca4bacd..c9b8a4a5 100644 --- a/src/f5c.h +++ b/src/f5c.h @@ -201,7 +201,7 @@ typedef struct { //int32_t strand_idx; int32_t event_idx; bool rc; - int32_t read_position; + //int32_t read_position; // hmm data char model_kmer[MAX_KMER_SIZE + 1];