{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "cpg = pd.read_csv('PICO8_nome/nome.NOMe.CpG.cov', sep='\\t', header=None)\n", "gpc = pd.read_csv('PICO8_nome/nome.NOMe.GpC.cov', sep='\\t', header=None)" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [], "source": [ "cpg = pd.read_csv('./GSM2220271_GM_1_CpG_clean.cov.txt', sep='\\t', header=None)\n", "gpc = pd.read_csv('./GSM2220271_GM_1_GpC_clean.cov.txt', sep='\\t', header=None)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
012345
0chr11111110.002
1chr11201200.001
2chr11301300.002
3chr12022020.004
4chr12702700.004
.....................
459015chrZ8230961082309610100.010
459016chrZ8230961182309611100.010
459017chrZ8230966582309665100.010
459018chrZ8230997182309971100.010
459019chrZ8230998082309980100.010
\n", "

459020 rows × 6 columns

\n", "
" ], "text/plain": [ " 0 1 2 3 4 5\n", "0 chr1 111 111 0.0 0 2\n", "1 chr1 120 120 0.0 0 1\n", "2 chr1 130 130 0.0 0 2\n", "3 chr1 202 202 0.0 0 4\n", "4 chr1 270 270 0.0 0 4\n", "... ... ... ... ... .. ..\n", "459015 chrZ 82309610 82309610 100.0 1 0\n", "459016 chrZ 82309611 82309611 100.0 1 0\n", "459017 chrZ 82309665 82309665 100.0 1 0\n", "459018 chrZ 82309971 82309971 100.0 1 0\n", "459019 chrZ 82309980 82309980 100.0 1 0\n", "\n", "[459020 rows x 6 columns]" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cpg" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [], "source": [ "cpg_out = cpg.iloc[:,:4]" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [], "source": [ "cpg_out[3]=cpg_out[3].replace(0,-100)" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [], "source": [ "cpg_out.to_csv('cpgGM.bedGraph', sep='\\t', index=False, header=None)" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [], "source": [ "gpc_out = gpc.iloc[:,:4]\n", "gpc_out[3]=gpc_out[3].replace(0,-100)\n", "gpc_out.to_csv('gpcGM.bedGraph', sep='\\t', index=False, header=None)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
012345
0chr11624316244100.020
1chr1129075129076100.010
2chr11368751368760.001
3chr11368941368950.001
4chr1136910136911100.010
.....................
1554347chrY56885733568857340.001
1554348chrY56885736568857370.001
1554349chrY57027509570275100.001
1554350chrY5717800757178008100.010
1554351chrY5717807357178074100.010
\n", "

1554352 rows × 6 columns

\n", "
" ], "text/plain": [ " 0 1 2 3 4 5\n", "0 chr1 16243 16244 100.0 2 0\n", "1 chr1 129075 129076 100.0 1 0\n", "2 chr1 136875 136876 0.0 0 1\n", "3 chr1 136894 136895 0.0 0 1\n", "4 chr1 136910 136911 100.0 1 0\n", "... ... ... ... ... .. ..\n", "1554347 chrY 56885733 56885734 0.0 0 1\n", "1554348 chrY 56885736 56885737 0.0 0 1\n", "1554349 chrY 57027509 57027510 0.0 0 1\n", "1554350 chrY 57178007 57178008 100.0 1 0\n", "1554351 chrY 57178073 57178074 100.0 1 0\n", "\n", "[1554352 rows x 6 columns]" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cpg" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.12918763851615767" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(gpc[3]>50).sum()/len(gpc)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.26706305907542177" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(cpg[3]>50).sum()/len(cpg)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "cpg8 = pd.read_csv('../PICO8_nome/nome.NOMe.CpG.cov', sep='\\t', header=None)\n", "gpc8 = pd.read_csv('../PICO8_nome/nome.NOMe.GpC.cov', sep='\\t', header=None)" ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.08912184952090842" ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(gpc8[3]>50).sum()/len(gpc8)" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.4921001082530027" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(cpg8[3]>50).sum()/len(cpg8)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "gpc8_out = gpc8.iloc[:,:4]\n", "#gpc8_out[3]=gpc8_out[3].replace(0,-100)\n", "gpc8_out.to_csv('PICO8_gpc0.bedGraph', sep='\\t', index=False, header=None)\n", "cpg8_out = cpg8.iloc[:,:4]\n", "#cpg8_out[3]=cpg8_out[3].replace(0,-100)\n", "cpg8_out.to_csv('PICO8_cpg0.bedGraph', sep='\\t', index=False, header=None)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.3" } }, "nbformat": 4, "nbformat_minor": 4 }