This analysis follows the total expression study described in my previous post
I. Identify SNPs between pair-wise comparisons
A. Run bowtie to align parental reads to transcriptomes of other species
runbowtie2_XmXc.sh runbowtie2_XmXh.sh runbowtie2_XcXH64.sh runbowtie2_XcXM.sh runbowtie2_XhXM64.sh runbowtie2_XcXH.sh runbowtie2_XhXC64.sh runbowtie2_XhXM.sh runbowtie2_XcXM64.sh runbowtie2_XhXc.sh
B. Make mpileup file for each comparison
samtools mpileup -f ../fa/Xcou_overlay_XmXh_trim_2013-07-09.fa XMA_110E_i1.5m_WF_none_SP_2013-01-02_Xcou_2013-07-09.2.sam_sorted.bam XMB_107AD_i2m_WF_none_SP_2012-08-15_Xcou_2013-07-09.2.sam_sorted.bam >XmacVSXcou_2013-07-31.mpileup samtools mpileup -f ../fa/Xhel_overlay_XmXc_trim_2013-07-09.fa XMA_110E_i1.5m_WF_none_SP_2013-01-02_Xhel_2013-07-09.2.sam_sorted.bam XMB_107AD_i2m_WF_none_SP_2012-08-15_Xhel_2013-07-09.2.sam_sorted.bam >XmacVSXhel_2013-07-31.mpileup samtools mpileup -f ../fa/Xcou_overlay_XmXh_trim_2013-07-09.fa XH_11479_i1m_WF_none_EA_2010-11-16_Xcou_2013-07-09.2.sam_sorted.bam XH_11742_i2m_WF_none_SP_2012-08-15_Xcou_2013-07-09.2.sam_sorted.bam XH_xxx_i1m_WF_none_CF_2010-09-09A_Xcou_2013-07-09.2.sam_sorted.bam >XhelVSXcou_2013-07-13.mpileup samtools mpileup -f ../fa/Xmac_XcXh_trim_2013-07-09.fa XH_11479_i1m_WF_none_EA_2010-11-16_Xmac_2013-07-09.2.sam_sorted.bam XH_11742_i2m_WF_none_SP_2012-08-15_Xmac_2013-07-09.2.sam_sorted.bam XH_xxx_i1m_WF_none_CF_2010-09-09A_Xmac_2013-07-09.2.sam_sorted.bam >XhelVSXmac_2013-07-31.mpileup samtools mpileup -f ../fa/Xmac_XcXh_trim_2013-07-09.fa XC_77C_i2m_WF_none_SP_2012-08-15_Xmac_2013-07-09.2.sam_sorted.bam XC_xxx_i1m_WF_none_CF_2009-11-02_Xmac_2013-07-09.2.sam_sorted.bam >XcouVSXmac_2013-07-31.mpileup samtools mpileup -f ../fa/Xhel_overlay_XmXc_trim_2013-07-09.fa XC_77C_i2m_WF_none_SP_2012-08-15_Xhel_2013-07-09.2.sam_sorted.bam XC_xxx_i1m_WF_none_CF_2009-11-02_Xhel_2013-07-09.2.sam_sorted.bam >XcouVSXhel_2013-07-31.mpileup
C. Call SNPs between two species using mpileup
java -jar /opt/research/Software/VarScan.v2.2.11.jar mpileup2snp everyMpileup everySNP
D. Compare two SNPs and find the common SNPs
SNPmatcher.pl XcouVSXhel_2013-07-31.SNP XhelVSXcou_2013-07-13.SNP mv SNP1.txt XcouVSXhel_overlap_2013-07-31.SNP mv SNP2.txt XhelVSXcou_overlap_2013-07-13.SNP SNPmatcher.pl XmacVSXcou_2013-07-31.SNP XcouVSXmac_2013-07-31.SNP mv SNP1.txt XmacVSXcou_overlap_2013-07-31.SNP mv SNP2.txt XcouVSXmac_overlap_2013-07-31.SNP SNPmatcher.pl XmacVSXhel_2013-07-31.SNP XhelVSXmac_2013-07-31.SNP mv SNP1.txt XmacVSXhel_overlap_2013-07-31.SNP mv SNP2.txt XhelVSXmac_overlap_2013-07-31.SNP
E. The number of SNPs in each comparisons
awk '{print $1}' XcouVSXhel_overlap_2013-07-31.SNP |sort|uniq|wc -l 15575 awk '{print $1}' XcouVSXmac_overlap_2013-07-31.SNP |sort|uniq|wc -l 15981 awk '{print $1}' XhelVSXmac_overlap_2013-07-31.SNP |sort|uniq|wc -l 16552
II. Call the Allele specific reads in each species.
A. Link all mpileup file generated previously (see the link in the top line)
B. Use the perl script to call reads
1. For Xmac in XmVSXc comparison
mpileCounterv21.pl XcouVSXmac_overlap_2013-07-31.SNP XMA_110E_i1.5m_WF_none_SP_2013-01-02_XmacRatt_2013-07-09.2.sam.mpileup >XMA_110E_i1.5m_WF_none_SP_2013-01-02_Xcou_2013-08-01_ASE.txt mpileCounterv21.pl XcouVSXmac_overlap_2013-07-31.SNP XMB_107AD_i2m_WF_none_SP_2012-08-15_XmacRatt_2013-07-09.2.sam.mpileup >XMB_107AD_i2m_WF_none_SP_2012-08-15_Xcou_2013-08-01_ASE.txt mv XMA_110E_i1.5m_WF_none_SP_2013-01-02_XmacRatt_2013-07-09.2.sam.mpileup.summary.txt XMA_110E_i1.5m_WF_none_SP_2013-01-02_Xcou_2013-08-01_ASE.summary.txt mv XMB_107AD_i2m_WF_none_SP_2012-08-15_XmacRatt_2013-07-09.2.sam.mpileup.summary.txt XMB_107AD_i2m_WF_none_SP_2012-08-15_Xcou_2013-08-01_ASE.summary.txt
2. For Xmac in XmVSXh comparison
mpileCounterv21.pl XhelVSXmac_overlap_2013-07-31.SNP XMB_107AD_i2m_WF_none_SP_2012-08-15_XmacRatt_2013-07-09.2.sam.mpileup >XMB_107AD_i2m_WF_none_SP_2012-08-15_Xhel_2013-08-01_ASE.txt mpileCounterv21.pl XhelVSXmac_overlap_2013-07-31.SNP XMA_110E_i1.5m_WF_none_SP_2013-01-02_XmacRatt_2013-07-09.2.sam.mpileup >XMA_110E_i1.5m_WF_none_SP_2013-01-02_Xhel_2013-08-01_ASE.txt mv XMB_107AD_i2m_WF_none_SP_2012-08-15_XmacRatt_2013-07-09.2.sam.mpileup.summary.txt XMB_107AD_i2m_WF_none_SP_2012-08-15_Xhel_2013-08-01_ASE.summary.txt mv XMA_110E_i1.5m_WF_none_SP_2013-01-02_XmacRatt_2013-07-09.2.sam.mpileup.summary.txt XMA_110E_i1.5m_WF_none_SP_2013-01-02_Xhel_2013-08-01_ASE.summary.txt
3. For Xcou in XmVSXc comparison
mpileCounterv21.pl XmacVSXcou_overlap_2013-07-31.SNP XC_xxx_i1m_WF_none_CF_2009-11-02_XcouRatt_2013-07-09.2.sam.mpileup >XC_xxx_i1m_WF_none_CF_2009-11-02_Xmac_2013-08-01_ASE.txt mpileCounterv21.pl XmacVSXcou_overlap_2013-07-31.SNP XC_77C_i2m_WF_none_SP_2012-08-15_XcouRatt_2013-07-09.2.sam.mpileup >XC_77C_i2m_WF_none_SP_2012-08-15_Xmac_2013-08-01_ASE.txt mv XC_77C_i2m_WF_none_SP_2012-08-15_XcouRatt_2013-07-09.2.sam.mpileup.summary.txt XC_77C_i2m_WF_none_SP_2012-08-15_Xmac_2013-08-01_ASE.summary.txt mv XC_xxx_i1m_WF_none_CF_2009-11-02_XcouRatt_2013-07-09.2.sam.mpileup.summary.txt XC_xxx_i1m_WF_none_CF_2009-11-02_Xmac_2013-08-01_ASE.summary.txt
4. For Xcou in XcVSXh comparison
mpileCounterv21.pl XhelVSXcou_overlap_2013-07-13.SNP XC_xxx_i1m_WF_none_CF_2009-11-02_XcouRatt_2013-07-09.2.sam.mpileup >XC_xxx_i1m_WF_none_CF_2009-11-02_Xhel_2013-08-01_ASE.txt mpileCounterv21.pl XhelVSXcou_overlap_2013-07-13.SNP XC_77C_i2m_WF_none_SP_2012-08-15_XcouRatt_2013-07-09.2.sam.mpileup >XC_77C_i2m_WF_none_SP_2012-08-15_Xhel_2013-08-01_ASE.txt mv XC_xxx_i1m_WF_none_CF_2009-11-02_XcouRatt_2013-07-09.2.sam.mpileup.summary.txt XC_xxx_i1m_WF_none_CF_2009-11-02_Xhel_2013-08-01_ASE.summary.txt mv XC_77C_i2m_WF_none_SP_2012-08-15_XcouRatt_2013-07-09.2.sam.mpileup.summary.txt XC_77C_i2m_WF_none_SP_2012-08-15_Xhel_2013-08-01_ASE.summary.txt
5. For Xhel in XmVSXh comparison
mpileCounterv21.pl XmacVSXhel_overlap_2013-07-31.SNP XH_11479_i1m_WF_none_EA_2010-11-16_XhelRatt_2013-07-09.2.sam.mpileup >XH_11479_i1m_WF_none_EA_2010-11-16_Xmac_2013-08-01_ASE.txt mpileCounterv21.pl XmacVSXhel_overlap_2013-07-31.SNP XH_11742_i2m_WF_none_SP_2012-08-15_XhelRatt_2013-07-09.2.sam.mpileup >XH_11742_i2m_WF_none_SP_2012-08-15_Xmac_2013-08-01_ASE.txt mpileCounterv21.pl XmacVSXhel_overlap_2013-07-31.SNP XH_xxx_i1m_WF_none_CF_2010-09-09A_XhelRatt_2013-07-09.2.sam.mpileup >XH_xxx_i1m_WF_none_CF_2010-09-09A_Xmac_2013-08-01_ASE.txt mv XH_11479_i1m_WF_none_EA_2010-11-16_XhelRatt_2013-07-09.2.sam.mpileup.summary.txt XH_11479_i1m_WF_none_EA_2010-11-16_Xmac_2013-08-01_ASE.summary.txt mv XH_11742_i2m_WF_none_SP_2012-08-15_XhelRatt_2013-07-09.2.sam.mpileup.summary.txt XH_11742_i2m_WF_none_SP_2012-08-15_Xmac_2013-08-01_ASE.summary.txt mv XH_xxx_i1m_WF_none_CF_2010-09-09A_XhelRatt_2013-07-09.2.sam.mpileup.summary.txt XH_xxx_i1m_WF_none_CF_2010-09-09A_Xmac_2013-08-01_ASE.summary.txt
6 For Xhel in XhVSXc comparision
mpileCounterv21.pl XcouVSXhel_overlap_2013-07-31.SNP XH_xxx_i1m_WF_none_CF_2010-09-09A_XhelRatt_2013-07-09.2.sam.mpileup >XH_xxx_i1m_WF_none_CF_2010-09-09A_2013-08-01_ASE.txt mpileCounterv21.pl XcouVSXhel_overlap_2013-07-31.SNP XH_11479_i1m_WF_none_EA_2010-11-16_XhelRatt_2013-07-09.2.sam.mpileup >XH_11479_i1m_WF_none_EA_2010-11-16_Xcou_2013-08-01_ASE.txt mpileCounterv21.pl XcouVSXhel_overlap_2013-07-31.SNP XH_11742_i2m_WF_none_SP_2012-08-15_XhelRatt_2013-07-09.2.sam.mpileup >XH_11742_i2m_WF_none_SP_2012-08-15_Xcou_2013-08-01_ASE.txt mv XH_11479_i1m_WF_none_EA_2010-11-16_XhelRatt_2013-07-09.2.sam.mpileup.summary.txt XH_11479_i1m_WF_none_EA_2010-11-16_Xcou_2013-08-01_ASE.summary.txt mv XH_11742_i2m_WF_none_SP_2012-08-15_XhelRatt_2013-07-09.2.sam.mpileup.summary.txt XH_11742_i2m_WF_none_SP_2012-08-15_Xcou_2013-08-01_ASE.summary.txt mv XH_xxx_i1m_WF_none_CF_2010-09-09A_XhelRatt_2013-07-09.2.sam.mpileup.summary.txt XH_xxx_i1m_WF_none_CF_2010-09-09A_Xcou_2013-08-01_ASE.summary.txt
7 For hybrid5
mpileCounterv21.pl XhelVSXmac_overlap_2013-07-31.SNP H05XmXh_11716.a_i1.5m_WF_none_SP_2013-04-19_XmacRatt_2013-07-09.2.sam.mpileup >H05XmXh_11716.a_i1.5m_WF_none_SP_2013-04-19_Xmac_2013-08-01_ASE.txt mpileCounterv21.pl XhelVSXmac_overlap_2013-07-31.SNP H05_11470_i2m_WF_none_SP_2012-08-15_XmacRatt_2013-07-09.2.sam.mpileup >H05_11470_i2m_WF_none_SP_2012-08-15_Xmac_2013-08-01_ASE.txt mpileCounterv21.pl XmacVSXhel_overlap_2013-07-31.SNP H05XmXh_11716.a_i1.5m_WF_none_SP_2013-04-19_XhelRatt_2013-07-09.2.sam.mpileup >H05XmXh_11716.a_i1.5m_WF_none_SP_2013-04-19_Xhel_2013-08-01_ASE.txt mpileCounterv21.pl XmacVSXhel_overlap_2013-07-31.SNP H05_11470_i2m_WF_none_SP_2012-08-15_XhelRatt_2013-07-09.2.sam.mpileup >H05_11470_i2m_WF_none_SP_2012-08-15_Xhel_2013-08-01_ASE.txt
8 For hybrid 8
mpileCounterv21.pl XcouVSXmac_overlap_2013-07-31.SNP H08_11286_i2m_WF_none_SP_2012-08-15_XmacRatt_2013-07-09.2.sam.mpileup >H08_11286_i2m_WF_none_SP_2012-08-15_Xmac_2013-08-01_ASE.txt mpileCounterv21.pl XcouVSXmac_overlap_2013-07-31.SNP H08_11442_i1m_WF_none_SP_2012-08-15_XmacRatt_2013-07-09.2.sam.mpileup >H08_11442_i1m_WF_none_SP_2012-08-15_Xmac_2013-08-01_ASE.txt mpileCounterv21.pl XmacVSXcou_overlap_2013-07-31.SNP H08_11286_i2m_WF_none_SP_2012-08-15_XcouRatt_2013-07-09.2.sam.mpileup >H08_11286_i2m_WF_none_SP_2012-08-15_Xcou_2013-08-01_ASE.txt mpileCounterv21.pl XmacVSXcou_overlap_2013-07-31.SNP H08_11442_i1m_WF_none_SP_2012-08-15_XcouRatt_2013-07-09.2.sam.mpileup >H08_11442_i1m_WF_none_SP_2012-08-15_Xcou_2013-08-01_ASE.txt
9 For hybrid 29
mpileCounterv21.pl XcouVSXhel_overlap_2013-07-31.SNP H29_11627_i2m_WF_none_SP_2012-08-15_XhelRatt_2013-07-09.2.sam.mpileup >H29_11627_i2m_WF_none_SP_2012-08-15_Xhel_2013-08-01_ASE.txt mpileCounterv21.pl XcouVSXhel_overlap_2013-07-31.SNP H29F8_11831B_i1.5m_WF_none_SP_2013-01-02_XhelRatt_2013-07-09.2.sam.mpileup >H29F8_11831B_i1.5m_WF_none_SP_2013-01-02_Xhel_2013-08-01_ASE.txt mpileCounterv21.pl XhelVSXcou_overlap_2013-07-13.SNP H29_11627_i2m_WF_none_SP_2012-08-15_XcouRatt_2013-07-09.2.sam.mpileup >H29_11627_i2m_WF_none_SP_2012-08-15_Xcou_2013-08-01_ASE.txt mpileCounterv21.pl XhelVSXcou_overlap_2013-07-13.SNP H29F8_11831B_i1.5m_WF_none_SP_2013-01-02_XcouRatt_2013-07-09.2.sam.mpileup >H29F8_11831B_i1.5m_WF_none_SP_2013-01-02_Xcou_2013-08-01_ASE.txt
III. Combine summary files into one master table
multigetcolsEnhanced.pl XMA_110E_i1.5m_WF_none_SP_2013-01-02_Xhel_2013-08-01_ASE.summary.txt 2 XMB_107AD_i2m_WF_none_SP_2012-08-15_Xhel_2013-08-01_ASE.summary.txt 2 XH_11479_i1m_WF_none_EA_2010-11-16_Xmac_2013-08-01_ASE.summary.txt 2 XH_11742_i2m_WF_none_SP_2012-08-15_Xmac_2013-08-01_ASE.summary.txt 2 XH_xxx_i1m_WF_none_CF_2010-09-09A_Xmac_2013-08-01_ASE.summary.txt 2 H05_11470_i2m_WF_none_SP_2012-08-15_XmacRatt_2013-07-09.2.sam.mpileup.summary.txt 2 H05XmXh_11716.a_i1.5m_WF_none_SP_2013-04-19_XmacRatt_2013-07-09.2.sam.mpileup.summary.txt 2 H05_11470_i2m_WF_none_SP_2012-08-15_XhelRatt_2013-07-09.2.sam.mpileup.summary.txt 2 H05XmXh_11716.a_i1.5m_WF_none_SP_2013-04-19_XhelRatt_2013-07-09.2.sam.mpileup.summary.txt 2 XMA_110E_i1.5m_WF_none_SP_2013-01-02_Xcou_2013-08-01_ASE.summary.txt 2 XMB_107AD_i2m_WF_none_SP_2012-08-15_Xcou_2013-08-01_ASE.summary.txt 2 XC_77C_i2m_WF_none_SP_2012-08-15_Xmac_2013-08-01_ASE.summary.txt 2 XC_xxx_i1m_WF_none_CF_2009-11-02_Xmac_2013-08-01_ASE.summary.txt 2 H08_11286_i2m_WF_none_SP_2012-08-15_XmacRatt_2013-07-09.2.sam.mpileup.summary.txt 2 H08_11442_i1m_WF_none_SP_2012-08-15_XmacRatt_2013-07-09.2.sam.mpileup.summary.txt 2 H08_11286_i2m_WF_none_SP_2012-08-15_XcouRatt_2013-07-09.2.sam.mpileup.summary.txt 2 H08_11442_i1m_WF_none_SP_2012-08-15_XcouRatt_2013-07-09.2.sam.mpileup.summary.txt 2 XC_77C_i2m_WF_none_SP_2012-08-15_Xhel_2013-08-01_ASE.summary.txt 2 XC_xxx_i1m_WF_none_CF_2009-11-02_Xhel_2013-08-01_ASE.summary.txt 2 XH_11479_i1m_WF_none_EA_2010-11-16_Xcou_2013-08-01_ASE.summary.txt 2 XH_11742_i2m_WF_none_SP_2012-08-15_Xcou_2013-08-01_ASE.summary.txt 2 XH_xxx_i1m_WF_none_CF_2010-09-09A_Xcou_2013-08-01_ASE.summary.txt 2 H29_11627_i2m_WF_none_SP_2012-08-15_XcouRatt_2013-07-09.2.sam.mpileup.summary.txt 2 H29F8_11831B_i1.5m_WF_none_SP_2013-01-02_XcouRatt_2013-07-09.2.sam.mpileup.summary.txt 2 H29_11627_i2m_WF_none_SP_2012-08-15_XhelRatt_2013-07-09.2.sam.mpileup.summary.txt 2 H29F8_11831B_i1.5m_WF_none_SP_2013-01-02_XhelRatt_2013-07-09.2.sam.mpileup.summary.txt 2 EnsembAnnot.txt 2,3,4 >ASEmasterTable_2013-08-02.txt
IV Preparing the table for R
Note: there is a 867 in only one X. hellerii sample and I could not find the source of that gene. So remove that line. Remove lines with total reads less than 20 reads.
V Modifying R script
End of post