Skip to content

Commit 86a1f8f

Browse files
committed
[FIX] ignore reference sequence on negative strand in maf file when created for annotation with mmseqs (sequences will already be in reverse complement and shortened depending on phase)
1 parent 25e2df7 commit 86a1f8f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/parallel_file_reader.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ class parallel_maf_reader
427427
// in practice aln.ids will already be set and only
428428
// if only \n is at the end of the range for a thread, don't process it
429429
// if "\na" isn at the end of the range for a thread, process it
430-
bool get_next_alignment(alignment_t & aln, const unsigned job_id, std::vector<bool> * species_seen_in_alignment = NULL)
430+
bool get_next_alignment(alignment_t & aln, const unsigned job_id, std::vector<bool> * species_seen_in_alignment = NULL, const bool single_block_scoring = false)
431431
{
432432
#pragma omp atomic
433433
total_bytes_processed += bytes_processing[job_id];
@@ -536,7 +536,7 @@ class parallel_maf_reader
536536

537537
// printf("First alignment block (chrom: %s, start: %lld, cum len: %lld)\n", aln.chrom.c_str(), aln.start_pos, prev_cumulative_len_wo_ref_gaps);
538538

539-
if (ref_strand != '+')
539+
if (ref_strand != '+' && !single_block_scoring)
540540
{
541541
printf(OUT_ERROR "Reference sequence is not on the + strand (%s.%s at position %" PRIu64 ")!\n" OUT_RESET, id, chrom, start_pos);
542542
exit(-1);
@@ -574,7 +574,7 @@ class parallel_maf_reader
574574
printf(OUT_ERROR "Encountered an alignment block that didn't start with the reference species: %s.%s at position %" PRIu64 "!\n" OUT_RESET, id, chrom, start_pos);
575575
exit(1);
576576
}
577-
if (ref_strand != '+')
577+
if (ref_strand != '+' && !single_block_scoring)
578578
{
579579
printf(OUT_ERROR "Reference sequence is not on the + strand (%s.%s at position %" PRIu64 ")!\n" OUT_RESET, id, chrom, start_pos);
580580
exit(-1);

src/phylocsf++score_msa.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void run_scoring_msa(const std::string & alignment_path, const Model & model, co
9999
alignment_t & aln = alignments[thread_id];
100100
std::vector<scoring_result> & results = all_results[job_id];
101101

102-
while (maf_rd.get_next_alignment(aln, job_id))
102+
while (maf_rd.get_next_alignment(aln, job_id, NULL, true))
103103
{
104104
maf_rd.print_progress();
105105

0 commit comments

Comments
 (0)