Giter Site home page Giter Site logo

ctcf-motif-imr90's People

Contributors

liz-is avatar

Watchers

 avatar  avatar

ctcf-motif-imr90's Issues

Error in DataFrame(..., check.names = FALSE) : trying to get slot "score" from an object of a basic class ("list") with no slots

Hi I found your code really useful a couple of months ago.
However, it seems that due to internal changes in R (I'm using a different system and version of R now..)- the function 'gr_of_matches' no longer works:
(I've played around with it a little)

ctcf_imr90_seqs <- getSeq(Mmusculus, ctcf_imr90)
imr90_matches <- lapply(ctcf_imr90_seqs, function(s){
  searchSeq(pwm, s, min.score = "60%")})

gr_of_matches <- function(i){
  genome=Mmusculus
  gr=ctcf_imr90[i]
  matches=imr90_matches[i]
  if (length(matches) > 0){
    GRanges(seqnames = seqnames(gr),
            ranges = IRanges(start = start(matches@views) + start(gr),
                             end = end(matches@views) + start(gr)),
            strand = matches@strand,
            score = matches@score,
            relscore = relScore(matches),
            seqinfo = seqinfo(genome))
  }
}

All of this seems fine- but when I try to use the function as you do:

Map(function(g){gr_of_matches(g)},seq_along(ctcf_imr90))
Error in DataFrame(..., check.names = FALSE) : 
  trying to get slot "score" from an object of a basic class ("list") with no slots

So I inspect a single element of the lists 'ctcf_imr90' and 'imr90_matches':

i=1
gr=ctcf_imr90[i]
matches=imr90_matches[i]
print(gr)
print(matches)
GRanges object with 1 range and 0 metadata columns:
      seqnames          ranges strand
         <Rle>       <IRanges>  <Rle>
  [1]     chr1 4132698-4132898      *
  -------
  seqinfo: 22 sequences from an unspecified genome; no seqlengths

[[1]]
An object of class SiteSet with 7 site sequences
  seqname source feature start end     score strand frame
1 Unknown   TFBS    TFBS    54  71 -7.191454      +     .
2 Unknown   TFBS    TFBS    87 104 -4.879139      +     .
3 Unknown   TFBS    TFBS    89 106 -4.329033      +     .
4 Unknown   TFBS    TFBS   155 172 -4.540207      +     .
5 Unknown   TFBS    TFBS   157 174 -4.494559      +     .
6 Unknown   TFBS    TFBS     3  20 -6.531094      -     .
7 Unknown   TFBS    TFBS    13  30 -5.878366      -     .
                                         attributes
1 TF=CTCF;class=Unknown;sequence=CACAGTACCAGTACTGGG
2 TF=CTCF;class=Unknown;sequence=CACAGTGCAACAGCGCCT
3 TF=CTCF;class=Unknown;sequence=CAGTGCAACAGCGCCTTC
4 TF=CTCF;class=Unknown;sequence=TGGAGAAAAGCCCCATGG
5 TF=CTCF;class=Unknown;sequence=GAGAAAAGCCCCATGGAA
6 TF=CTCF;class=Unknown;sequence=CAGAATCCATCTTCACCT
7 TF=CTCF;class=Unknown;sequence=GGCAGCTCCTCAGAATCC

The problem seems to be with where you are subsetting the 'matches' object with '@':

matches@views
Error in DataFrame(..., check.names = FALSE) : 
  trying to get slot "score" from an object of a basic class ("list") with no slots

Has the output of 'searchSeq' changed such that one can no longer subset it with '@'?
If this is the case could you point me in the right direction to correct the 'gr_of_matches'
function such that it works?
Thanks

can I implement this code for other cell lines?

Hi, I am really interested in implementing this for other analyses in different cell lines. I used your code but changed your query to the annotation hub from IMR90 to K562 (and/or MCF7)... is this viable? Indeed a bed file resulted with a different number of lines to that of the IMR90 query but I'm not sure- it seems like a fuzzy search.... Can I be sure that the resultant bed file regions are solely taken from K562/MCF7 data?
Apologies I am not experienced with this type of data collection
Chris

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.