How I can compute Pearson or Spearman correlation in R?
1
1
Entering edit mode
7.2 years ago
shahryary ▴ 50

I have 2 data file in bed format ( chr22.fna.S15-30_L0-10_M5.bed & GSM669971_BI.Brain_Hippocampus_Middle.Input.112.bed ).

How I can find the correlation between 2 bed files in R language. I used "Jaccard Statistic" tools to find similarity and plot a heatmap. but I don't know how I can find Pearson or Spearman correlation in bed format files in R!?

ChIP-Seq RNA-Seq R genome • 2.4k views
ADD COMMENT
1
Entering edit mode
7.2 years ago

The correlation function in R is called cor(). The help page for it is accessed with "?cor" and it will tell you how to easily compute Spearman and Pearson by using the "method=" parameter.

Before any of that can make sense, you need to realize that correlation is a function of sets of numbers, not 'bed files'

If you meant to compute correlations of a particular column of the BED, after perhaps merging the two on genomic coordinates, that's another question entirely. try "bedtools".

ADD COMMENT

Login before adding your answer.

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