Package: dseq
dseqInstallpipinstalldseqHow to useRead the bam file as a pandas dataframefromdseq.toolsimportto_dfdf=to_df(bam_path='inputs/test.bam',# path to the bam filecontig='14',# i.e. reference name/ targetstart=74846395,# start positionend=74846545,# end positionverbose=True,# verbose)df.head(1)query idCIGARread positionreference positionreferenceread0M04377:211:000000000-D637H:1:1101:7912:5949::u...151M0.074846395.0CCHow to calculateCoverage per position (QC)data=df.dseq.get_coverage()data.head(1)reference positionreferencedepth074846395.0C377## plot_=data.plot.area(x='reference position',y='depth',ylabel='depth',ylim=(data['depth'].max()+10,0),legend=False,)Number of reads per mutations (QC)data=df.dseq.get_counts_per_mutation()data.head(1)4    1
dtype: int64## plot_=data.plot.barh(xlabel='mutations',ylabel='reads')Read depth per nucleotide mutationsdata=df.dseq.get_counts_per_nt_mutation()data.head(1)reference positionreferencereaddepth074846395.0CCNaNMutation mapdata.dseq.get_map(value='depth',aggfunc='sum')reference position74846395.074846396.074846397.074846398.074846399.074846400.074846401.074846402.074846403.074846404.074846405.074846406.074846407.074846408.074846409.074846410.074846411.074846412.074846413.074846414.074846415.074846416.074846417.074846418.074846419.074846420.074846421.074846422.074846423.074846424.074846425.074846426.074846427.074846428.074846429.074846430.074846431.074846432.074846433.074846434.074846435.074846436.074846437.074846438.074846439.074846440.074846441.074846442.074846443.074846444.074846445.074846446.074846447.074846448.074846449.074846450.074846451.074846452.074846453.074846454.074846455.074846456.074846457.074846458.074846459.074846460.074846461.074846462.074846463.074846464.074846465.074846466.074846467.074846468.074846469.074846470.074846471.074846472.074846473.074846474.074846475.074846476.074846477.074846478.074846479.074846480.074846481.074846482.074846483.074846484.074846485.074846486.074846487.074846488.074846489.074846490.074846491.074846492.074846493.074846494.074846495.074846496.074846497.074846498.074846499.074846500.074846501.074846502.074846503.074846504.074846505.074846506.074846507.074846508.074846509.074846510.074846511.074846512.074846513.074846514.074846515.074846516.074846517.074846518.074846519.074846520.074846521.074846522.074846523.074846524.074846525.074846526.074846527.074846528.074846529.074846530.074846531.074846532.074846533.074846534.074846535.074846536.074846537.074846538.074846539.074846540.074846541.074846542.074846543.074846544.074846545.0referenceCCTAAGCCTTTACGGTCACTCACCACTCACTCACTCACTCACCCAGAGCAACTTCCGGTCCTGCAAACTCCCTTCATAGTAAGTGCCCTATACAGGTGTATAATTAAAAAGAAAATATTTTATACCATGGTTTTACTGTACCTCCATGGTTreadA0000000000000000000000000001001000000000000000010000000010000000000000000000101000000000000000000000000000000000000000000000000002000000000001000000100C0020000010000001020102000020001000100030000000000000000000100300000000001100000100010000000000003000100200000000000100000001000000000000001000000000010G00001000000000000300010020001000000010000000100000000000000000000000000000000100000000000000010000000000001100001020000000010010001000002200000000000002T0100000000000010000000000000000000000000100000000000000000000000101001000000000001000000000000000000000000000000100000000000000021000000000000000000100Substitution mapdata.dseq.get_submap(value='depth',aggfunc='sum')referenceACGTreadA0262C50029G190025T5250Read depth per codonsdata=df.dseq.get_counts_per_codon_mutation()data.head(1)reference positioncodon referencecodon readdepth074846395.0CCTCCC2.0Mutation mapdata.dseq.get_map(value='depth',aggfunc='sum')reference position74846395.074846396.074846397.074846398.074846399.074846400.074846401.074846402.074846403.074846404.074846405.074846406.074846407.074846408.074846409.074846410.074846411.074846412.074846413.074846414.074846415.074846416.074846417.074846418.074846419.074846420.074846421.074846422.074846423.074846424.074846425.074846426.074846427.074846428.074846429.074846430.074846431.074846432.074846433.074846434.074846435.074846436.074846437.074846438.074846439.074846440.074846441.074846442.074846443.074846444.074846445.074846446.074846447.074846448.074846449.074846450.074846451.074846452.074846453.074846454.074846455.074846456.074846457.074846458.074846459.074846460.074846461.074846462.074846463.074846464.074846465.074846466.074846467.074846468.074846469.074846470.074846471.074846472.074846473.074846474.074846475.074846476.074846477.074846478.074846479.074846480.074846481.074846482.074846483.074846484.074846485.074846486.074846487.074846488.074846489.074846490.074846491.074846492.074846493.074846494.074846495.074846496.074846497.074846498.074846499.074846500.074846501.074846502.074846503.074846504.074846505.074846506.074846507.074846508.074846509.074846510.074846511.074846512.074846513.074846514.074846515.074846516.074846517.074846518.074846519.074846520.074846521.074846522.074846523.074846524.074846525.074846526.074846527.074846528.074846529.074846530.074846531.074846532.074846533.074846534.074846535.074846536.074846537.074846538.074846539.074846540.074846541.074846542.074846543.074846544.0codon referenceCCTCCTCCTAAGAAGAAGCCTCCTCCTTTATTATTACGGCGGCGGTCATCATCACTCCTCCTCACCACCACCACTACTACTCACCACCACTCATCATCACTCCTCCTCACTACTACTCACCACCACCCACCACCAGAGGAGGAGCAACAACAACTTCTTCTTCCGCCGCCGGTCGTCGTCCTGCTGCTGCAACAACAAACTACTACTCCCCCCCCCTTCTTCTTCATAATAATAGTAGTAGTAAGTAGTAGTGCCGCCGCCCTACTACTATACTACTACAGGAGGAGGTGTTGTTGTATAATAATAATTATTATTAAAAAAAAAAAGAAGAAGAAAAAAAAAATAATAATATTTTTTTTTTATTATTATACCACCACCATGATGATGGTTGTTGTTTTATTATTACTGCTGCTGTACTACTACCTCCTCCTCCATCATCATGGTGGTGGTcodon readAAA000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000000AAC000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000AAG000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000ACA000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000111000000000000111000000000000000000000000000000000ACC000000000000000000000000222000000000333000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ACT000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000222000000000000000000000000000000000000000000000AGA000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111000111000000000000000000000000000000000000AGC000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000AGG000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000AGT000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ATA000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000111000000000000000000000000000000000000ATC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000ATG000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000000ATT000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000222222000000000000000000CAA000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000CAC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000CAT000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000CCA000000000000000111000000000000111000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000CCC222000111000000000111222000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000CCG000000000000000000000000000000000000000000111000000000000000333000000000000000000000000000000000000000000000000000000000000000000000000000000000000000CCT000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000CGC000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000CGG000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000222222000000000000CGT000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000333000000000000000000000000000000000000000000000000000CTA000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000CTC000000000000000000000000000000000000000111000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000CTG000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000CTT111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000GAA000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000GAG000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000GAT000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111GCA000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000GCC000000000000000000000111000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000GCT000000000000000000000000222000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000GGC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111GGG000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000GGT000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000GTA000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000222000000000000000000000000000000000GTC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000GTG000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000GTT000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111TAC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000TAT000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000TCA000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000TCC000000000000000222000000000000000000000000000000000000000000000000000111111000000000000000000000000000000000000000000000000000000000000000000000000000TCG000000000000000333000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000TCT000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000TGT000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000TTA000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000TTC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000TTT000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000Substitution mapdata.dseq.get_submap(value='depth',aggfunc='sum')codon referenceAAAAAGACCACTAGGAGTATAATGATTCAACACCATCCACCCCCGCCTCGGCTACTCCTGCTTGAGGCCGGTGTAGTCGTTTACTATTCATGTTTATTCTTTcodon readAAA0000003000000000000000000000000000AAC0000000000300000000000000000000000AAG3000000000000000000000000000000000ACA0000006000000000000000000000030000ACC00015000000000000000000000000000000ACT0000000060000000000000000000000000AGA6000000000000000000000000000000000AGC0000030000000000000000000000000000AGG0300000000000000000000000000000000AGT0000000000000000000000000000000000ATA3000000000000000000000003000000000ATC0000000000000000003000000000000000ATG0000003000000000000000000000000000ATT0000000600000000000000000060000000CAA0000000000000000000000000000000000CAC0000000000000000000000000003000000CAT0000000000000000000000000000000000CCA0000000000000030000000000000060000CCC0090000000000009006000000000000000CCG0000000000003000000900000000000000CCT0000000000000000000000000000000000CGC0000000000300000000000000000000000CGG00000000000000000006600000000000000CGT0000000000000000300000000000009000CTA0000000003000000000000000000000000CTC0000000000300000000000000000000030CTG0000000000000000000000000000000000CTT0000000000000003000000000000000000GAA0000000000000000000003000000000000GAG0000000000000000000000000000000000GAT0000000000000000000000030000000000GCA0000000000000000000000003000000000GCC0060000000000000000000000300000000GCT0009000000000000000000000000000000GGC0000000000000000000000030000000000GGG0000300000000000000000000000000000GGT0000000000000000000000000030000000GTA0000006000000000000000000000000000GTC0000000000000000000000000000000000GTG0000000300000000000000000000000000GTT0000000000000000000000030000000000TAC0000000000000000000000000000000000TAT0000000000000000000000000000000000TCA0000000000000000000000000000000000TCC0000000000000300000000000000060030TCG0000000000000000000000000000090000TCT0003000000000000000000000000000000TGT0000030000000000000000000000000000TTA0000000000000000000000000000000000TTC0000000000000000000000000000000000TTT0000000000000000000000000030000000Read depth per amino acidsdata=df.dseq.get_counts_per_aa_mutation()data.head(1)reference positioncodon referencecodon readdepthaa referenceaa read074846395.0CCTCCC2.0PPMutation mapdata.dseq.get_map(value='depth',aggfunc='sum')reference position74846395.074846396.074846397.074846398.074846399.074846400.074846401.074846402.074846403.074846404.074846405.074846406.074846407.074846408.074846409.074846410.074846411.074846412.074846413.074846414.074846415.074846416.074846417.074846418.074846419.074846420.074846421.074846422.074846423.074846424.074846425.074846426.074846427.074846428.074846429.074846430.074846431.074846432.074846433.074846434.074846435.074846436.074846437.074846438.074846439.074846440.074846441.074846442.074846443.074846444.074846445.074846446.074846447.074846448.074846449.074846450.074846451.074846452.074846453.074846454.074846455.074846456.074846457.074846458.074846459.074846460.074846461.074846462.074846463.074846464.074846465.074846466.074846467.074846468.074846469.074846470.074846471.074846472.074846473.074846474.074846475.074846476.074846477.074846478.074846479.074846480.074846481.074846482.074846483.074846484.074846485.074846486.074846487.074846488.074846489.074846490.074846491.074846492.074846493.074846494.074846495.074846496.074846497.074846498.074846499.074846500.074846501.074846502.074846503.074846504.074846505.074846506.074846507.074846508.074846509.074846510.074846511.074846512.074846513.074846514.074846515.074846516.074846517.074846518.074846519.074846520.074846521.074846522.074846523.074846524.074846525.074846526.074846527.074846528.074846529.074846530.074846531.074846532.074846533.074846534.074846535.074846536.074846537.074846538.074846539.074846540.074846541.074846542.074846543.074846544.0aa referencePPPKKKPPPLLLRRRSSSLLLTTTTTTHHHSSSLLLTTTHHHPPPEEEQQQLLLPPPVVVLLLQQQTTTPPPFFFIIIVVVSSSAAALLLYYYRRRCCCIIIIIIKKKKKKKKKIIIFFFYYYTTTMMMVVVLLLLLLYYYLLLHHHGGGaa readA000000000000000000000111222000000000111000000000000000000111000000000000000000111000000000000000000000000000000000000000000111000000000000000000000000C000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000D000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111E000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000F000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000G000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000111000000000000000111H000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000I000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000111000000000000222222000000000111000000K000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000111000000000000000000000000000000000000000000L111000000000000000000000000000000000000111000000000000000000000111000000111000000000000000000000000000000000000000000000000000000000000000000000000000M000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000000N000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000P222000111000000111111222000000111111000000111000000000111000333000000000000000000000000000000000000000000000000000000000000111000000000000000000000000Q000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000R000111000000111000000000000111000000000000000000000000000000000000000000000000000000000000000000333000000111000111000000000000000000000222222000000000000S000000000000000555000000000000000000000000000000000000000000000000111111111000000111000000000000000000000000000000000000000000000000000000000000000000T000000000000000000000000222000111000333000000000000000000000000000000000000000000000000000000000000111222000000000111000000000000000000000000000000000V000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000222000000000111000000000000000000111Y000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Substitution mapdata.dseq.get_submap(value='depth',aggfunc='sum')aa referenceACEFGHIKLMPQRSTVYaa readA000000000000001560C00000000000003000D00003000000000000E00300000000000000F00000000000000030G00003000000030030H00000000000000003I00000003360000090K00000033000000000L00030300003300000M00000030000000000N00000300000000000P0000000015015006900Q00000000000000000R090003096600030000S000300000030018300T0000001200000031500V00003060030000000Y00000000000000000How toNormalize read depth of a mutations by the cumulative read depth, to calculate mutation freqencydata=df.dseq.get_frequencies_per_nt_mutation()data.head(1)reference positionreferencereaddepth mutationdepth totalfrequency074846395.0CCNaN377NaNMutation mapdata.dseq.get_map(value='frequency',aggfunc='sum',fmt="{:.3f}")reference position74846395.074846396.074846397.074846398.074846399.074846400.074846401.074846402.074846403.074846404.074846405.074846406.074846407.074846408.074846409.074846410.074846411.074846412.074846413.074846414.074846415.074846416.074846417.074846418.074846419.074846420.074846421.074846422.074846423.074846424.074846425.074846426.074846427.074846428.074846429.074846430.074846431.074846432.074846433.074846434.074846435.074846436.074846437.074846438.074846439.074846440.074846441.074846442.074846443.074846444.074846445.074846446.074846447.074846448.074846449.074846450.074846451.074846452.074846453.074846454.074846455.074846456.074846457.074846458.074846459.074846460.074846461.074846462.074846463.074846464.074846465.074846466.074846467.074846468.074846469.074846470.074846471.074846472.074846473.074846474.074846475.074846476.074846477.074846478.074846479.074846480.074846481.074846482.074846483.074846484.074846485.074846486.074846487.074846488.074846489.074846490.074846491.074846492.074846493.074846494.074846495.074846496.074846497.074846498.074846499.074846500.074846501.074846502.074846503.074846504.074846505.074846506.074846507.074846508.074846509.074846510.074846511.074846512.074846513.074846514.074846515.074846516.074846517.074846518.074846519.074846520.074846521.074846522.074846523.074846524.074846525.074846526.074846527.074846528.074846529.074846530.074846531.074846532.074846533.074846534.074846535.074846536.074846537.074846538.074846539.074846540.074846541.074846542.074846543.074846544.074846545.0referenceCCTAAGCCTTTACGGTCACTCACCACTCACTCACTCACTCACCCAGAGCAACTTCCGGTCCTGCAAACTCCCTTCATAGTAAGTGCCCTATACAGGTGTATAATTAAAAAGAAAATATTTTATACCATGGTTTTACTGTACCTCCATGGTTreadA0.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.0000.0030.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0060.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0030.0000.000C0.0000.0000.0050.0000.0000.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0030.0000.0050.0000.0030.0000.0050.0000.0000.0000.0000.0050.0000.0000.0000.0030.0000.0000.0000.0030.0000.0000.0000.0080.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.0000.0000.0080.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.0030.0000.0000.0000.0000.0000.0030.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0080.0000.0000.0000.0030.0000.0000.0050.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.000G0.0000.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0080.0000.0000.0000.0030.0000.0000.0050.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.0030.0000.0000.0000.0000.0030.0000.0050.0000.0000.0000.0000.0000.0000.0000.0000.0030.0000.0000.0030.0000.0000.0000.0030.0000.0000.0000.0000.0000.0610.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.006T0.0000.0030.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.0000.0030.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0060.0030.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0030.0000.000Substitution mapdata.dseq.get_submap(value='frequency',aggfunc='sum',fmt="{:.3f}")referenceACGTreadA0.0000.0050.0160.005C0.0130.0000.0000.077G0.0510.0000.0000.069T0.0130.0050.0140.000Extract indelsdata=(df.query("`CIGAR`.str.contains('I') or `CIGAR`.str.contains('D')")## keep indels)data.head(1)query idCIGARread positionreference positionreferenceread37M04377:211:000000000-D637H:1:1101:10676:7283::...22M1D129M36.074846395.0CCHow to cite@misc{Dandage2023,
  author = {Dandage, Rohan},
  title = {Deep sequencing data analysis in pandas.},
  year = {2023},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/rraadd88/dseq}},
}Similar Projectssambamba depthDsamtools depthCmosdepthNimperbaseRustbam-readcountC++