Skip to content

Commit

Permalink
additional tools
Browse files Browse the repository at this point in the history
  • Loading branch information
SamueleSoraggi committed Feb 25, 2021
1 parent ad6e3e6 commit 03bd4d6
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ __pycache__/
# Ignore vim swap files
*.swp
*.swo
._.DS_Store
.DS_Store
tools/nQuire.R~
.gitignore
simulMpileup.R~
Empty file modified Fitting_dist_contig.py
100644 → 100755
Empty file.
Empty file modified Genotype_Likelihoods.py
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions HMMploidy.R
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -1268,8 +1268,8 @@ for(i in 1:length(fileVector)){ #loop over input files
if(length(chrNameVar)>1){
for(nn in chrNameVar){
ctgSites <- sitesSNP[chrSNP==nn]
print(nn)
print(ctgSites)
#print(nn)
#print(ctgSites)
if(!is.sorted(ctgSites))
stop( paste('The contig ', nn, ' contains unsorted values. This might be due by:\n',
'\t1) duplicated loci in your data ==> find and remove them\n',
Expand Down Expand Up @@ -1394,7 +1394,7 @@ for(i in 1:length(fileVector)){ #loop over input files
p = .05
mat2 <- mat
print(mat)
if(length(mat)[1] > 1 & any(diag(mat)<p)){
if(length(mat)[1] > 1 & any(diag(mat)<p) & sum(diag(mat)<p)<dim(mat)[1]){
for(l in 1:dim(mat)[1])
if(mat[l,l]>p)
keepIdx <- c(keepIdx,l)
Expand Down
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified generics.py
100644 → 100755
Empty file.
Empty file modified likelihoodDifference.R
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions simulMpileup.R
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# simulate mpileup file with different ploidy 1-5, assuming only 2 alleles and genotype frequencies defined by K and Ne and F
# simulate mpileup file with different ploidy 1-6, assuming only 2 alleles and genotype frequencies defined by K and Ne and F

# assume, population allele frequencies drawn from an exponential distribution

Expand Down Expand Up @@ -102,7 +102,7 @@ depth <- matrix( 0, nrow=nsams, ncol=nsites )
for(samIdx in 1:nsams){
rangeLams <- opt$depth * ncopy[samIdx] + (opt$depth * ncopy[samIdx] * opt$errdepth * c(-1,1))
sampledLams <- runif(nsites, min=rangeLams[1], max=rangeLams[2])
depth[samIdx,] <- rpois(nsites,sampledLams)
depth[samIdx,] <- rpois(nsites,max(0.01,sampledLams)) #avoid negative or zero lambdas
}

rm(sampledLams)
Expand Down

0 comments on commit 03bd4d6

Please sign in to comment.