bam2fastq | R Documentation |
Convert either paired or unpaired Bam file into fastq files.
bam2fastq(bamFn, OUTPUT_PER_RG=TRUE, OUTPUT_DIR=".", paired=FALSE,
fastqFns=sub("(\.bam|\.sam)$", "fastq", bamFn),
fastq2Fns=sub("(\.bam|\.sam)$", "_R2.fastq", bamFn)
)
bamFn |
|
OUTPUT_PER_RG |
|
OUTPUT_DIR |
|
fastqFns |
|
fastq2Fns |
|
paired |
|
The conversion is done with picard's SamToFastq.
Rsamtools::testPairedEndBam cannot be used to test for paired or not.
It doesn't work on Bam converted from fastq, due to the lack of header.
paired
has to be specified explicitly.
invisible filenames of first read files.
Ge Tan
fastqs2bam
## Not run:
bamFn <- "/srv/gstore/projects/p2497/HiSeq4000_20171222_RUN420_o3705_fixedRG/20171222.A-SiCSeq_SCs_P5_unmapped.bam"
bamFn <- "/scratch/gtan/p2497-SCCountQC/20171222.A-SiCSeq_SCs_P5_subset.bam"
## Split into one Fastq
fastqFn <- bam2fastq(bamFn, fastqFns=sub("\\.bam$", ".fastq", basename(bamFn)),
paired=FALSE)
## Split by RG
fastqFn <- bam2fastq(bamFn, OUTPUT_PER_RG=TRUE, OUTPUT_DIR=".", paired=FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.