Tool:metaflagstat.py - painless bam/sam read flag counting
1
2
Entering edit mode
7.3 years ago
John 13k

Hello all,

metaflagstat is a tool which allows bioinformaticians and scientists alike to get an in-depth understanding of there sequencing read flag statistics. It's written in Python, free and open source, and creates pretty graphs :)

Demo/Tutorial: http://vimeo.com/108615219​
Code: http://ac.gt/metaflagstat/
Example Output: http://ac.gt/metaflagstat/example.html

Get Involved:

If you have any ideas or find any bugs whilst using the program - just send me an e-mail and i'll patch it in/out :)

Currently working on:

  • Doing flag/read counting on a per-chromosome basis by default, allowing users to look for differences in, say, duplication rates, between chromosomes.
  • The short hop from counting per-chromosome to also counting user-defined regions (from a BED file) to check mappability in regions, say, repeat regions, between samples.
  • Storing insertion length distributions for different read flag combinations, and different chromosomes.
  • Visa versa, storing read flags counts at different insertion length windows.
  • Convert a query into samtools notation to quickly get a file of the reads you counted.
  • Offline mode

All the best!

Update!

  • Query parser has been remade. It now excepts all valid algebra, and understands BODMAS :]
  • Chart options / CSS has been tweaked to give your data more screen space - no more tiny bars when you analyse more than 10 files at once! ;~)

These updates effect the JavaScript and not the Python, so you don't need to redownload anything, and will immediately effect all outputs - including those created before the update was released.

samtools flagstat Tool bam flag • 2.1k views
ADD COMMENT
0
Entering edit mode

don't post code here, put your code on GitHub or other repositories where you can keep it up to date, comment on issues and feedback etc.

ADD REPLY
0
Entering edit mode

also sounds pretty cool looking forward to trying it, have the code in a repository

ADD REPLY
0
Entering edit mode

Thanks man! Appreciate the advice on Github :)

Git from the command line seems to have a pretty steep learning curve, but I think it's up now. Good luck testing it out on your bam/sam files!

ADD REPLY
0
Entering edit mode

I tried it out, did not work, well I kind of expected that. Error recovery is a pretty tricky issue. I'll submit an ticket online.

ADD REPLY
0
Entering edit mode

I totally forgot to mention that you have to set the path to your samtools installation (nestled in the 16th row of the file..)

Because my copy uses pysam it didn't hit this error. Good catch! :D

ADD REPLY
0
Entering edit mode

your video link is a 404

ADD REPLY
0
Entering edit mode
7.2 years ago
John 13k

So thanks to the feedback from Istvan and others, the code has undergone some big changes and improvements, so I hope people find it useful.

I edited my initial post to show where you can get metaflagstat from, and the video (which took 5 hours + to encode after I posted the link...) is up and working. If you are very familiar with read flags and don't want to spend time listening to the theory/etc, you can skip the first 5 minutes and get right to how to use the program - but I think it's probably useful to some.

All the best :)

ADD COMMENT

Login before adding your answer.

Traffic: 3500 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6