chromVAR icon indicating copy to clipboard operation
chromVAR copied to clipboard

fragment_counts

Open Renfang2019 opened this issue 4 years ago • 0 comments

Dear, I am still trying the chromVAR on ATAC data using narrowPeak and bam file.

I got the peaks right, please see below. But I could not get the fragment_counts right. It is always no column after I read in bam file and used getcounts. Anywhere I did wrong? I made an excel sheet with two rows and two columns for the sample name and sample type as DataFrame. Please see at the end of the question. Thank you so much.

head(peaks) GRanges object with 6 ranges and 0 metadata columns: seqnames ranges strand <Rle> <IRanges> <Rle> [1] chr1 3116839-3117177 * [2] chr1 3117300-3117603 * [3] chr1 3361024-3361221 * [4] chr1 3372725-3372891 * [5] chr1 3395612-3395733 * [6] chr1 3399894-3400576 *

seqinfo: 21 sequences from an unspecified genome; no seqlengths

bamfile <- "E16WTc_chr.bam"

fragment_counts <- getCounts(bamfile,

  •                          peaks, 
    
  •                          paired =  TRUE, 
    
  •                          by_rg = FALSE, 
    
  •                          format = "bam", 
    
  •                          colData = DataFrame(sampletype = "E16"))
    

fragment_counts <- addGCBias(fragment_counts,

  •                         genome = BSgenome.Mmusculus.UCSC.mm10)
    

head(rowData(fragment_counts)) DataFrame with 6 rows and 1 column bias 1 0.433628318584071 2 0.417763157894737 3 0.52020202020202 4 0.491017964071856 5 0.401639344262295 6 0.464128843338214

DataFrame I make an excel file inclueds two rows, two columns.

  samplename sampletype
1 E16WTc_chr.bam E16

Renfang2019 avatar Jul 24 '19 16:07 Renfang2019