Commit d022bc3e authored by Holger Brandl's avatar Holger Brandl

cosmetics

parent ac418c05
......@@ -16,6 +16,14 @@ read.fasta <- function(fileName){
return(fastaDataDF)
}
write.fasta <- function(seq_names, sequences, file){
fastaData <- AAStringSet(sequences)
names(fastaData) <- seq_names;
writeXStringSet(fastaData, file=file, format="fasta", width=80)
}
getSeqLengthFromFasta <- function(fileName){
assembly <- mutate(read.fasta(fileName), seq_len=nchar(Sequence))
assembly$Sequence = NULL
......@@ -23,9 +31,21 @@ getSeqLengthFromFasta <- function(fileName){
}
write.fasta <- function(seq_names, sequences, file){
fastaData <- AAStringSet(sequences)
names(fastaData) <- seq_names;
writeXStringSet(fastaData, file=file, format="fasta", width=80)
## necessary to disable scientific number formats for long integers
options(scipen=100)
## writes a table in bed format expecting columns being ordered according to bed spec already
write.bed <- function(bedData, file){
write.table(bedData, file=file, quote=FALSE, sep ="\t", na="NA", row.names=FALSE, col.names=FALSE)
}
#write.bed <- function(bedData, file){
# oldScipen<-getOption("scipen")
#
# ## necessary to disable scientific number formats for long integers
# options(scipen=100)
#
# write.table(bedData, file=file, quote=FALSE, sep ="\t", na="NA", row.names=FALSE, col.names=FALSE)
#
# options(oldScipen)
#}
......@@ -198,15 +198,6 @@ write.delim <- function(df, file, header=TRUE,...){
write.table(df, file, row.names=FALSE, col.names=header, sep="\t", ...)
}
## writes a table in bed format expecting columns being ordered according to bed spec already
write.bed <- function(bedData, file){
write.table(bedData, file=file, quote=FALSE, sep ="\t", na="NA", row.names=FALSE, col.names=FALSE)
}
#options(scipen=100) ## necessary to disable scientific number formats for long integers
rmSomeElements <- function(vec, toDel) vec[!(vec %in% toDel)]
rmLastElement <- function(vec) vec[-length(vec)]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment