Attempting to run freebayes using the command line instead of dDocent because we are still experiencing memory creep

November 9, 2016 
Apparently, last time I ran freebayes from the command line, I created a script called call_SNPs.sh
/local/home/michelles/02-apcl-ddocent/APCL_analysis/scripts/call_SNPs.sh

michelles 2016-11-09 15:25:07 APCL_analysis $ mkdir 17-03seq_cmdline

Create symlinks for all of the files:

ln -s ../../17seq/samples/APCL* ./

ln -s ../../16seq/samples/APCL* ./

ln -s ../../15seq/samples/APCL* ./

ln -s ../../13seq/samples/APCL* ./

ln -s ../../12seq/samples/APCL* ./

ln -s ../../09seq/samples/APCL* ./

ln -s ../../08seq/samples/APCL* ./

ln -s ../../07seq/samples/APCL* ./

ln -s ../../05seq/samples/APCL* ./

ln -s ../../04seq/samples/APCL* ./


ln -s ../../03seq/samples/APCL* ./


michelles 2016-11-09 15:37:10 17-03seq_cmdline $ nohup sh ../scripts/call_SNPs.sh 

Jon sent an email saying that this isn’t the best solution and recommended trying a different way.  Will try once this run finishes

November 10, 2016 
dDocent failed because there is no cov.stats file.  

Where does cov.stats come from?
if [ "cat-RRG.bam"-nt"cov.stats" ];then coverageBed -abam cat-RRG.bam -b mapped.bed -counts > cov.stats fi
adding to the script
commented out the lines that have already run
ran nohup sh ../scripts/call_SNPs.sh at 7:21AM on 11-10-2016
bedtools is running to create the cov.stats file



nohup ls mapped.*.bed | sed 's/mapped.//g' | sed 's/.bed//g' | shuf | parallel -j 15 --no-notice freebayes -b cat-RRG.bam -t mapped.{}.bed -v raw.{}.vcf -f reference.fasta -m 5 -q 5 -E 3 --min-repeat-entropy 1 -V --populations popmap -n 4 &

2016-11-23 Wednesday


November 28, 2016 
move mapped files to a new directory
michelles 2016-11-28 08:14:58 17-03seq_cmdline $ mv mapped.*.bed 809_mapped/

Change all of the single digit vcf files to double digit files:
    mv raw.1.vcf raw.01.vcf
    mv raw.2.vcf raw.02.vcf
    mv raw.3.vcf raw.03.vcf
    mv raw.4.vcf raw.04.vcf
    mv raw.5.vcf raw.05.vcf
    mv raw.6.vcf raw.06.vcf
    mv raw.7.vcf raw.07.vcf
    mv raw.8.vcf raw.08.vcf
    mv raw.9.vcf raw.09.vcf

michelles 2016-11-28 08:19:07 17-03seq_cmdline $     mv raw.1.vcf raw.01.vcf
mv: cannot stat `raw.1.vcf': No such file or directory
michelles 2016-11-28 08:19:19 17-03seq_cmdline $     mv raw.2.vcf raw.02.vcf
mv: cannot stat `raw.2.vcf': No such file or directory
michelles 2016-11-28 08:19:19 17-03seq_cmdline $     mv raw.3.vcf raw.03.vcf
mv: cannot stat `raw.3.vcf': No such file or directory
michelles 2016-11-28 08:19:19 17-03seq_cmdline $     mv raw.4.vcf raw.04.vcf
mv: cannot stat `raw.4.vcf': No such file or directory
michelles 2016-11-28 08:19:19 17-03seq_cmdline $     mv raw.5.vcf raw.05.vcf
mv: cannot stat `raw.5.vcf': No such file or directory
michelles 2016-11-28 08:19:19 17-03seq_cmdline $     mv raw.6.vcf raw.06.vcf
mv: cannot stat `raw.6.vcf': No such file or directory
michelles 2016-11-28 08:19:19 17-03seq_cmdline $     mv raw.7.vcf raw.07.vcf
mv: cannot stat `raw.7.vcf': No such file or directory
michelles 2016-11-28 08:19:19 17-03seq_cmdline $     mv raw.8.vcf raw.08.vcf
mv: cannot stat `raw.8.vcf': No such file or directory
michelles 2016-11-28 08:19:19 17-03seq_cmdline $     mv raw.9.vcf raw.09.vcf
mv: cannot stat `raw.9.vcf': No such file or directory

combine raw vcf files - took seconds?  A minute?
michelles 2016-11-28 08:19:21 17-03seq_cmdline $ nohup vcfcombine raw.*.vcf | sed -e 's/\.\:/\.\/\.\:/g' > 809_TotalRawSNPs.vcf &
[1] 25447

Move raw files to directory 
michelles 2016-11-28 08:23:51 17-03seq_cmdline $ mkdir 809_raw
michelles 2016-11-28 08:27:44 17-03seq_cmdline $ mv raw.* 809_raw/ 

Move log files from previous run to directory - 
michelles 2016-11-28 08:28:48 17-03seq_cmdline $ mkdir logfiles
michelles 2016-11-28 08:29:28 17-03seq_cmdline $ mv *.log logfiles

Instead of filtering, create genepop and put into cervus (these are the loci we want to test for identity, do not want to lose any in filtering) - takes seconds
michelles 2016-11-28 08:29:33 17-03seq_cmdline $ vcf2genepop.pl vcf=809_TotalRawSNPs.vcf > 809_seq17_03.gen

Fetch to Mac

Move to google docs - Cervus folder

Open on the Windows Machine 

Start Cervus - Identity November 28, 2016