jdalapicolla / langen_pipeline_version2 Goto Github PK
View Code? Open in Web Editor NEWScripts in R for Landscape Genomics Analyses v.2
License: GNU General Public License v3.0
Scripts in R for Landscape Genomics Analyses v.2
License: GNU General Public License v3.0
Hello there,
first all, thank you very much Jeronymo for the huge work and for putting these scripts online.
I was doing some analyses with a ddRAD seq database I have and I was at point #8 ("TESTING THE MISSING DATA INFLUENCE ON GENETIC STRUCTURE") of "1.1_FILTERING_SNPs". However, as I tried to do the PCA, I got the following error:
Error in file(file, ifelse(append, "a", "w")) : cannot open the connection
In addition: Warning message:
In file(file, ifelse(append, "a", "w")) : cannot open file 'Results_Filters/PCA/Axis_coord_test_chordo_Adapative_all_20_PC.csv': No such file or directory
("chordo" is the name of the project)
Checking on the codes, I did not notice the all_20_PC.csv file and when it should be generated.
I followed the code basically as written, script-by-script, just changing the R2 value when calculating LD.
It has to be noticed that everything goes well until that point. I honestly have no idea of what I could miss. Therefore, what could be the cause of this error?
Thanks in advance for the answer and sorry for the bother
LanGen_pipeline_version2/1.1_FILTERING_SNPs.R
Lines 893 to 908 in d98a65e
Hello Jeronymo,
I am at this chunk of code, using tess3 method to do spatial genetic structuring.
at the line 905, which "project" object do you mean? Maybe you mean the best run object called "res" at line 895?
Thanks,
LanGen_pipeline_version2/1.1_FILTERING_SNPs.R
Lines 847 to 849 in d98a65e
Hello Jeronymo, Thanks for your help along the way.
Whenever I rerun the tess3 function, I receive a different qmatrix, and result in different ancestry proportions for my barplot. Why is it so? Should I do the "set.seed()?"
I adapted your code and took out the loop and lambda parameter.
`K = c(1:5) # set the number of K to be tested
ploidy = 2 # species ploidy
CPU = 4 #Number of cores for run in parallel
tess3.ls <- tess3(X = genotypes, coord = coordinates, K = K,
method = "projected.ls", ploidy = ploidy, openMP.core.num = CPU)
q.matrix <- qmatrix(tess3.ls, K = 5)
my.colors <- c(1:5)
my.palette <- CreatePalette(my.colors, 6)
barplot(q.matrix, border = T, space = 0,
main = "Ancestry matrix",
xlab = "Individuals", ylab = "Ancestry proportions",
col.palette = my.palette) -> bp
axis(1, at = 0.5:nrow(q.matrix), labels = snps@meta[,3][bp$order], las = 3, cex.axis = 1)
`
LanGen_pipeline_version2/1.1_FILTERING_SNPs.R
Lines 316 to 317 in d98a65e
Hello Jeronymo. Thank you for your previous help.
How did you determine this r2 value? I couldn't find it in the code. Can you share a resource or tutorial ?
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.