matthuska / trap Goto Github PK
View Code? Open in Web Editor NEWR package implementing the TRAP method to predict transcription factor binding affinity to DNA sequences
License: GNU Lesser General Public License v2.1
R package implementing the TRAP method to predict transcription factor binding affinity to DNA sequences
License: GNU Lesser General Public License v2.1
Hi,
I am interested in using your package to calculating the affinity of predicted binding sites and subsequently the significance of the affinity values.
My pipeline (using your instructions from https://rdrr.io/github/matthuska/tRap/man/) is as follows:
pfm
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
A 2 3 5 1 0 13 1 3 18 0 6 1 0 1 1 6 1 2 6 2
C 8 3 2 17 19 0 12 10 1 0 0 1 0 1 18 0 12 7 6 5
G 2 10 12 1 0 5 7 1 1 20 14 14 20 18 0 14 5 3 7 7
T 8 4 2 1 0 2 0 6 0 0 0 5 0 1 1 0 1 8 1 6
pwm <- toPWM(pfm)
pwm=PWMatrix(ID="Unknown", name=tf, matrixClass="Unknown", strand="+", bg=c(A=0.25, C=0.25, G=0.25, T=0.25), tags=list(), profileMatrix=pwm, pseudocounts=numeric())
peaks = searchSeq(pwm, seq, min.score = "80%",mc.cores=10L)
peaks_bed = as(peaks, "GRanges")
head(as.data.frame(peaks_bed$siteSeqs)$x)
[1] "AGCCCACTAGGGTGCAGTCC" "ATACCAGAAGAAGGCATCAG" "ACACCAGAAGAGGGCGTCAG"
[4] "ATGCCACGAGGTGGAGATAA" "GACTCACTAGAGGGCACAGG" "TCTACAGCAGGTGGCAACAC"
af=affinity(normalize.pwm(pwm@profileMatrix), as.data.frame(peaks_bed$siteSeqs)$x)
However this results in a many NaN values....
sum(af=='NaN')/length(af)
[1] 0.4785195
I was advised that tRap is used on long sequences rather than short ones so I extended the sequences:
start(peaks_bed) <- start(peaks_bed) - 30
end(peaks_bed) <- end(peaks_bed) + 30
extended_seqs <- getSeq(Mmusculus, peaks_bed)
af_ext=affinity(normalize.pwm(pwm@profileMatrix),as.data.frame(extended_seqs)$x)
However this results in 100% NaNs....
I'm wondering if I am doing something wrong?
See below, it's mostly just missing rdoxygen2 docstrings:
* checking for missing documentation entries ... WARNING
Undocumented code objects:
‘exactgevparams’ ‘jaspar’ ‘R_affinity_multi’ ‘R_affinity_sum_multi’
Undocumented data sets:
‘exactgevparams’ ‘jaspar’
All user-level objects in a package should have documentation entries.
See the chapter ‘Writing R documentation files’ in the ‘Writing R
Extensions’ manual.
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... WARNING
Undocumented arguments in documentation object 'get.affinity.cutoff'
‘cutoff’
Documented arguments not in \usage in documentation object 'get.affinity.cutoff':
‘pvalue.cutoff’
Documented arguments not in \usage in documentation object 'read.transfac':
‘dir’
Functions with \usage entries need to have the appropriate \alias
entries, and all their arguments documented.
The \usage entries must correspond to syntactically valid R code.
See the chapter ‘Writing R documentation files’ in the ‘Writing R
Extensions’ manual.
* checking Rd contents ... WARNING
Argument items with no description in Rd object 'evaluate.ranking':
‘ranking’ ‘seq.name2matrix’ ‘roc.plot’ ‘add’ ‘col’ ‘predictors’
Argument items with no description in Rd object 'local.paffinity':
‘affnt’ ‘pwm’ ‘seq’ ‘Rmax’ ‘lambda’ ‘pseudo.count’ ‘gc.content’
‘window.size’ ‘window.offset’
Currently we include a copy of the JASPAR database inside the data/ directory. It would be nice to remove this and just rely on the JASPAR2014 R package, so that we don't have to update it ourselves.
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.