population-transcriptomics / pairedbamtobed12 Goto Github PK
View Code? Open in Web Editor NEWConverts paired-end BAM to BED12 format, based on bedtools
License: GNU General Public License v2.0
Converts paired-end BAM to BED12 format, based on bedtools
License: GNU General Public License v2.0
If read 2 is unmapped or not properly aligned, it should be (optionally ?) possible to represent read 1 as a BED12 line. The problem with read 2 could be reported as a different colour code or score, for instance. Doing the converse with read 2 may not be a good idea, unless it is strictly opt-in, since we use the BED12 format to derive 5โฒ ends, and that information is carried by read 1 in our data.
With reads that are long enough to overlap over a splice junction, the computation of the BED12 blocs will bug and produce improper lines.
For example:
V300073286L2C005R0180080888;RQ:0.00 99 chr1 579808 60 1S122M43N26M = 579866 149 GAGAAGGAGAGAAAAAATAAAGATAAAAATAATGAAGCTTCTCTTTTTGTTTGTCGGGCTGAGCATGGCCGGAACAAAATGCTCCGGGGACATGTGCTGGGCTCAAGAGATGAGAGGACCAAGACCCCGACGAACTGAGAAAAGCGACG 'FFDEF0CGDFFG@@?DFFFF@?>G?GFGGFFBFDCEBC?EFFEG=BGEFGBFGG@0GFFB33FGBFEAG;F;B4DGEDD:GCGED<FG=FA@GEG3EGBFGGGEFE9;GED?FGCD>EEE5B<FAECDFGF:FE@EB9GFDC@BFBG2 AS:i:-21 XN:i:0 XM:i:4 XO:i:0 XG:i:0 NM:i:4 MD:Z:15G25T8C35A61 YS:i:-10 YT:Z:CP RG:Z:DE1_T1_no XS:A:+ NH:i:1
V300073286L2C005R0180080888;RQ:-1.00 147 chr1 579866 60 64M43N52M = 579808 -149 TGAGCATGGCGGGACCAAAATGCTCCGGGGACATGTGCTGGGCTCAAGAGATGAGAGGACCAAGACCCCGACGAACTGAGAAAAGCGACGAATGCTCAATTGATGCGCACAAAACC @G<1DE9D98&CD@4(GFA6:F68B6DCGG.?F>FFFG<BCD2&5DEGFFCCFGG?G?;DFFCG6G0FBFF/F?FF>FFGDEEAEEFDCF>FFD>-FFBFFGFEDFE:AF>GBBBB AS:i:-10 ZS:i:-20 XN:i:0 XM:i:3 XO:i:0 XG:i:0 NM:i:3 MD:Z:10C3A13A87 YS:i:-21 YT:Z:CP RG:Z:DE1_T1_no XS:A:+ NH:i:1
Will give:
chr1 579807 580024 V300073286L2C005R0180080888;RQ:0.00 120 + 579807 579998 255,0,0 4 122,26,64,52 0,165,58,165
(note that 58 < 165)
Currently, all reads are colored to red (255,0,0
). It would be good to color them according to strand, like in the zenbu browser.
In the meantime, the following one-linder will do.
awk '{OFS="\t"}{if($6=="+"){$9="0,120,0"};if($6=="-"){$9="128,0,128"};print}'
This mode will:
Please do not hesitate to submit a pull request if you are faster than me. I can not start to work on this until October.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.