Popgenome R package
2
0
Entering edit mode
6.5 years ago
yp ▴ 10

Hello,

I would like to use Popgenome R package to calculate diversity stats. I have a SNP data in the HapMap format. I used following R code to upload hap map file, but getting an error. The GFF file is in the same folder.

GENOME.class<-readHapMap("popgenome/test_631.hmp",populations=FALSE,outgroup=FALSE,gffpath="test_631.gff")

Error in readHapMap("popgenome/test_631.hmp", populations = FALSE, outgroup = FALSE, : unused argument (gffpath = "test_631.gff")

Do I need to use to tabix index file for hapmap and gff file?

Thanks, yp

SNP popgenome hapmap • 3.9k views
ADD COMMENT
0
Entering edit mode
6.5 years ago
goodez ▴ 640

I checked the documentation and there is no gffpath argument. Instead use hap_gffpath

Here is the docs for PopGenome if it helps: PopGenome

ADD COMMENT
0
Entering edit mode
6.5 years ago
yp ▴ 10

Thanks for your reply.

I changed it to hap_gffpath, but it didn't work.

GENOME.class <- readHapMap("popgenome/",hap_gffpath="popgenome/",populations=FALSE,outgroup=FALSE)

Error in if (file == "") file <- stdin() else { : missing value where TRUE/FALSE needed

Could you please share an example hapmap file and codes?

Thanks, yp

ADD COMMENT
0
Entering edit mode

No problem. Next time just add a comment to my answer though, rather than a separate answer.

Can you post the results of list.files("popgenome/")

ADD REPLY
0
Entering edit mode

it is printing 0.

list.files("popgenome/") character(0)

ADD REPLY
1
Entering edit mode

I'm assuming you have a folder somewhere called "popgenome" which contains the relevant files?

You need to use setwd(path/to/folder/above/popgenome). Don't set it to "popgenome", but set it to the folder which contains "popgenome".

ADD REPLY
0
Entering edit mode

Yes, I have a popgenome folder, which has all the relevant files. I am setting the path to one level above.

Now, I moved HapMap and gff file to a separate folder- "hapmap/". list.file command is printing the file names

list.files("hapmap/") [1] "test_631.gff" "test_631.hmp"

Then, I use following code. But still not working.

GENOME.class <- readHapMap("hapmap/",hap_gffpath="hapmap/",populations=FALSE,outgroup=FALSE)

Error in if (file == "") file <- stdin() else { : missing value where TRUE/FALSE needed

Do you have an example hapmap file?

Thanks, yp

ADD REPLY
0
Entering edit mode

Sorry I don't work with these types of files. You can try readData("test_631.hmp", format="HapMap") to see if your file is good for importing. Also from the documentation, I think you need 2 separate folders. 1 folder (the first argument) is for input "files of different individuals for one chromosome". The 2nd folder (second argument) is for the HapMap GFF.

ADD REPLY
0
Entering edit mode

Also, you can find example data by doing this in R

here <- find.package("PopGenome")
setwd(paste0(here, "/data")))
# You are now set to the directory containing PopGenome test data
list.files()
ADD REPLY
0
Entering edit mode

Thanks!

I tried two ways to load files into the Popgenome. But none of them is working for me.

  1. VCF - I created VCF and GFF files for each chromosome and stored in a separate folder.

GENOME.class <- readData("chr_vcf/", format="VCF", gffpath="gff/chr_gff/",FAST = FALSE,include.unknown = TRUE)

It is aborting the R session.

  1. Hapmap file format

GENOME.class<-readData("hapmap/", format="HapMap",populations = FALSE,outgroup = FALSE,gffpath ="gff/",include.unknown = TRUE) | : | : | 100 % | Read 321000 items

Error in CCC$matrix : $ operator is invalid for atomic vectors

ADD REPLY

Login before adding your answer.

Traffic: 1586 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6