Error in APA analysis
Hello, I have two hic files, I read them to R using the codes:
WT <- load_contacts(signal_path = 'GSM4754923_WT_E14_MN_rep1_filtered.hic',sample_name='WT')
KO <- load_contacts(signal_path = 'GSM4754925_Maz_KO_MN_rep1_filtered.hic',sample_name='KO')
peak <- read.delim('left_right_CTCF1.txt',sep = '\t',h = F,stringsAsFactors = F)
and when I run APA like this:
apa <- APA(list(WT = WT, KO = KO), bedpe = peak)
there is an error:
Error: Indices of experiment(s) 2 are not equal to indices of experiment 1
So how to deal with this? Thanks!
Hi there,
Have you tried the sync_indices() function?
E.g.
explist <- sync_indices(list(WT, KO))
apa <- APA(explist, bedpe = peaks)
apa <- APA(explist, bedpe = peaks)
Hi, another error: 'Error in value[[1L]] : subscript out of bounds'
I made a typo, I meant bedpe = peak instead of peaks.
Is it specifically APA() that gives this error, or do others give this error as well?
If it is just APA(), can you show me the output of head(peak)?
Hi, I know there's a typo, so I changed it. APA runs successfully. head(peak) shows this: V1 V2 V3 V4 V5 V6 1 chr19 3290000 3300000 chr19 3440000 3450000 2 chr19 8570000 8580000 chr19 8680000 8690000 3 chr16 42160000 42170000 chr16 44060000 44070000 4 chr16 44760000 44770000 chr16 45090000 45100000 5 chr16 44760000 44770000 chr16 45630000 45640000 6 chr16 62940000 62950000 chr16 64740000 64750000
Ah good, so this issue appears to be resolved then?
Ah good, so this issue appears to be resolved then? no, the same error:
apa <- APA(explist, bedpe = peak) Error in value[[1L]] : subscript out of bounds
Ah good, so this issue appears to be resolved then?
Hello, there is still such an error: apa <- APA(explist, bedpe = peak) Error in value[[1L]] : subscript out of bounds
Yeah sorry I don't know what causes the error, I cannot reproduce this on my end.
the error "subscript out of bounds" in this package is often caused by chromosome name is inconsistent between files, i.e. "1" vs. "chr1"
Thanks @Moonriver1988, that seems like a reasonable thing to check against. I'll see what I can do to give a more friendly error in this case.