pievos101 / popgenome Goto Github PK
View Code? Open in Web Editor NEWAn Efficient Swiss Army Knife for Population Genomic Analyses in R
An Efficient Swiss Army Knife for Population Genomic Analyses in R
Hello! I would like to use the MKT function in PopGenome with a mitochondrial dataset. Because this involves assigning sites as synonymous or nonsynonymous, it is important for me to be able to specify that I need to use the vertebrate mitochondrial code, not the standard code. I cannot find a way to do this. Is it possible, or can this MKT function only be used on standard data?
Thanks!
-Teresa
Hi there,
In the introgression.stats method, is there ability to calculate Z-scores for the RNDmin metric (as for D and f stats)?
I have a sister-taxon introgression scenario I wish to test and this would be most helpful!
Bryan
Hello,
Importing 100 sequences from a FASTA file, results of neutrality stats are incosistent with other software and R packages. Number of segregating sites for each population is lower by 1 from those calculated by other software. Is this a bug?
Dear Bastian,
When I read in a vcf file, I encountered this error, could you please help to tell me how to solve it?
VCF_readIntoCodeMatrix :: Malformed GT field!
Error in 1:numusedcols : NA/NaN argument
Calls: readVCF
Thank you so much for your attention and participation.
Best wishes,
Xiaomeng
When I use concatenate.regions(GENOME.class), because the data is too large, the program uses the bigmemory package. Afterwards, when I execute GENOME.class <- neutrality.stats(GENOME.class, detail = F, FAST = T), the following error occurs. Is this a bug with the this R package? Or have I overlooked something?
This is the error code
devtools::install_github("pievos101/PopGenome")
Downloading GitHub repo pievos101/PopGenome@HEAD
── R CMD build ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file ‘/private/var/folders/6_/_ygsg2w97vl00r8mbrqx081r0000gn/T/RtmpCfUQzb/remotesb4121a672927/pievos101-PopGenome-ab39ee8/DESCRIPTION’ ...
─ preparing ‘PopGenome’:
✔ checking DESCRIPTION meta-information ...
─ cleaning src
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ looking to see if a ‘data/datalist’ file should be added
─ building ‘PopGenome_2.7.7.tar.gz’
* installing *source* package ‘PopGenome’ ...
** using staged installation
** libs
clang++ -arch arm64 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c whopgenome/readdnapp.cpp -o whopgenome/readdnapp.o
In file included from whopgenome/readdnapp.cpp:43:
In file included from whopgenome/whop_rsupport.h:33:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:321:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_integral.h:32:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:202:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:966:34: error: too many arguments provided to function-like macro invocation
int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:969:9: note: macro 'length' defined here
#define length(x) Rf_length(x)
^
In file included from whopgenome/readdnapp.cpp:43:
In file included from whopgenome/whop_rsupport.h:33:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:321:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_integral.h:32:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:202:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:965:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces
_LIBCPP_INLINE_VISIBILITY
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:891:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
# define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:870:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
__attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))
^
In file included from whopgenome/readdnapp.cpp:43:
In file included from whopgenome/whop_rsupport.h:33:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:321:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_integral.h:32:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:202:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:966:15: error: expected ';' at end of declaration list
int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:1052:34: error: too many arguments provided to function-like macro invocation
int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:969:9: note: macro 'length' defined here
#define length(x) Rf_length(x)
^
In file included from whopgenome/readdnapp.cpp:43:
In file included from whopgenome/whop_rsupport.h:33:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:321:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_integral.h:32:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:202:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:1051:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces
_LIBCPP_INLINE_VISIBILITY
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:891:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
# define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:870:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
__attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))
^
In file included from whopgenome/readdnapp.cpp:43:
In file included from whopgenome/whop_rsupport.h:33:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:321:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_integral.h:32:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:202:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:1052:15: error: expected ';' at end of declaration list
int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:1137:34: error: too many arguments provided to function-like macro invocation
int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:969:9: note: macro 'length' defined here
#define length(x) Rf_length(x)
^
In file included from whopgenome/readdnapp.cpp:43:
In file included from whopgenome/whop_rsupport.h:33:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:321:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_integral.h:32:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:202:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:1136:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces
_LIBCPP_INLINE_VISIBILITY
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:891:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
# define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:870:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
__attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))
^
In file included from whopgenome/readdnapp.cpp:43:
In file included from whopgenome/whop_rsupport.h:33:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:321:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_integral.h:32:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:202:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:1137:15: error: expected ';' at end of declaration list
int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:1313:34: error: too many arguments provided to function-like macro invocation
int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:969:9: note: macro 'length' defined here
#define length(x) Rf_length(x)
^
In file included from whopgenome/readdnapp.cpp:43:
In file included from whopgenome/whop_rsupport.h:33:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:321:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_integral.h:32:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:202:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:1312:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces
_LIBCPP_INLINE_VISIBILITY
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:891:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
# define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:870:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
__attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))
^
In file included from whopgenome/readdnapp.cpp:43:
In file included from whopgenome/whop_rsupport.h:33:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:321:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__format/formatter_integral.h:32:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:202:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:1313:15: error: expected ';' at end of declaration list
int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
^
In file included from whopgenome/readdnapp.cpp:817:
whopgenome/rdnapp_Phylip.h:99:12: warning: variable 'samplenameidx' set but not used [-Wunused-but-set-variable]
for( int samplenameidx=0; c != ' ';samplenameidx++)
^
In file included from whopgenome/readdnapp.cpp:823:
whopgenome/rdnapp_MAF.h:495:30: warning: array subscript is of type 'char' [-Wchar-subscripts]
c = (int)nucleotide_mapping['-'];
^~~~
whopgenome/rdnapp_MAF.h:280:6: warning: variable 'currentalignmentoffset' set but not used [-Wunused-but-set-variable]
currentalignmentoffset=0 //where the current alignment-block begins
^
3 warnings and 12 errors generated.
make: *** [whopgenome/readdnapp.o] Error 1
ERROR: compilation failed for package ‘PopGenome’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/PopGenome’
Warning message:
In i.p(...) :
installation of package ‘/var/folders/6_/_ygsg2w97vl00r8mbrqx081r0000gn/T//RtmpCfUQzb/fileb4123a55576f/PopGenome_2.7.7.tar.gz’ had non-zero exit status
This is what chatgpt suggested:
It seems like there are compilation errors occurring during the installation of the PopGenome package from GitHub. The errors are related to compatibility issues with the C++ code and the macOS SDK.
The primary error seems to be caused by a conflict between a function-like macro named length in the PopGenome C++ code and another macro of the same name in the R internals (Rinternals.h). This conflict arises because both macros are named length. The C++ compiler is likely picking up the macro definition from R internals, which leads to compilation errors.
One potential solution could be to modify the PopGenome C++ code to avoid using variable names or function names that conflict with those defined in R internals.
Another potential solution could involve modifying the compilation flags to ensure that the C++ code is compiled correctly with respect to the macOS SDK.
@pievos101
Hi, Thank you for excellent tool.
I would like to ask about site.FST.
Which method is implemented to calculate Fst values per SNPs?
Wier & Cockerham or something like that....
I would like to calculate Fst values using haploid genome.
Best regards,
Could you please provide a method to clear the calculated statistics? This can avoid repeated reading and speed up the program
Dear professor,
Thanks for developing PopGenome which is the most useful package for me.
If I have MSMS simulation result which is stored in txt file and use 'readMS' to read it,
could you please tell me how can I extract that positions (0-1 scale) of each replicate of MSMS in GENOME.class?
Thank you for your help and time.
Dear PopGenome admin,
I am unable to read or process any (small) vcf format with the PopGenome package (on windows and Centos HPC).
The vcf only contains about 1000 SNP's.
The traceback from the HPC is as following:
loc <- "/ddn1/vol1/site_scratch/leuven/330/vsc33060/VCF/vcf_compressed/load"
GENOME.class <- readData(loc, format = "VCF", SNP.DATA = T, include.unknown=T)
| : | : | 100 %
|
*** caught segfault ***
address (nil), cause 'unknown'
Traceback:
1: myReadVCF(filepath)
2: PopGenread(liste[xx], format)
3: doTryCatch(return(expr), name, parentenv, handler)
4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
5: tryCatchList(expr, classes, parentenv, handlers)
6: tryCatch(expr, error = function(e) { call <- conditionCall(e) if (!is.null(call)) { if (identical(call[[1L]], quote(doTryCatch))) call <- sys.call(-4L) dcall <- deparse(call)[1L] prefix <- paste("Error in", dcall, ": ") LONG <- 75L sm <- strsplit(conditionMessage(e), "\n")[[1L]] w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if (is.na(w)) w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], type = "b") if (w > LONG) prefix <- paste0(prefix, "\n ") } else prefix <- "Error : " msg <- paste0(prefix, conditionMessage(e), "\n") .Internal(seterrmessage(msg[1L])) if (!silent && isTRUE(getOption("show.error.messages"))) { cat(msg, file = outFile) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))})
7: try(PopGenread(liste[xx], format), silent = TRUE)
8: readData(loc, format = "VCF", SNP.DATA = T, include.unknown = T)
Thank you for your insights,
With kind regards,
Frederik Van Daele
'm trying to run my alignment of a gene (CDS) with multiple species and multiple individuals per species. When using the 'readData()' function in the PopGenome package, I can see that it's reading in my file because it shows the correct number of sites, but doesn't show anything else (# gaps, unknowns, trans/transv ratio, etc).
> get.sum.data(Croc_AVP.class) n.sites n.biallelic.sites n.gaps n.unknowns n.valid.sites n.polyallelic.sites trans.transv.ratio ExonCap-Crocodylus_AVP_outNT_MKTtest.fasta 858 0 0 0 0 0 NaN
I tried dos2unix to convert my file to have Unix linebreaks in the fasta file to mirror the PopGenome example fastas, but to no avail.
Hi Bastian,
as PopGenome is currently archived on CRAN, our package coala, which suggests PopGenome, has also been archived. Will PopGenome be back on CRAN any time soon such that it makes sense to keep the popgenome import functions in coala and the vignette that explains the interface?
Best wishes and many thanks,
Dirk
We had a request from a BCFtools user to assist in splitting the chromosomes from a VCF file into smaller scaffolds, which can then be indexed in TBI format. The user intends to use the indexed VCF file in a PopGenome analysis, but currently cannot do so, because some chromosome in the file are larger than 229-1, which is the upper limit of the TBI format, and PopGenome apparently does not accept CSI indices, which could accommodate these large chromosomes.
You can find a minimal description of the CSI format here.
Hi @pievos101
Is it possible to extract the total number of predicted non-synonymous and synonymous sites from a "GENOME" object created from on an in frame fasta alignment? I can get SNPs of either category but not invariant sites.
I've sent a question through your weebly site also, sorry for the duplication.
Best wishes,
Jack
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.