How to do it...

Complete read-to-reference alignment with external programs using the following steps:

  1. Set up the files and executable paths:
bwa <- "/Users/macleand/miniconda2/bin/bwa"
samtools <- "/Users/macleand/miniconda2/bin/samtools"
reference <- file.path(getwd(), "datasets", "ch8", "ecoli_genome.fa")
  1. Prepare the index command and run:
command <- paste(bwa, "index", reference)
system(command, wait = TRUE)
  1. Prepare the alignment command and run:
reads <- file.path(getwd(), "datasets", "ch8", "ERR019653.fastq.gz")
output <- file.path(getwd(), "datasets", "ch8", "aln.bam")
command <- paste(bwa, "mem", reference, reads, "|", samtools, "view -S -b >", output)
system(command, wait = TRUE)
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.216.71