-
Notifications
You must be signed in to change notification settings - Fork 12
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
Conversation
rd=n means that n+1 reads were used to construct the node.
graph/assemblygraphbuilder.cpp
Outdated
@@ -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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
graph/assemblygraphbuilder.cpp
Outdated
@@ -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; |
There was a problem hiding this comment.
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!
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. |
Linux fails are unrelated – looks like due to changes in GitHub Linux runner images |
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.