Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rd depth tag from hifiasm #171

Merged
merged 2 commits into from
Jan 22, 2025
Merged

Add rd depth tag from hifiasm #171

merged 2 commits into from
Jan 22, 2025

Conversation

milenovic
Copy link

rd:i:n means that n+1 reads were used to construct the node. I decided to show the raw rd value instead of adding 1 to it.

rd=n means that n+1 reads were used to construct the node.
@milenovic milenovic changed the title Add _rd_ depth tag from hifiasm Add rd depth tag from hifiasm Jan 22, 2025
@asl asl self-requested a review January 22, 2025 21:25
@@ -422,6 +423,9 @@ namespace io {
} else if (auto kaTag = gfa::getTag<float>("ka", record.tags)) {
graph.m_depthTag = "ka";
nodeDepth = *kaTag;
} else if (auto rdTag = gfa::getTag<int64_t>("rd", record.tags)) {
graph.m_depthTag = "rd";
nodeDepth = *rdTag;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this is a correct approach. Let's say you had 10 reads, then it will be shown as 10x depth here. In the same time for a longer node containing 1000 reads it will be shown as 1000x which is not quite correct.

This will confuse e.g. coloring using node depths, etc. I think you'd need to handle rd pretty much similar to a standard GFA RC tag (which is read count). This way we will have proper read depth value.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aplogies, I did misunderstand the tag. Just got a reply from hifiasm developer.
Which says that rd:i:n is indeed coverage, not the number of reads.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, if this is really a coverage depth, why it is an integer value?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just rounds down a integer number.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok. Thanks for the clarification!

hifiasm shows coverage as in rd:i:n tag where coverage is n+1.
@@ -422,6 +423,9 @@ namespace io {
} else if (auto kaTag = gfa::getTag<float>("ka", record.tags)) {
graph.m_depthTag = "ka";
nodeDepth = *kaTag;
} else if (auto rdTag = gfa::getTag<int64_t>("rd", record.tags)) {
graph.m_depthTag = "rd";
nodeDepth = *rdTag;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok. Thanks for the clarification!

@milenovic
Copy link
Author

I just made another change to add/subtract 1 when reading/saving GFA, as showing depth of 0x would be very confusing to the user.

@asl
Copy link
Owner

asl commented Jan 22, 2025

Linux fails are unrelated – looks like due to changes in GitHub Linux runner images

@asl asl merged commit 051621a into asl:dev Jan 22, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants