Hi Felix,
You're rigth, I move to the BioC list.
I tried your exemple, it works well.
In the exptData, do I really need all these fields ? or can I use an empty string for projectPath, fragmentDir, reSequence1 ... ?
Then, just to clarify some points ;
fc@colData is your experimental design, so in your exemple, you have 6 samples from the same viewpoint "testdata".
What about rowData ? if I'm correct, these are the measures (counts) per viewpoint ? so here you only have interacting loci per viewpoint ? Which make sense with the dim of the counts object (6 samples x 2 measures)
I'm just wondering if you can have multiple viewpoints in the same FourC object ? with potentially different number of measures ...
Thank you again,
Best wishes
N.
--------------------------------
Hi Nicolas,
this might be interesting to other users as well. So I would recommend we move the discussion to the Biocondoctor Support Forum if this is fine with you.
Have a look at the script below. This should explain all the steps you need to do to add a custom fragment reference, viewpoint information and counts.
Best regards,
Felix
--------------------------------
library(FourCSeq)
exptData <- SimpleList(projectPath=tempdir(),
fragmentDir="re_fragments",
referenceGenomeFile=system.file("extdata/dm3_chr2L_1-6900.fa",
package="FourCSeq"),
reSequence1="GATC",
reSequence2="CATG",
primerFile="",
bamFilePath="")
colData <- DataFrame(viewpoint = "testdata",
condition = factor(rep(c("WE_68h", "MESO_68h", "WE_34h"),
each=2),
levels = c("WE_68h", "MESO_68h", "WE_34h")),
replicate = rep(c(1, 2),
3),
bamFile = "",
sequencingPrimer="")
fc <- FourC(colData, exptData)
fc
## this step can also be skipped by adding your fragment reference (GRanges)
##rowData(fc) <- your Fragment GRanges
fc <- addFragments(fc)
fc
## counts would by your HiC counts, here I take a random sample
cnts <- matrix(sample(1:10, prod(dim(fc)), replace = TRUE),
nrow=nrow(fc))
cnts
## make sure they are integers otherwise you will get an error
typeof(cnts)
counts(fc) <- cnts
fc
## manually add viewpoint information because there is no primerfile
colData(fc)$chr = "chr2L"
colData(fc)$start = 6027
colData(fc)$end = 6878
## now you should be able to continue with the workflow
On 10/09/2015 06:34 PM, Nicolas Servant wrote:
Dear Felix,
I'm developing the HiTC package on Bioconductor to analyse Hi-C data.
I would like to make a test to see whether the method implemented in FourCSeq can be used on some specific Hi-C viewpoints (so 4C like information).
So actually, my question is quite simple, let's say that I have a GRanges objects with a count information extracted from HiTC, and that I would like to enter into FourCSeq to detect valid interactions.
I saw that the FourC object require many information about the pre-processing such as the BAM file, etc.
Could give any advices to create such object from a count table ?
Thank you very much
Best wishes
Nicolas
might be useful ...
> fragData
GRanges object with 3999 ranges and 11 metadata columns:
seqnames ranges strand | name leftSize
<Rle> <IRanges> <Rle> | <character> <numeric>
[1] chrX [6062965, 6064347] * | 1 1
[2] chrX [6575454, 6575816] * | 3 1
[3] chrX [6654254, 6654532] * | 2 1
[4] chrX [6797051, 6797749] * | 2 1
[5] chrX [6840652, 6841408] * | 1 1
... ... ... ... ... ... ...
[3995] chrX [166228487, 166228621] * | 3 1
[3996] chrX [166406018, 166406225] * | 1 1
[3997] chrX [166416551, 166417709] * | 1 1
[3998] chrX [166425067, 166425507] * | 1 1
[3999] chrX [166445050, 166445420] * | 4 1
rightSize leftValid rightValid mid dist posLeft posRight
<numeric> <logical> <logical> <numeric> <numeric> <logical> <logical>
[1] 1 TRUE TRUE 6063656 -94613561 TRUE FALSE
[2] 1 TRUE TRUE 6575635 -94101582 TRUE FALSE
[3] 1 TRUE TRUE 6654393 -94022824 TRUE FALSE
[4] 1 TRUE TRUE 6797400 -93879817 TRUE FALSE
[5] 1 TRUE TRUE 6841030 -93836187 TRUE FALSE
... ... ... ... ... ... ... ...
[3995] 1 TRUE TRUE 166228554 65551337 FALSE TRUE
[3996] 1 TRUE TRUE 166406121 65728904 FALSE TRUE
[3997] 1 TRUE TRUE 166417130 65739913 FALSE TRUE
[3998] 1 TRUE TRUE 166425287 65748070 FALSE TRUE
[3999] 1 TRUE TRUE 166445235 65768018 FALSE TRUE
blind vpChr
<logical> <logical>
[1] FALSE TRUE
[2] FALSE TRUE
[3] FALSE TRUE
[4] FALSE TRUE
[5] FALSE TRUE
... ... ...
[3995] FALSE TRUE
[3996] FALSE TRUE
[3997] FALSE TRUE
[3998] FALSE TRUE
[3999] FALSE TRUE
-------
seqinfo: 1 sequence from an unspecified genome; no seqlengths