rystanley / genepopedit

Simple and flexible manipulation of genomic data.
15 stars 4 forks source link

genepop_colony #15

Open Sammy-colony opened 2 years ago

Sammy-colony commented 2 years ago

Hi Ryan,

I am trying to convert my genepop file into Colony format, however keep getting errors. I have used your code and just filled in my details. Below is my code and the errors I get. Not sure what am I getting wrong, some help would be greatly appreciated.

Kind Regards, Samantha

genepop_colony(genepop="C:/Users/s.ockhuis/SynologyDrive/Documents/PhD data/quaddRAD seq/juveniles/juveniles_genepop.txt",where.plink="C:/Users/s.ockhuis/SynologyDrive/Documents/PhD data/quaddRAD seq/plink/",where.pgdspider="C:/Users/s.ockhuis/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/PGDSpider_2.1.1.5/",denote.missing = "000",path = "C:/Users/s.ockhuis/SynologyDrive/Documents/PhD data/quaddRAD seq/juveniles/")

Error in file(con, "rb") : cannot open the connection In addition: Warning messages: 1: In file.create(to[okay]) : cannot create file 'C:/Users/s.ockhuis/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/PGDSpider_2.1.1.5/', reason 'Invalid argument' 2: In file.create(to[okay]) : cannot create file 'C:/Users/s.ockhuis/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/PGDSpider_2.1.1.5/', reason 'Invalid argument' 3: In shell(run.PGDspider) : 'cd C:/Users/s.ockhuis/AppData/Roaming/Microsoft/Windows/Start\ Menu/Programs/PGDSpider_2.1.1.5/ && java -Xmx1024m -Xms512m -jar PGDSpider2-cli.jar -inputfile genepop_colony.txt -inputformat GENEPOP -outputfile Colony_Out.ped -outputformat PED -spid GenePopColony.spid' execution failed with error code 1 4: In file.copy(from = ped.path, to = where.plink, overwrite = TRUE) : problem copying C:\Users\s.ockhuis\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\PGDSpider_2.1.1.5\Colony_Out.ped to C:\Users\s.ockhuis\SynologyDrive\Documents\PhD data\quaddRAD seq\plink\Colony_Out.ped: No such file or directory 5: In file.copy(from = map.path, to = where.plink, overwrite = TRUE) : problem copying C:\Users\s.ockhuis\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\PGDSpider_2.1.1.5\Colony_Out.map to C:\Users\s.ockhuis\SynologyDrive\Documents\PhD data\quaddRAD seq\plink\Colony_Out.map: No such file or directory 6: In shell(execute.PLINK) : 'cd C:/Users/s.ockhuis/SynologyDrive/Documents/PhD\ data/quaddRAD\ seq/plink/ && plink --file Colony_Out --missing --noweb' execution failed with error code 1 7: In file.copy(from = paste0(where.plink, "plink.lmiss"), to = path.start) : problem copying C:\Users\s.ockhuis\SynologyDrive\Documents\PhD data\quaddRAD seq\plink\plink.lmiss to C:\Users\s.ockhuis\SynologyDrive\Documents\PhD data\quaddRAD seq\juveniles\plink.lmiss: No such file or directory 8: In file.rename(from = paste0(path.start, "/", "plink.lmiss"), to = paste0(path.start, : cannot rename file 'C:/Users/s.ockhuis/SynologyDrive/Documents/PhD data/quaddRAD seq/juveniles/plink.lmiss' to 'C:/Users/s.ockhuis/SynologyDrive/Documents/PhD data/quaddRAD seq/juveniles/plink.txt', reason 'The system cannot find the file specified' 9: In file(con, "rb") : cannot open file 'plink.txt': No such file or directory

NickJeff13 commented 2 years ago

Hi Samantha, It looks like it doesn't like your file paths for some reason. Do the other genepopedit functions work on your genepop file that don't need PGDSpider or plink (e.g., genepop_detective)? Also which version of plink are you using?

rystanley commented 2 years ago

I believe this has to do with the implantation of PLINK by R. PLINK versions >1.9 have some compatibility issues that we have yet to rectify. If you can download the legacy version of PLINK (version 1.9) the function should work. if it doesn't we can try to help work through the error more directly.