how to use python pandas to create a matrix for heatmap plotting
0
0
Entering edit mode
3.2 years ago
szp770 ▴ 10

Hi, all. Now I have a interaction file like this: the last column shows the read counts

chr8     10000        15000       chr8     10000        15000       3
chr8     20000        25000       chr8     20000        25000       4
chr8     25000        30000       chr8     25000        30000       5
chr8     35000        40000       chr8     35000        40000       1
chr8     40000        45000       chr8     40000        45000       4
chr8     45000        50000       chr8     45000        50000       1

Now I want to use python to create a matrix like this:

                chr8-10000  chr8-15000 chr8-20000 chr8-25000 chr8-30000 chr8-35000  chr8- 
           40000  chr8-50000
chr8-10000
chr8-15000
chr8-20000
chr8-25000
chr8-30000
chr8-35000
chr8-40000
chr8-50000

And finally, I can fill this table according to the read counts from the interaction file. and for the NA values to fill 0.

How to finish all the things in python. Thanks!

RNA-Seq next-gen python sequencing • 544 views
ADD COMMENT

Login before adding your answer.

Traffic: 2407 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