Hi all,
I'm using the ADMIXTURE’s cross-validation procedure in my mac terminal and it fails to run on my .bed file, giving the following output:
I used the following script a .txt file:
Then I called the txt file using the following command in the terminal: ./coots.CODE.multi.run.admix.A.txt I do also have the .bim and .fam files in the directory.
Any ideas would be greatly appreciated.
Thanks!
PD. Here is the script from the .txt file:
DATAFILE="COOT.5901Acat.fasta.INDEP"; OUTDIR=/Users/alexisdiaz/Desktop/popgen/admixture_analysis/admixture_macosx/results/; INPDIR=/Users/alexisdiaz/Desktop/popgen/admixture_analysis/admixture_macosx/; echo ${DATAFILE}; NUMRUNS=100; MINK=1; MAXK=10; mkdir $OUTDIR cd $OUTDIR echo "seq $MINK $MAXK" for K in $(seq $MINK $MAXK); do mkdir $K cd $K for T in $(seq $NUMRUNS); do N=$(date +%N | cut -b1-6 | sed -e "s/^0+//") S=$(($N+41217$K+17$T)) echo "/Users/alexisdiaz/Desktop/popgen/admixture_analysis/admixture_macosx/admixture --cv=10 -s $S $INPDIR/$DATAFILE.bed $K -j2" /Users/alexisdiaz/Desktop/popgen/admixture_analysis/admixture_macosx/admixture --cv=10 -s $S $INPDIR/$DATAFILE.bed $K -j2 |tee -a ../log.$K.out mv $DATAFILE.$K.Q $DATAFILE.$K.$T.Q mv $DATAFILE.$K.P $DATAFILE.$K.$T.P done; cd .. done;
1 answer
I just solved this issue. This problem is specifically in regards to the date command. When I run the command on my linux machine with the parameter to provide some time in nanoseconds, I get the correct result, but when I run it on my mac, it does not have that option.
date +%s000 returns the number of seconds + current nanoseconds. So I slightly modified some lines on the command and then admixture run without issues.
N=$(date +%s000 | cut -b1-6 | sed -e "s/^0\+//")
#echo "This statement $T $N"
S=$(($N+41217*$K+17*$T))
Log in to answer this question.