Skip to content

Commit

Permalink
snpgdsBED2GDS() allows a single file name
Browse files Browse the repository at this point in the history
without the extended file names (.bed, .fam, .bim)
  • Loading branch information
zhengxwen committed Jan 1, 2019
1 parent 277cdb8 commit 3b70897
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Package: SNPRelate
Type: Package
Title: Parallel Computing Toolset for Relatedness and Principal Component
Analysis of SNP Data
Version: 1.17.1
Date: 2018-12-20
Version: 1.17.2
Date: 2019-01-01
Depends: R (>= 2.15), gdsfmt (>= 1.8.3)
LinkingTo: gdsfmt
Imports: methods
Expand Down
5 changes: 3 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
CHANGES IN VERSION 1.17.1
CHANGES IN VERSION 1.17.1-1.17.2
-------------------------

o
o `snpgdsBED2GDS()` allows a single file name without the extended file
names (.bed, .fam, .bim)


CHANGES IN VERSION 1.16.0
Expand Down
7 changes: 7 additions & 0 deletions R/Conversion.R
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,13 @@ snpgdsBED2GDS <- function(bed.fn, fam.fn, bim.fn, out.gdsfn, family=FALSE,
{
# check
stopifnot(is.character(bed.fn), length(bed.fn)==1L)
if (missing(fam.fn) && missing(bim.fn))
{
fn <- gsub("\\.bed$", "", bed.fn, ignore.case=TRUE)
bed.fn <- paste(fn, ".bed", sep="")
fam.fn <- paste(fn, ".fam", sep="")
bim.fn <- paste(fn, ".bim", sep="")
}
stopifnot(is.character(fam.fn), length(fam.fn)==1L)
stopifnot(is.character(bim.fn), length(bim.fn)==1L)
stopifnot(is.character(out.gdsfn), length(out.gdsfn)==1L)
Expand Down
7 changes: 4 additions & 3 deletions man/snpgdsBED2GDS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ snpgdsBED2GDS(bed.fn, fam.fn, bim.fn, out.gdsfn, family=FALSE,
}
\arguments{
\item{bed.fn}{the file name of binary file, genotype information}
\item{fam.fn}{the file name of first six columns of \code{".ped"}}
\item{bim.fn}{the file name of extended MAP file:
two extra columns = allele names}
\item{fam.fn}{the file name of first six columns of \code{".ped"}; if it is
missing, }
\item{bim.fn}{the file name of extended MAP file: two extra columns =
allele names; if it is missing, }
\item{out.gdsfn}{the output GDS file}
\item{family}{if \code{TRUE}, to include family information in the
sample annotation}
Expand Down

0 comments on commit 3b70897

Please sign in to comment.