[Bioc-devel] Help with GWASTools
Qian Liu
qliu7 at buffalo.edu
Mon Feb 12 20:41:59 CET 2018
Hi,
Try the following. Just print "bed.fn" to see if they are imported
correctly. And use "snpgdsBED2GDS(... verbose=TRUE)" to print more
detailed information or error log.
Qian Liu
Bioconductor Core Team
Roswell Park Cancer Institute
library(SNPRelate)
(bed.fn <- system.file("extdata", "plinkhapmap.bed.gz",
package="SNPRelate"))
[1]
"/home/qian/R/x86_64-pc-linux-gnu-library/3.5-bioc-3.7/SNPRelate/extdata/plinkhapmap.bed.gz"
(fam.fn <- system.file("extdata", "plinkhapmap.fam.gz",
package="SNPRelate"))
[1]
"/home/qian/R/x86_64-pc-linux-gnu-library/3.5-bioc-3.7/SNPRelate/extdata/plinkhapmap.fam.gz"
(bim.fn <- system.file("extdata", "plinkhapmap.bim.gz",
package="SNPRelate"))
[1]
"/home/qian/R/x86_64-pc-linux-gnu-library/3.5-bioc-3.7/SNPRelate/extdata/plinkhapmap.bim.gz"
gdsfile <- "snps.gds"
snpgdsBED2GDS(bed.fn, fam.fn, bim.fn, gdsfile, cvt.chr="int",
cvt.snpid="int", verbose=TRUE)
Start snpgdsBED2GDS ...
BED file:
"/home/qian/R/x86_64-pc-linux-gnu-library/3.5-bioc-3.7/SNPRelate/extdata/plinkhapmap.bed.gz"
in the SNP-major mode (Sample X SNP)
FAM file:
"/home/qian/R/x86_64-pc-linux-gnu-library/3.5-bioc-3.7/SNPRelate/extdata/plinkhapmap.fam.gz",
DONE.
BIM file:
"/home/qian/R/x86_64-pc-linux-gnu-library/3.5-bioc-3.7/SNPRelate/extdata/plinkhapmap.bim.gz",
DONE.
Mon Feb 12 14:37:07 2018 store sample id, snp id, position, and
chromosome.
start writing: 60 samples, 5000 SNPs ...
Mon Feb 12 14:37:07 2018 0%
Mon Feb 12 14:37:07 2018 100%
Mon Feb 12 14:37:07 2018 Done.
Optimize the access efficiency ...
Clean up the fragments of GDS file:
open the file 'snps.gds' (100.6K)
# of fragments: 42
save to 'snps.gds.tmp'
rename 'snps.gds.tmp' (100.3K, reduced: 264B)
# of fragments: 20
f <- openfn.gds(gdsfile)
f
File: /home/qian/snps.gds (100.3K)
+ [ ] *
|--+ sample.id { Str8 60 LZMA_ra(53.8%), 265B }
|--+ snp.id { Int32 5000 LZMA_ra(11.7%), 2.3K }
|--+ snp.rs.id { Int32 5000 LZMA_ra(20.8%), 4.1K }
|--+ snp.position { Int32 5000 LZMA_ra(78.5%), 15.3K }
|--+ snp.chromosome { UInt8 5000 LZMA_ra(3.00%), 157B } *
|--+ snp.allele { Str8 5000 LZMA_ra(13.8%), 2.7K }
|--+ genotype { Bit2 60x5000, 73.2K } *
\--+ sample.annot [ data.frame ] *
|--+ sex { Str8 60 LZMA_ra(136.7%), 89B }
\--+ phenotype { Int32 60 LZMA_ra(37.5%), 97B }
closefn.gds(f)
On Thu, Feb 8, 2018 at 12:19 PM, Dharia, Priyadarshani P <
Dharia.Priyadarshani at uth.tmc.edu> wrote:
> Hi,
>
> I am a graduate student at University of Texas School of Public health,
> and I am using GWASTools for the first time. I am trying to upload PLINK
> files to use, but I am getting an error which I cannot understand. I would
> appreciate if you could help me with the same.
>
>
> Code:
>
> bed.fn <- system.file("C:/Users/PLINK/tissue_all1", "plinkhapmap.bed.gz",
> package = "SNPRelate")
> fam.fn <- system.file("C:/Users/PLINK/tissue_all1", "plinkhapmap.fam.gz",
> package = "SNPRelate")
> bim.fn <- system.file("C:/Users/PLINK/tissue_all1", "plinkhapmap.bim.gz",
> package = "SNPRelate")
> gdsfile <-"snps.gds"
> snpgdsBED2GDS(bed.fn, fam.fn, bim.fn, gdsfile, cvt.chr="int",
> cvt.snpid="int", verbose=FALSE)
>
>
> Error:
>
> Error in (function (con, what, n = 1L, size = NA_integer_, signed = TRUE,
> :
> can only read from a binary connection
> In addition: Warning message:
> In file(filename, "rb") :
> file("") only supports open = "w+" and open = "w+b": using the former
>
>
>
> Thank you for all your help.
>
>
> Sincerely,
> PD
> PhD Candidate
> University of Texas at Houston
> School of Public Health
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>
[[alternative HTML version deleted]]
More information about the Bioc-devel
mailing list