Mercurial > repos > bgruening > diffbind
comparison diffbind.R @ 15:194e3f2c1d86 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/diffbind commit 515da67fc6c289aa7ea75a0819b5da3a902f87a2
| author | iuc |
|---|---|
| date | Tue, 09 Jul 2019 18:46:09 -0400 |
| parents | 1de83981d43c |
| children | 163688bb8f73 |
comparison
equal
deleted
inserted
replaced
| 14:c97a786e8fb5 | 15:194e3f2c1d86 |
|---|---|
| 55 sampleTable <- data.frame(SampleID=samples, | 55 sampleTable <- data.frame(SampleID=samples, |
| 56 Condition=groups, | 56 Condition=groups, |
| 57 bamReads=bams, | 57 bamReads=bams, |
| 58 bamControl=ctrls, | 58 bamControl=ctrls, |
| 59 Peaks=peaks, | 59 Peaks=peaks, |
| 60 Tissue=samples, # using "Tissue" column to display ids as labels in PCA plot | 60 Tissue=samples) # using "Tissue" column to display ids as labels in PCA plot |
| 61 stringsAsFactors=FALSE) | |
| 62 } else { | 61 } else { |
| 62 | |
| 63 sampleTable <- data.frame(SampleID=samples, | 63 sampleTable <- data.frame(SampleID=samples, |
| 64 Replicate=samples, | 64 Replicate=samples, |
| 65 Condition=groups, | 65 Condition=groups, |
| 66 bamReads=bams, | 66 bamReads=bams, |
| 67 Peaks=peaks, | 67 Peaks=peaks, |
| 68 Tissue=samples, | 68 Tissue=samples) |
| 69 stringsAsFactors=FALSE) | |
| 70 } | 69 } |
| 71 | 70 |
| 72 sample = dba(sampleSheet=sampleTable, peakFormat='bed', scoreCol=opt$scorecol, bLowerScoreBetter=opt$lowerbetter) | 71 sample = dba(sampleSheet=sampleTable, peakFormat='bed', scoreCol=opt$scorecol, bLowerScoreBetter=opt$lowerbetter) |
| 73 | 72 |
| 74 if ( !is.null(opt$summits) ) { | 73 if ( !is.null(opt$summits) ) { |
| 124 Name=rep("DiffBind", length(resSorted)), | 123 Name=rep("DiffBind", length(resSorted)), |
| 125 Score=rep("0", length(resSorted)), | 124 Score=rep("0", length(resSorted)), |
| 126 Strand=gsub("\\*", ".", strand(resSorted)), | 125 Strand=gsub("\\*", ".", strand(resSorted)), |
| 127 mcols(resSorted)) | 126 mcols(resSorted)) |
| 128 } | 127 } |
| 129 write.table(resSorted, file = opt$outfile, sep="\t", quote = FALSE, append=TRUE, row.names = FALSE) | 128 write.table(resSorted, file = opt$outfile, sep="\t", quote = FALSE, row.names = FALSE) |
| 130 | 129 |
| 131 # Output binding affinity scores | 130 # Output binding affinity scores |
| 132 if (!is.null(opt$bmatrix)) { | 131 if (!is.null(opt$bmatrix)) { |
| 133 bmat <- dba.peakset(sample_count, bRetrieve=TRUE, DataType=DBA_DATA_FRAME) | 132 bmat <- dba.peakset(sample_count, bRetrieve=TRUE, DataType=DBA_DATA_FRAME) |
| 134 # Output as 0-based tabular | 133 # Output as 0-based tabular |
