Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Treutler/DiffLogo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: mgledi/DiffLogo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing with 3,138 additions and 499 deletions.
  1. +23 −12 DESCRIPTION
  2. +41 −0 NAMESPACE
  3. +37 −22 R/alphabet.R
  4. +6 −6 R/baseDistrs.R
  5. +365 −143 R/diffSeqLogo.R
  6. +321 −0 R/diffSeqLogoSupport.R
  7. +19 −9 R/preconditions.R
  8. +514 −0 R/pwmAlignment.R
  9. +10 −8 R/seqLogo.R
  10. +12 −12 R/stackHeights.R
  11. +285 −13 R/utilities.R
  12. +18 −0 inst/CITATION
  13. +0 −1 inst/extdata/alignments/F-box_bacteria.seq.fa
  14. +1 −1 inst/extdata/alignments/F-box_fungi.seq.fa
  15. +1 −1 inst/extdata/alignments/F-box_metazoa.seq.fa
  16. +1 −1 inst/extdata/alignments/Mad.txt
  17. +21 −0 inst/extdata/homer/CTCF_SatelliteElement_Zf_CD4.motif
  18. +21 −0 inst/extdata/homer/CTCF_Zf_CD4.motif
  19. +13 −0 inst/extdata/homer/Max.motif
  20. +9 −0 inst/extdata/homer/c-Myc.motif
  21. +4 −0 inst/extdata/pfm/ctcf_jaspar.pfm
  22. 0 inst/extdata/pwm/{GM12878.txt → GM12878.pwm}
  23. 0 inst/extdata/pwm/{H1-hESC.txt → H1-hESC.pwm}
  24. 0 inst/extdata/pwm/{HUVEC.txt → HUVEC.pwm}
  25. 0 inst/extdata/pwm/{HeLa-S3.txt → HeLa-S3.pwm}
  26. 0 inst/extdata/pwm/{HepG2.txt → HepG2.pwm}
  27. 0 inst/extdata/pwm/{K562.txt → K562.pwm}
  28. 0 inst/extdata/pwm/{MCF7.txt → MCF7.pwm}
  29. 0 inst/extdata/pwm/{NHEK.txt → NHEK.pwm}
  30. 0 inst/extdata/pwm/{ProgFib.txt → ProgFib.pwm}
  31. +7 −16 man/ASN.Rd
  32. +12 −9 man/Alphabet.Rd
  33. +7 −15 man/DNA.Rd
  34. +20 −0 man/FULL_ALPHABET.Rd
  35. +9 −9 man/RNA.Rd
  36. +29 −0 man/alignPwmSets.Rd
  37. +22 −0 man/baseDistributionPwm.Rd
  38. +43 −0 man/calculatePvalue.Rd
  39. +37 −17 man/createDiffLogoObject.Rd
  40. +20 −11 man/diffLogo.Rd
  41. +41 −19 man/diffLogoFromPwm.Rd
  42. +20 −30 man/diffLogoTable.Rd
  43. +60 −0 man/diffLogoTableConfiguration.Rd
  44. +11 −12 man/differenceOfICs.Rd
  45. +32 −0 man/drawDiffLogoTable.Rd
  46. +43 −0 man/enrichDiffLogoObjectWithPvalues.Rd
  47. +42 −0 man/enrichDiffLogoTableWithPvalues.Rd
  48. +35 −0 man/extendPwmsFromAlignmentVector.Rd
  49. +20 −0 man/getAlphabetFromCharacters.Rd
  50. +20 −0 man/getAlphabetFromSequences.Rd
  51. +11 −10 man/getPwmFromAlignment.Rd
  52. +24 −0 man/getPwmFromAlignmentFile.Rd
  53. +24 −0 man/getPwmFromFastaFile.Rd
  54. +23 −0 man/getPwmFromFile.Rd
  55. +22 −0 man/getPwmFromHomerFile.Rd
  56. +22 −0 man/getPwmFromPfmOrJasparFile.Rd
  57. +22 −0 man/getPwmFromPwmFile.Rd
  58. +22 −0 man/getSequencesFromAlignmentFile.Rd
  59. +22 −0 man/getSequencesFromFastaFile.Rd
  60. +9 −9 man/informationContent.Rd
  61. +35 −0 man/localPwmAlignment.Rd
  62. +11 −11 man/lossOfAbsICDifferences.Rd
  63. +41 −0 man/multipleLocalPwmsAlignment.Rd
  64. +21 −0 man/normalizePWM.Rd
  65. +11 −12 man/normalizedDifferenceOfProbabilities.Rd
  66. +37 −0 man/prepareDiffLogoTable.Rd
  67. +9 −9 man/probabilities.Rd
  68. +21 −0 man/pwmDivergence.Rd
  69. +38 −0 man/pwmsDistanceMatrix.Rd
  70. +22 −0 man/reverseAlignmentVector.Rd
  71. +25 −15 man/seqLogo.Rd
  72. +11 −11 man/shannonDivergence.Rd
  73. +11 −11 man/sumOfAbsICDifferences.Rd
  74. +11 −11 man/sumOfAbsProbabilityDifferences.Rd
  75. +9 −10 man/sumProbabilities.Rd
  76. +17 −0 man/switchDirection.Rd
  77. +30 −0 man/twoSetsAveragePwmDivergenceFromAlignmentVector.Rd
  78. +272 −0 tests/testthat/test_alignment.R
  79. +53 −23 vignettes/DiffLogoBasics.Rnw
35 changes: 23 additions & 12 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
Package: DiffLogo
Type: Package
Title: DiffLogo: A comparative visualisation of biooligomer motifs
Version: 0.99.2
Version: 2.13.1
Date: 2015-02-12
Author: c( person("Martin", "Nettling", role = c("aut", "cre"), email =
"martin.nettling@informatik.uni-halle.de"), person("Hendrik", "Treutler,
role = c("aut", "cre"),email="hendrik.treutler@ipb-halle.de"),
person("Jan", "Grau", role = c("aut", "ctb"),email=""), person("Jens",
"Keilwagen", role = c("aut", "ctb"),email=""), person("Stefan", "Posch",
role = "aut")) person("Ivo", "Grosse", role = "aut") )
Author: c(
person("Martin", "Nettling", role = c("aut", "cre"), email = "martin.nettling@informatik.uni-halle.de"),
person("Hendrik", "Treutler", role = c("aut", "cre"), email = "hendrik.treutler@ipb-halle.de"),
person("Jan", "Grau", role = c("aut", "ctb"), email = "grau@informatik.uni-halle.de"),
person("Andrey", "Lando", role = c("aut", "ctb"), email = "dronte@autosome.ru"),
person("Jens", "Keilwagen", role = c("aut", "ctb"), email = "jens.keilwagen@julius-kuehn.de"),
person("Stefan", "Posch", role = "aut", email = "posch@informatik.uni-halle.de"),
person("Ivo", "Grosse", role = "aut", email = "grosse@informatik.uni-halle.de"))
Depends:
R (>= 1.8.0),
R (>= 3.4),
stats,
cba
Imports:
grDevices,
graphics,
utils,
tools
Suggests:
knitr,
testthat
VignetteBuilder: knitr
Maintainer: Martin Nettling<martin.nettling@informatik.uni-halle.de>
testthat,
seqLogo,
MotifDb
Maintainer: Hendrik Treutler<hendrik.treutler@gmail.com>
Description: DiffLogo is an easy-to-use tool to visualize motif differences.
License: GPL (>= 2)
URL: https://github.com/mgledi/DiffLogo/
BugReports: https://github.com/mgledi/DiffLogo/issues
biocViews: Software, SequenceMatching, MultipleComparison, MotifAnnotation,
Visualization
Visualization, Alignment
Collate:
'alphabet.R'
'baseDistrs.R'
@@ -32,3 +40,6 @@ Collate:
'seqLogo.R'
'stackHeights.R'
'utilities.R'
'diffSeqLogoSupport.R'
'pwmAlignment.R'
RoxygenNote: 6.1.1
41 changes: 41 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,17 +1,40 @@
# Generated by roxygen2: do not edit by hand

export(ASN)
export(Alphabet)
export(DNA)
export(FULL_ALPHABET)
export(RNA)
export(calculatePvalue)
export(createDiffLogoObject)
export(diffLogo)
export(diffLogoFromPwm)
export(diffLogoTable)
export(diffLogoTableConfiguration)
export(differenceOfICs)
export(drawDiffLogoTable)
export(enrichDiffLogoObjectWithPvalues)
export(enrichDiffLogoTableWithPvalues)
export(extendPwmsFromAlignmentVector)
export(getAlphabetFromCharacters)
export(getAlphabetFromSequences)
export(getPwmFromAlignment)
export(getPwmFromAlignmentFile)
export(getPwmFromFastaFile)
export(getPwmFromFile)
export(getPwmFromHomerFile)
export(getPwmFromPfmOrJasparFile)
export(getPwmFromPwmFile)
export(getSequencesFromAlignmentFile)
export(getSequencesFromFastaFile)
export(informationContent)
export(lossOfAbsICDifferences)
export(multipleLocalPwmsAlignment)
export(normalizePWM)
export(normalizedDifferenceOfProbabilities)
export(prepareDiffLogoTable)
export(probabilities)
export(pwmDivergence)
export(seqLogo)
export(shannonDivergence)
export(sumOfAbsICDifferences)
@@ -20,3 +43,21 @@ export(sumProbabilities)
exportClasses(Alphabet)
exportClasses(DiffLogo)
importFrom(cba,order.optimal)
importFrom(grDevices,colorRampPalette)
importFrom(grDevices,rgb)
importFrom(graphics,abline)
importFrom(graphics,axis)
importFrom(graphics,legend)
importFrom(graphics,lines)
importFrom(graphics,par)
importFrom(graphics,plot)
importFrom(graphics,plot.new)
importFrom(graphics,polygon)
importFrom(graphics,rect)
importFrom(graphics,text)
importFrom(stats,dgamma)
importFrom(stats,dist)
importFrom(stats,hclust)
importFrom(stats,var)
importFrom(utils,modifyList)
importFrom(utils,read.delim)
59 changes: 37 additions & 22 deletions R/alphabet.R
Original file line number Diff line number Diff line change
@@ -15,15 +15,16 @@ Letter = function(x,y) {
##' @title built alphabet
##' @param chars set of symbols
##' @param cols set of colors; one for each symbol
##' @param supportReverseComplement boolean whether the alphabet supports reverse complementation (like DNA/RNA) or not (like ASN)
##' @return the Alphabet object
##' @export
##' @exportClass Alphabet
##' @author Martin Nettling
##' @examples
##' DNA = Alphabet(c("A","C","G","T"),c("green4","blue","orange","red"))
Alphabet = function(chars,cols) {
obj = list(chars=chars,cols=cols,size=length(chars))
class(obj)="Alphabet"
##' DNA = Alphabet(c("A","C","G","T"),c("green4","blue","orange","red"),TRUE)
Alphabet = function(chars, cols, supportReverseComplement) {
obj = list(chars=chars,cols=cols,size=length(chars),supportReverseComplement = supportReverseComplement);
class(obj)="Alphabet";
return(obj);
}

@@ -221,21 +222,26 @@ if(FALSE){
##' @title DNA alphabet
##' @export
##' @author Martin Nettling
##' @examples
##' motif_folder= "extdata/pwm"
##' motif_name = "HepG2"
##' fileName = paste(motif_folder,"/",motif_name,".txt",sep="")
##' file = system.file(fileName, package = "DiffLogo")
##' motif = as.matrix(read.delim(file,header=FALSE))
##' seqLogo(pwm = motif, alphabet=DNA)
DNA = Alphabet(c("A","C","G","T"),c("green4","blue","orange","red"));
##' @examples
##' DNA
DNA = Alphabet(
c("A","C","G","T"),
c("green4","blue","orange","red"),
TRUE
);

##' the RNA alphabet, i.e. A, C, G, U
##'
##' @title RNA alphabet
##' @export
##' @author Martin Nettling
RNA = Alphabet(c("A","C","G","U"),c("green4","blue","orange","red"));
##' @examples
##' RNA
RNA = Alphabet(
c("A","C","G","U"),
c("green4","blue","orange","red"),
TRUE
);

c1="Light green"; c2="Green"; c3="Dark green"; c4="Blue"; c5="violet"; c6="DarkBlue"; c7="Orange"; c8="Pink"; c9="Red";

@@ -244,14 +250,23 @@ c1="Light green"; c2="Green"; c3="Dark green"; c4="Blue"; c5="violet"; c6="DarkB
##' @title ASN alphabet
##' @export
##' @author Martin Nettling
##' @examples
##' motif_folder= "extdata/alignments"
##' motif_name = "calamodulin_1"
##' fileName = paste(motif_folder,"/",motif_name,".txt",sep="")
##' file = system.file(fileName, package = "DiffLogo")
##' motif = getPwmFromAlignment(readLines(file), ASN, 1)
##' seqLogo(pwm = motif, alphabet=ASN)
##' @examples
##' ASN
ASN = Alphabet(
c("A","C","D","E","F","G","H","I","K","L","M","N","P","Q","R","S","T","V","W","Y"),
c(c1, c2 ,c3, c3, c5, c1, c6, c4, c7, c4, c4, c3, c8, c3, c7, c9, c9, c4, c5, c5)
)
c(c1, c2 ,c3, c3, c5, c1, c6, c4, c7, c4, c4, c3, c8, c3, c7, c9, c9, c4, c5, c5),
FALSE
);

##' the alphabet of all 26 characters
##'
##' @title Complete character alphabet
##' @export
##' @author Hendrik Treutler
##' @examples
##' FULL_ALPHABET
FULL_ALPHABET = Alphabet(
c("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"),
c(c1, c2 ,c3, c4, c5, c6, c7, c8, c1, c2, c3, c4, c5, c6, c7, c8, c1, c2, c3, c4, c5, c6, c7, c8, c1, c2),
FALSE
);
12 changes: 6 additions & 6 deletions R/baseDistrs.R
Original file line number Diff line number Diff line change
@@ -12,9 +12,9 @@
##' motif_names = c("HepG2","MCF7","HUVEC","ProgFib")
##' motifs = list()
##' for (name in motif_names) {
##' fileName = paste(motif_folder,"/",name,".txt",sep="")
##' fileName = paste(motif_folder,"/",name,".pwm",sep="")
##' file = system.file(fileName, package = "DiffLogo")
##' motifs[[name]] = as.matrix(read.delim(file,header=FALSE))
##' motifs[[name]] = getPwmFromPwmFile(file)
##' }
##'
##' pwm1 = motifs[[motif_names[[1]]]]
@@ -43,9 +43,9 @@ normalizedDifferenceOfProbabilities = function(p1,p2) {
##' motif_names = c("HepG2","MCF7","HUVEC","ProgFib")
##' motifs = list()
##' for (name in motif_names) {
##' fileName = paste(motif_folder,"/",name,".txt",sep="")
##' fileName = paste(motif_folder,"/",name,".pwm",sep="")
##' file = system.file(fileName, package = "DiffLogo")
##' motifs[[name]] = as.matrix(read.delim(file,header=FALSE))
##' motifs[[name]] = getPwmFromPwmFile(file)
##' }
##'
##' pwm1 = motifs[[motif_names[[1]]]]
@@ -75,9 +75,9 @@ differenceOfICs = function(p1,p2) {
##' @examples
##' motif_folder= "extdata/pwm"
##' motif_name = "HepG2"
##' fileName = paste(motif_folder,"/",motif_name,".txt",sep="")
##' fileName = paste(motif_folder,"/",motif_name,".pwm",sep="")
##' file = system.file(fileName, package = "DiffLogo")
##' motif = as.matrix(read.delim(file,header=FALSE))
##' motif = getPwmFromPwmFile(file)
##' seqLogo(pwm = motif, baseDistribution = probabilities)
probabilities = function(p) {
return(p);
Loading