duplicated interactions using package GenomicInteractions
0
0
Entering edit mode
@changjiaming-23186
Last seen 4.7 years ago

When using viewPoint in the package "GenomicInteractions", it comes out two duplicated interactions.
How to interpret?

  • pos: 3R 12176627 12177228
  • range: 3R 12125001 12225001

The output from export.bedpe function.
One interaction is reported for each bin expected the bin of the viewpoint, two duplicated contacts [11,12].
How to interpret?
It seems that making a virtual 4C plot will sum up those two contacts as the peak value.

[1,]    3R  12176626    12177228    3R  12125000    12130000    interaction:1   29.20496729
[2,]    3R  12176626    12177228    3R  12130000    12135000    interaction:2   35.22905004
[3,]    3R  12176626    12177228    3R  12135000    12140000    interaction:3   39.02760983
[4,]    3R  12176626    12177228    3R  12140000    12145000    interaction:4   31.94103443
[5,]    3R  12176626    12177228    3R  12145000    12150000    interaction:5   24.62400338
[6,]    3R  12176626    12177228    3R  12150000    12155000    interaction:6   25.75723998
[7,]    3R  12176626    12177228    3R  12155000    12160000    interaction:7   47.33154836
[8,]    3R  12176626    12177228    3R  12160000    12165000    interaction:8   39.7773659
[9,]    3R  12176626    12177228    3R  12165000    12170000    interaction:9   42.21756352
[10,]   3R  12176626    12177228    3R  12170000    12175000    interaction:10  174.2577582
[11,]   3R  12176626    12177228    3R  12175000    12180000    interaction:11  82.46040796
[12,]   3R  12176626    12177228    3R  12175000    12180000    interaction:12  82.46040796
[13,]   3R  12176626    12177228    3R  12180000    12185000    interaction:13  153.469221
[14,]   3R  12176626    12177228    3R  12185000    12190000    interaction:14  78.1590465
[15,]   3R  12176626    12177228    3R  12190000    12195000    interaction:15  37.26302536
[16,]   3R  12176626    12177228    3R  12195000    12200000    interaction:16  37.2618238
[17,]   3R  12176626    12177228    3R  12200000    12205000    interaction:17  32.13126743
[18,]   3R  12176626    12177228    3R  12205000    12210000    interaction:18  26.06920802
[19,]   3R  12176626    12177228    3R  12210000    12215000    interaction:19  25.07189469
[20,]   3R  12176626    12177228    3R  12215000    12220000    interaction:20  8.520661414
[21,]   3R  12176626    12177228    3R  12220000    12225000    interaction:21  22.27647745
[22,]   3R  12176626    12177228    3R  12225000    12230000    interaction:22  23.00218523
GenomicInteractions • 986 views
ADD COMMENT
0
Entering edit mode

Hi,

I suspect this is a bug but I'd need some example data in order to debug this. Can you please provide a reproducible example?

In the meantime, you can remove duplicated interactions from any GenomicInteractions object using the unique() function.

ADD REPLY
0
Entering edit mode

Hello,

Thank you for feedback.

The HiC data can be downloaded from the following link https://drive.google.com/drive/folders/1s92rtmHiX9ovvGZhLqLCRxWyI8MLL8t5?usp=sharing

The R code is as the following (also included in the above-shared folder)

library(GenomicRanges)
library(GenomicInteractions)
library(data.table)
library(multiHiCcompare)

# Read HiC file
interact<-readRDS("/Users/Lazurite/Desktop/untitle/new/cisdecaycurve/data/original_normalize/original+multiHiCcompare_filter.rds")
interact<-hic_table(interact)

# Rename chromosomes
interact$chr[interact$chr==0]<-"2L"
interact$chr[interact$chr==1]<-"2R"
interact$chr[interact$chr==2]<-"3L"
interact$chr[interact$chr==3]<-"3R"
interact$chr[interact$chr==4]<-"4"
interact$chr[interact$chr==5]<-"X"

options(scipen = 999)

# Transfers to Genomicinteractions format
anchor.one = GRanges(interact$chr, IRanges(interact$region1, width=5000))
anchor.two = GRanges(interact$chr, IRanges(interact$region2, width=5000))
interaction_counts = interact[[5]]
test <- GenomicInteractions(anchor.one, anchor.two, counts=interaction_counts)

# Find interactions
pos <- GRanges(seqnames="3R", ranges=IRanges(start=12176626,end=12177228))
region <- GRanges(seqnames="3R", ranges=IRanges(start=12125001, end=12230000))
vp <- viewPoint(test, pos, region)

# Output data
bed<-export.bedpe(vp, fn = NULL, score = "counts")
print(as.data.frame(vp))
print(bed)
ADD REPLY
0
Entering edit mode

Alright, thank you very much for the example data and code! I've tracked down why this is occurring - it's because your GI object includes self-interactions, and so the bait region overlaps both the left and right anchor of one of the interactions. I think in this case the appropriate thing to do would be to just remove non-unique interactions in the output. I'll make this change in the development version now, and it should be included in the next release version at the end of this month. You can safely use unique on the output GI to get the same behaviour.

ADD REPLY
0
Entering edit mode

Get it! Thank you for the quick reply.

ADD REPLY

Login before adding your answer.

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