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

Modification summary per BED line #154

Open
davidsilvapires opened this issue Apr 5, 2024 · 2 comments
Open

Modification summary per BED line #154

davidsilvapires opened this issue Apr 5, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@davidsilvapires
Copy link

Hi everybody.

We have a bed file with about 1000 features (one per line) that we are interested in obtaining the number of modified bases per feature (normalized to coverage, preferentially).

Is there any modkit sub-command similar to "summary" to get this kind of result?

Thanks in advance for any help.

--
David

@ArtRand
Copy link
Contributor

ArtRand commented Apr 5, 2024

Hello @davidsilvapires,

There isn't a command exactly like that. Although I've gotten a similar request before - so maybe it's time to add one.

@ArtRand ArtRand added the enhancement New feature or request label Apr 5, 2024
@davidsilvapires
Copy link
Author

davidsilvapires commented Apr 10, 2024

Thank you for the answer @ArtRand.

While the subcommand is not implemented, I am using the <() Bash syntax to make use of modkit summary running one BED line each time. Maybe it can be useful to other users:

IFS='
'

for LINE in `cat features.bed`
do
     echo
     echo "${LINE}"
     modkit summary --include-bed <(echo ${LINE}) sample.modBam
done

Here are two output examples:

PRFA01000001    1129695 1129767 C4B63_1nc1      tRNA    -
# bases             C
# total_reads_used  17
# count_reads_C     17
# pass_threshold_C  0.6507813
 base  code  pass_count  pass_frac   all_count  all_frac
 C     -     91          0.9009901   95         0.84070796
 C     m     4           0.03960396  6          0.053097345
 C     h     6           0.05940594  12         0.10619469

PRFA01000005    770166  770238  C4B63_5nc4      tRNA    -
# bases             C
# total_reads_used  12
# count_reads_C     12
# pass_threshold_C  0.74921876
 base  code  pass_count  pass_frac   all_count  all_frac
 C     -     70          0.93333334  76         0.9047619
 C     h     5           0.06666667  7          0.083333336
 C     m     0           0           0          0

Best regards.

--
David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants