Skip to content

Commit

Permalink
Merge branch 'DOR-427_MN_tag' into 'master'
Browse files Browse the repository at this point in the history
Resolve DOR-427 "MN tag"

Closes DOR-427

See merge request machine-learning/dorado!724
  • Loading branch information
iiSeymour committed Nov 24, 2023
2 parents f0ac935 + 9ec47a7 commit 942a35a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions documentation/SAM.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
| pi:Z: | parent read id for a split read |
| sp:i: | start coordinate of split read in parent read signal |
| pt:i: | estimated poly(A/T) tail length in cDNA and dRNA reads |
| MN:i: | Length of sequence at the time MM and ML were produced |

#### Modified Base Tags

Expand Down
3 changes: 3 additions & 0 deletions dorado/read_pipeline/ReadPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ void ReadCommon::generate_modbase_tags(bam1_t *aln, uint8_t threshold) const {
}
}

int seq_len = int(seq.length());
bam_aux_append(aln, "MN", 'i', sizeof(seq_len), (uint8_t *)&seq_len);

bam_aux_append(aln, "MM", 'Z', int(modbase_string.length() + 1),
(uint8_t *)modbase_string.c_str());
bam_aux_update_array(aln, "ML", 'C', int(modbase_prob.size()), (uint8_t *)modbase_prob.data());
Expand Down
2 changes: 1 addition & 1 deletion tests/test_simple_basecaller_execution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if $dorado_bin basecaller ${model} $data_dir/pod5 -b ${batch} --emit-fastq --ref
echo "Error: dorado basecaller should fail with combination of emit-fastq and reference!"
exit 1
fi
if $dorado_bin basecaller ${model} $data_dir/pod5 -b ${batch} --emit-fastq --modified-bases 5mCG > $output_dir/error_condition.fq; then
if $dorado_bin basecaller ${model} $data_dir/pod5 -b ${batch} --emit-fastq --modified-bases 5mCG_5hmCG > $output_dir/error_condition.fq; then
echo "Error: dorado basecaller should fail with combination of emit-fastq and modbase!"
exit 1
fi
Expand Down

0 comments on commit 942a35a

Please sign in to comment.