Entering edit mode
6.9 years ago
rbronste
▴
420
I am trying to export DESeq2 results that fall under a certain padj in the following way:
resFemEB<-results(dds, lfcThreshold=2, altHypothesis="greater", alpha = .1, format = c("GRanges"), independentFiltering=FALSE, contrast=c(1, -1/3, -1/3, -1/3))
resOrderedFemEB <- resFemEB[which(resFemEB$padj < 0.1),]
df <- data.frame(seqnames=seqnames(resOrderedFemEB),
+ starts=start(resOrderedFemEB)-1,
+ ends=end(resOrderedFemEB),
+ names=c(rep(".", length(resOrderedFemEB))),
+ scores=c(rep(".", length(resOrderedFemEB))),
+ strands=strand(resOrderedFemEB))
> write.table(df, file="resOrderedFemEB.bed", quote=F, sep="\t", row.names=F, col.names=F)
This works well for getting all of the results in a BED format that fall below a certain padj, what I wanted to ask is how I can just get the top 1000 exported (currently the list is around 10K that falls within that padj criteria)?
Exactly what I was after, thanks!