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

Inquiry on calculating avg_distance_to_effective_5p_end #111

Open
lykstudio opened this issue Nov 8, 2024 · 1 comment
Open

Inquiry on calculating avg_distance_to_effective_5p_end #111

lykstudio opened this issue Nov 8, 2024 · 1 comment
Assignees

Comments

@lykstudio
Copy link

I am interested in deriving the avg_distance_to_effective_5p_end value utilizing the data from the avg_distance_to_effective_3p_end column.

Is there any plan to provide the avg_distance_to_effective_5p_end metric in the future? If not, could you elucidate the methodology employed in calculating the avg_distance_to_effective_3p_end?

@apldx apldx self-assigned this Nov 12, 2024
@apldx
Copy link
Collaborator

apldx commented Nov 12, 2024

Hello, we don't have a plan for the 5p end (at some point we'd like to add some additional stats, but would probably need to add an option for legacy output etc; it's a good idea!), but I can describe the method for 3p:

First the sum of the proportions of the distances from the 3p end of the query position along the read is calculated and summed over all reads as

sum_3p_distance += (float) std::abs(base->qpos - three_prime_index) / (float) base->b->core.l_qseq;

(three_prime_index is taken from the BAM file via HTSLIB bam_aux_get(base->b, "Zm");)

and then an average is calculated as

stat.sum_3p_distance / stat.read_count;

The relevant lines are here

sum_3p_distance += (float) std::abs(base->qpos - three_prime_index) / (float) base->b->core.l_qseq;

and here
s << (float) stat.sum_3p_distance / stat.read_count;

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

No branches or pull requests

2 participants