Skip to content

Commit

Permalink
fix read.table() skipping many rows
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadim Nazarov committed Jul 29, 2015
1 parent 95620e5 commit 3b00243
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Package: tcR
Type: Package
Title: Advanced Data Analysis of T Cell Receptor Repertoires
Version: 2.1
Version: 2.1.1
Date: 2015-07-28
Author: Vadim Nazarov
Maintainer: Vadim Nazarov <vdm.nazarov@gmail.com>
Description: Platform for the advanced analysis of T cell receptor repertoires data and visualisation of the analysis results.
License: Apache License 2.0
Depends: R (>= 2.15.1), ggplot2 (>= 1.0.0), dplyr (>= 0.4.0), gridExtra (>= 0.9.0), reshape2 (>= 1.2.0), igraph (>= 0.7.1)
Imports: utils (>= 3.1.0), Rcpp (>= 0.11.1), grid (>= 3.0.0), data.table (>= 1.9.0), gtable (>= 0.1.2), roxygen2 (>= 3.0.0), stringdist (>= 0.7.3)
Depends: R (>= 2.15.1), ggplot2 (>= 1.0.0), dplyr (>= 0.4.0), gridExtra (>= 2.0.0), reshape2 (>= 1.2.0), igraph (>= 0.7.1)
Imports: utils (>= 3.1.0), Rcpp (>= 0.11.1), grid (>= 3.1.2), data.table (>= 1.9.0), gtable (>= 0.1.2), roxygen2 (>= 3.0.0), stringdist (>= 0.7.3)
Suggests: knitr (>= 1.8)
LinkingTo: Rcpp
URL: http://imminfo.github.io/tcr/
Expand Down
8 changes: 4 additions & 4 deletions R/input.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ parse.cloneset <- function (.filename,
}
close(f)

table.colnames <- make.names(read.table(gzfile(.filename), sep = .sep, skip = .skip, nrows = 1, stringsAsFactors = F, strip.white = T, comment.char = "")[1,])
table.colnames <- make.names(read.table(gzfile(.filename), sep = .sep, skip = .skip, nrows = 1, stringsAsFactors = F, strip.white = T, comment.char = "", fill = T, quote = '')[1,])

swlist <- list('character', 'character',
'integer', 'integer',
Expand All @@ -105,7 +105,7 @@ parse.cloneset <- function (.filename,
do.call(switch, c(x, swlist))
}, USE.NAMES = F))

suppressWarnings(df <- read.table(file = gzfile(.filename), header = T, colClasses = col.classes, sep = .sep, skip = .skip, strip.white = T, comment.char = ""))
suppressWarnings(df <- read.table(file = gzfile(.filename), header = T, colClasses = col.classes, sep = .sep, skip = .skip, strip.white = T, fill = T, comment.char = "", quote = ''))

df$Read.proportion <- df[, make.names(.reads)] / sum(df[, make.names(.reads)])
.read.prop <- 'Read.proportion'
Expand Down Expand Up @@ -565,7 +565,7 @@ parse.mixcr <- function (.filename) {
.dj.insertions <- "DJ.insertions"
.total.insertions <- "Total.insertions"

table.colnames <- tolower(make.names(read.table(gzfile(.filename), sep = .sep, skip = 0, nrows = 1, stringsAsFactors = F, strip.white = T, comment.char = "")[1,]))
table.colnames <- tolower(make.names(read.table(gzfile(.filename), sep = .sep, skip = 0, nrows = 1, stringsAsFactors = F, strip.white = T, comment.char = "", quote = '')[1,]))

if ('all.v.hits' %in% table.colnames) {
.vgenes <- 'all.v.hits'
Expand Down Expand Up @@ -607,7 +607,7 @@ parse.mixcr <- function (.filename) {
do.call(switch, c(x, swlist))
}, USE.NAMES = F))

suppressWarnings(df <- read.table(file = gzfile(.filename), header = T, colClasses = col.classes, sep = .sep, skip = 0, strip.white = T, comment.char = "", fill = T))
suppressWarnings(df <- read.table(file = gzfile(.filename), header = T, colClasses = col.classes, sep = .sep, skip = 0, strip.white = T, comment.char = "", fill = T, quote = ''))
names(df) <- tolower(names(df))

df$Read.proportion <- df[, make.names(.reads)] / sum(df[, make.names(.reads)])
Expand Down

0 comments on commit 3b00243

Please sign in to comment.