count_reads: Get read counts from fastqs

Description Usage Arguments Details Value Author(s) Examples

View source: R/count_reads.R

Description

Given a list of fastq files, return an array of read counts.

Usage

1
count_reads(inFiles, verbose = TRUE)

Arguments

inFiles

Character - List of fastqs

verbose

Logical - whether to print progress / results

Details

If you use (unzipped!) fastqs, this function will call wc -l through the command line to get the number of reads in the file, and then divide by 4 to get the read count (fastqs include 4 lines for each read). TIME: About 1.5s / GB, if you look at the fastq file sizes. That's on Smintheus. Roughly 30s per GB, on yasuimac.

Value

Numeric vector? - Read count for each input file

Author(s)

Emma Myers

Examples

1
2
3
4
5
fastqFiles = list.files("NucSeq/trimmed", pattern=".fastq")
readCounts = count_reads(paste("NucSeq/trimmed/", fastqFiles, sep=""))
pdf("NucSeq_reads_per_sample_trimmed.pdf")
barplot(readCounts/1000000, las=2, main="Nuc-seq reads per sample (trimmed files)", cex.names = 0.5, names.arg=gsub("_trimmed_m20_q20.fastq", "", fastqFiles), ylab="Millions")
dev.off()

e-myers/rnaseq documentation built on May 20, 2019, 9:14 p.m.