In [4]:
%matplotlib inline
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import sys,os
path='/'.join(os.getcwd().split('/')[:-4])
sys.path.insert(1,path)
import Utils.Util as utl
import pandas as pd
pd.options.display.max_rows = 20;
pd.options.display.expand_frame_repr = True
from IPython.display import display
import seaborn as sns
import Scripts.HLI.Kyrgyz.FILTER.analysis as flt

In [6]:
reload(flt);a=flt.load()
b=a[a.Other==0].PASS

In [7]:
reload(flt);flt.poltFILTER(a)



In [8]:
b.value_counts().sort_index().plot.bar();plt.title('Distribution of number of PASS in the NOFAIL sites.');



In [10]:
c=a.reset_index()
c['start']=c.POS;c['end']=c.POS
c


Out[10]:
CHROM POS PASS NA Other start end
0 1 10066 0 33 1 10066 10066
1 1 10098 0 33 1 10098 10098
2 1 10108 0 33 1 10108 10108
3 1 10109 0 33 1 10109 10109
4 1 10147 0 33 1 10147 10147
5 1 10157 0 33 1 10157 10157
6 1 10158 0 33 1 10158 10158
7 1 10175 0 33 1 10175 10175
8 1 10177 0 31 3 10177 10177
9 1 10180 0 33 1 10180 10180
... ... ... ... ... ... ... ...
15771673 Y 56887503 0 25 9 56887503 56887503
15771674 Y 56887530 0 28 6 56887530 56887530
15771675 Y 56887546 0 33 1 56887546 56887546
15771676 Y 56887583 0 26 8 56887583 56887583
15771677 Y 56887610 0 33 1 56887610 56887610
15771678 Y 56887618 0 33 1 56887618 56887618
15771679 Y 56887630 0 33 1 56887630 56887630
15771680 Y 56887631 0 33 1 56887631 56887631
15771681 Y 56887636 0 33 1 56887636 56887636
15771682 Y 56887710 0 33 1 56887710 56887710

15771683 rows × 7 columns


In [ ]:
reload(utl)
xmap=utl.BED.xmap_bed(c,hgFrom=38,hgTo=19,keepOnlyPos=True)


         CHROM     start       end
0            1     10066     10066
1            1     10098     10098
2            1     10108     10108
3            1     10109     10109
4            1     10147     10147
5            1     10157     10157
6            1     10158     10158
7            1     10175     10175
8            1     10177     10177
9            1     10180     10180
...        ...       ...       ...
15771673     Y  56887503  56887503
15771674     Y  56887530  56887530
15771675     Y  56887546  56887546
15771676     Y  56887583  56887583
15771677     Y  56887610  56887610
15771678     Y  56887618  56887618
15771679     Y  56887630  56887630
15771680     Y  56887631  56887631
15771681     Y  56887636  56887636
15771682     Y  56887710  56887710

[15771683 rows x 3 columns]