This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to use python pandas to create a matrix for heatmap plotting

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

0 answers

No answers yet.

Log in to answer this question.