R/vcfToBed.R

vcfToBed <- function( vcfFiles ){

	outnames <- paste0(basename(removeext(vcfFiles)),".bed")

  cmdString<-paste(
		"grep -Pv '^#'",
		vcfFiles,
		"| awk '{print $1,$2-1,$2}' OFS='\t'",
		">",
		outnames
	)

	for(i in 1:length(vcfFiles)){
		print(cmdString[i])
		system(cmdString[i])
	}

	return(outnames)
}
dvera/converge documentation built on May 15, 2019, 6:17 p.m.