-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nick's updates to 7.0. Updates to Makefile and README to fix issues.
- Loading branch information
1 parent
a17319f
commit 24e63b5
Showing
42 changed files
with
9,257 additions
and
586 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,10 @@ program code: | |
|
||
diagplus: 0 | ||
|
||
*** new feature (for both qpAdm and qpWave)*** | ||
Input can now be an fstats file -- see README.qpfstats | ||
For qpAdm new parameter numboot: see README.qpfstats | ||
|
||
|
||
Nick Patterson | ||
<[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
qpfstats | ||
-------- | ||
DIR: /home/np29/biologyx/v41x/yamdir2/testdir | ||
S1: qdata1 | ||
S1X: qdata1 | ||
indivname: DIR/S1X.ind | ||
snpname: DIR/S1.snp | ||
genotypename: DIR/S1.geno | ||
poplistname: lista | ||
## must be present. ne popuation / line. First population is base | ||
fstatsoutname: fstatsa.txt | ||
## first line is header. Must be retained | ||
allsnps: YES | ||
## default NO -- dangerous bend | ||
inbreed: NO | ||
## default NO | ||
scale: NO | ||
## default YES -- when fstats are scaled to "match" fst in least squares sense | ||
|
||
qpfmv | ||
----- | ||
fstatsname: fstatsa.txt | ||
popfilename: f4sslist | ||
## 4 pops / line (as in qpDstat) but f2, f3, f4 can be mixed. So code A C B C for f3 stat | ||
fmvoutname: fmvq2.out | ||
|
||
|
||
New parameters for qpAdm (which should be upwards compatible) | ||
fstatsname: <output from qpfstats> | ||
## if present no need to specify .ind .snp .geno | ||
numboot: <# of bootstrap samples + antithetical samples> | ||
## default 1000 | ||
|
||
New parameters for qpWave (which should be upwards compatible) | ||
fstatsname: <output from qpfstats> | ||
|
||
New parameters for qpGraph (which should be upwards compatible) | ||
qpGraph allows to to make qpfstats file | ||
Example | ||
1) Make qpfstats :: ~np29/newadm19/src/jtest1/ww2dir/testdir/qpfs_example/parw2 | ||
D2: /home/np29/broaddatax/v41 | ||
D1: D2 | ||
S1: jd1 | ||
indivname: D1/S1.ind | ||
snpname: D1/S1.snp | ||
genotypename: D1/S1.geno | ||
fstatsoutname: fstatsw2 | ||
allsnps: YES | ||
## there is an option oldallsnps: YES for compatiblity. Not recommended. | ||
loadf3: YES | ||
## this is needed to get qpfstats calculated | ||
graphname: graph1 | ||
diag: .0001 | ||
|
||
2) Use qpfstats | ||
fstatsname: fstatsw2 | ||
graphname: graph1 | ||
diag: .0001 | ||
|
||
*** qpfstats with allsnps: YES is a much better way to use all the data than | ||
the older allsnps mode. Standard errors are often much reduced and the theory | ||
is now defensible! | ||
|
||
See ./qpfs.pdf for a brief explanation of the theory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Consider f4(l1, l2, r1, r2) | ||
Suppose at some snp l2 is missing, but the allele frequencies of r1, r2 match. Then whatever l2 f4 is zero | ||
Similarly f4=0 if the frequncy of l1 and l2 match, | ||
|
||
qpAdm | ||
qpWave | ||
qpF4ratio | ||
qpf4diff | ||
|
||
use this trick. | ||
|
||
Arie Shaus pointed out to me that this can bias f4 down toward 0. | ||
To disable, code in the parameter file | ||
|
||
fancyf4: NO | ||
|
||
Nick 1/29/19 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/perl -w | ||
|
||
use Getopt::Std ; | ||
getopts('a:b:o:',\%opts) ; | ||
|
||
$fa = $opts{"a"} ; | ||
$fb = $opts{"b"} ; | ||
$fout = $opts{"o"} ; | ||
|
||
die "no -a parameter\n" unless (defined $fa) ; | ||
die "no -b parameter\n" unless (defined $fb) ; | ||
|
||
open (I1, "$fa") || die "can't open $fa\n" ; | ||
open (I2, "$fb") || die "can't open $fa\n" ; | ||
|
||
$maxa = -1 ; | ||
foreach $line (<I1>) { | ||
($a, $w, $v) = split " ", $line ; | ||
next if ($a =~ /\#/) ; | ||
next unless (defined $v) ; | ||
$WA[$a] = $w ; | ||
$VA[$a] = $v ; | ||
} | ||
foreach $line (<I2>) { | ||
($a, $w, $v) = split " ", $line ; | ||
next if ($a =~ /\#/) ; | ||
next unless (defined $v) ; | ||
$WB[$a] = $w ; | ||
$VB[$a] = $v ; | ||
$maxa = $a ; | ||
} | ||
$T1 = "/tmp/t1.$$" ; | ||
open (Y1, ">$T1") ; | ||
|
||
foreach $a (0..$maxa) { | ||
$wa = $WA[$a] ; | ||
$wb = $WB[$a] ; | ||
$va = $VA[$a] ; | ||
$vb = $VB[$a] ; | ||
die "mismatched weights: line index $a\n" if ($wa != $wb) ; | ||
printf Y1 "%d %d %12.6f\n", $a, $wa, $va - $vb ; | ||
} | ||
close Y1 ; | ||
system "mkpretty $T1 $fout" if (defined $fout) ; | ||
printf "##jackknife difference $fa - $fb\n" ; | ||
system "simpjack2 -i $T1 -v" ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/usr/bin/perl -w | ||
|
||
## mkpretty infile outfile | ||
|
||
($infile, $outfile) = @ARGV ; | ||
$T1 = "/tmp/t1.$$" ; | ||
$T2 = "/tmp/t2.$$" ; | ||
|
||
if (defined $infile) { | ||
die "Usage: mkpretty < infile > outfile OR mkpretty infile outfile\n" unless (defined $outfile) ; | ||
system "cp $infile $T1" ; | ||
} | ||
else { | ||
system "cat - > $T1" ; | ||
} | ||
open (F1, $T1) || die "badly\n" ; | ||
for (;;) { | ||
last if (eof(F1)) ; | ||
$line = <F1> ; | ||
chomp $line ; | ||
(@Z) = split " ", $line ; | ||
next unless (defined $Z[0]) ; | ||
next if ($Z[0] =~ /\#/) ; | ||
$n = @Z ; | ||
foreach $x (0..$n-1) { | ||
$W[$x] = 0 unless (defined ($W[$x])) ; | ||
$w = length($Z[$x]) ; | ||
$W[$x] = $w if ($w > $W[$x]) ; | ||
} | ||
} | ||
## @W is maximum width | ||
close F1 ; | ||
$nw = @W ; | ||
foreach $x (0..$nw-1) { | ||
$w = $W[$x] ; | ||
$fmt = "%" . $w . "s" ; | ||
$F[$x] = $fmt ; | ||
} | ||
|
||
open (F1, $T1) || die "badly\n" ; | ||
open (YY, ">$T2") || die "very badly\n" ; | ||
for (;;) { | ||
last if (eof(F1)) ; | ||
$line = <F1> ; | ||
chomp $line ; | ||
(@Z) = split " ", $line ; | ||
next unless (defined $Z[0]) ; | ||
if ($Z[0] =~ /\#/) { | ||
print YY "$line\n"; | ||
next ; | ||
} | ||
$n = @Z ; | ||
foreach $x (0..$n-1) { | ||
printf YY "$F[$x]", $Z[$x] ; | ||
print YY " ", if ($x != ($n-1)) ; | ||
} | ||
print YY "\n" ; | ||
} | ||
if (defined $outfile) { | ||
system "cp $T2 $outfile" ; | ||
} | ||
else { | ||
system "cat $T2" ; | ||
} | ||
unlink ($T1, $T2) ; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,37 @@ | ||
backup | ||
convertf | ||
copych | ||
diff.out | ||
diffch | ||
dirlist | ||
dowtjack | ||
expfit.sh | ||
gcount | ||
gmon.out | ||
grabpars | ||
kimf | ||
libnick.a | ||
mergeit | ||
nicktmp | ||
oldmake | ||
oldmakefile | ||
q1 | ||
qaz | ||
qp3Pop | ||
qp4diff | ||
qpAdm | ||
qpBound | ||
qpDpart | ||
qpdslow | ||
qpDstat | ||
qpff3base | ||
qpfmv | ||
qpfstats | ||
qpF4ratio | ||
qpGraph | ||
qpWave | ||
qpreroot | ||
rolloff | ||
rolloffp | ||
simpjack2 | ||
tables |
Oops, something went wrong.