liz-is / ctcf-motif-imr90 Goto Github PK
View Code? Open in Web Editor NEWCalculation of CTCF motif directions for IMR90
License: MIT License
Calculation of CTCF motif directions for IMR90
License: MIT License
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.