FourCSeq - how to write tables with the results
3
0
Entering edit mode
@francesclopez-8907
Last seen 9.2 years ago
United States

Hi, 

I went through the whole workflow and I would like to print tables with the data in results and fcf objects. How can I do that?

One table could include sample wise information with zscores, p-values, counts and the other with the differences between conditions. I have 2 reps for each of the 3 conditions. 

Ideally, I would like to see the peaks/interactions with chr and coordinates (chr, start, end).

Is there an easy way to add the closest or overlapped feature in the genome? using TxDb.Hsapiens.UCSC.hg19.knownGene?

As far I understand this method only looks at interactions within the same chromosome (no trans interactions) right?

I am not an expert on R as you noticed.

Thank you very much for your time and help,

Francesc

fourcseq • 2.0k views
ADD COMMENT
3
Entering edit mode
felix.klein ▴ 150
@felixklein-6900
Last seen 6.4 years ago
Germany

Hello Francesc,

as first step I would recommend to look into the pdf vignette of the package. There are some examples how the data can be extracted.

Here is a short summary of the things I think you are looking for:

You can extract the genomic information about the fragments (GRanges Object) with the following command:

frags <- rowData(fcf)

This contains quite some information from intermediate steps. If you only want the positions use this:

mcols(frags) <- NULL

To extract the zscores (as matrix) from the Object run this command:

zScore <- assay(fcf, "zScore")

And to merge it with the genomic positions it has to be transformed to a DataFrame and then can be attached to mcols of the GRanges object.

mcols(frags) <- cbind(mcols(frags), DataFrame(zScore))

frags

For the other assays you can do this as well. Which assays there are can be checked by this:

names(assays(fcf))

 

For the differential analysis you get the results like this:

results <- getAllResults(fcf)
head(results)[,1:6]

 

I hope this answers your questions. There are some nice tutorials how to work with GRanges and SummarizedExperiments (which is the class on which FourCSeq builds on). Have a look at those as well to get more familiar with them

Best regards,

Felix

 

ADD COMMENT
0
Entering edit mode

Hi Felix,

I was wondering when running results <- getAllResults(fcf) is there an option to also export the genomic location for each test as one of the columns? 

Thanks,

Fides

ADD REPLY
0
Entering edit mode
Hello Fides, could you please specify what you exactly mean by this? Felix On 06/14/2016 09:01 AM, fidlay [bioc] wrote: > Activity on a post you are following on support.bioconductor.org > <https: support.bioconductor.org=""> > > User fidlay <https: support.bioconductor.org="" u="" 10894=""/> wrote Comment: > FourCSeq - how to write tables with the results > <https: support.bioconductor.org="" p="" 72982="" #83766="">: > > Hi Felix, > > I was wondering when running results <- getAllResults(fcf) is there an > option to also export the genomic location for each test as one of the > columns? > > Thanks, > > Fides > > ------------------------------------------------------------------------ > > Post tags: fourcseq > > You may reply via email or visit > C: FourCSeq - how to write tables with the results >
ADD REPLY
0
Entering edit mode

Hi Felix, 

Sorry for the delayed reply --

What I meant was that when I used getAllResults, the output I am getting is a data frame or table whose first 6 columns are these: 

head(results[,1:6])

"baseMean"    "log2FoldChange_ctrl_essrb_kd"    "lfcSE_ctrl_essrb_kd"    "stat_ctrl_essrb_kd"    "pvalue_ctrl_essrb_kd"    "padj_ctrl_essrb_kd"

It tells me the log fold change and the statistics, but since there is no genomic location, I don't know which interactions corresponds to where relative to bait. 

Thanks!

Fides

ADD REPLY
0
Entering edit mode

Hello Fides,

this is straight forward, since results has the same dimensions as the FourCSeq object. So you can get the genomic coordinates with `rowRanges(fcf)` from there and join it to the results.

combinedData <- cbind(as.data.frame(rowRanges(fcf)), results)

Best regards,

Felix

 

ADD REPLY
0
Entering edit mode

Great - thank you!

ADD REPLY
0
Entering edit mode
@francesclopez-8907
Last seen 9.2 years ago
United States

Thanks for all your help. 

I used this to annotated with genes that overlapped the coordinates.

Mapping genome regions to gene symbols

ADD COMMENT
0
Entering edit mode
ferbecneu • 0
@ferbecneu-16188
Last seen 4.1 years ago

Hi Felix I tried doing what you advised with combinedData <- cbind(as.data.frame(rowRanges(fcf)), results) 

and also with mcols(frags) <- cbind(mcols(frags), DataFrame(zScore))  but I get the error:

Error in DataFrame(..., check.names = FALSE) : 
  different row counts implied by arguments

Do you know how can I solve this?

Thanks!

ADD COMMENT

Login before adding your answer.

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