Noi/NOTES/2012-4-30: Difference between revisions

From ZhangLabWiki
Jump to navigation Jump to search
>Noi
>Noi
No edit summary
Line 4: Line 4:
** http://miner.chem.purdue.edu/Lectures/Lecture10.pdf
** http://miner.chem.purdue.edu/Lectures/Lecture10.pdf
** http://little-book-of-r-for-multivariate-analysis.readthedocs.org/en/latest/src/multivariateanalysis.html#allocation-rules-and-misclassification-rate
** http://little-book-of-r-for-multivariate-analysis.readthedocs.org/en/latest/src/multivariateanalysis.html#allocation-rules-and-misclassification-rate
** http://stat.ethz.ch/education/semesters/ss2012/ams/Rscript/scriptV6.1.R (good details)
== Regression analysis of UCLA SZ data, applying LDA function ==
== Regression analysis of UCLA SZ data, applying LDA function ==
* Continued from: http://genome-tech.ucsd.edu/LabNotes/index.php/Noi/NOTES/2012-4-17
* Continued from: http://genome-tech.ucsd.edu/LabNotes/index.php/Noi/NOTES/2012-4-17

Revision as of 20:45, 4 May 2012

Regression analysis of UCLA SZ data, applying LDA function

  • Continued from: http://genome-tech.ucsd.edu/LabNotes/index.php/Noi/NOTES/2012-4-17
  • I repeated regression analysis again by changing some criteria to select the candidate significant CpG sites, based on FDR or with minimum raw p-value. For status regression analysis, I will not apply multiple test correction since I didn't get any signal. However with minimum t statistic of 2.5 from the previous analysis I could separate out the normal and affected samples. Dr. Suggested that this should be fine. In addition, I will change the color of the control samples in PCA analysis plots. LDA will be used then the number of samples in the two groups classified by the line will be counted.

Color code for PCA plot

  • Age
mycol=c(1,1,4,4,4,1,1,4,1,1,4,4,1,4,1,1,4,1,1,4,4,4,4,1,1,4,4,1,1,4,4,4,1,1,4,4,4,1,1,4,1,1,4,4,1,1,4,4,1,1,4,4,4,4,1,1,4,4,1,4,4,4,4,1,1,4,4,1,1,4,4,1,1,4,4,4,1,1,4,4,1,1,4,4,1,1,4,4,1,1,4,4,1,1,4,4,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2)
mycol[mycol==1]<- "black"   	#1=UCLA parents
mycol[mycol==4]<- "#32CD32"     #4=UCLA children(limegreen)
mycol[mycol==2]<- "#3A5FCD"     #2=UCSD-GA:all old adults(royalblue3)
  • sex
mycol=c(1,4,1,1,1,1,4,1,1,4,4,1,4,1,1,4,1,1,4,4,1,1,1,1,4,1,1,1,4,1,4,1,1,4,1,4,1,1,4,1,1,4,1,1,4,1,1,1,1,4,1,4,1,1,1,4,4,1,1,1,1,4,1,1,4,1,1,1,4,1,1,1,4,1,1,1,1,4,1,1,1,4,4,1,1,4,1,1,1,4,1,1,1,4,1,4,2,8,2,2,8,2,2,8,2,2,2,2,8,8,2,8,2,2,2,2,2,8,2,8,2,8,8,8,8,8,8,2,2,2,8,8,2,8,8,8,2,2,2,2,2,2,8,8,8,2,8,8,8,8,2,8,8,2,8,8,2,8,8,8,2,2,8,8,8,8,2,2,2)
mycol[mycol==1]<- "#000080" 	#navy=UCLA male
mycol[mycol==4]<- "#CD1076"	#pink=UCLA female
mycol[mycol==2]<- "#1874CD"	#blue=GA male
mycol[mycol==8]<- "#FF4500"  	#orange=GA female
  • status
mycol=c(4,4,1,4,1,4,4,4,4,4,4,4,4,1,4,4,4,4,4,4,1,4,1,4,4,4,1,4,4,4,4,1,4,4,4,4,1,4,4,4,4,4,4,1,4,4,1,4,4,4,1,4,4,1,4,4,4,4,4,4,1,4,4,4,4,1,4,4,4,4,1,4,4,1,4,1,4,4,1,1,4,4,4,4,4,4,1,4,4,4,1,4,4,4,1,4,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2)
mycol[mycol==1]<- "#EE0000"       #1=UCLA, affected (red2)
mycol[mycol==4]<- "#0000CD"        #4=UCLA, unaffected (mediumblue)
mycol[mycol==2]<- "#00BFFF"     #2=UCSD-GA(deepskyblue)
  • Directory: /home/nplongth/Noi_scratch/Data_analysis/UCLA_SZ_data_analysis_2012_04_05/UCLA_regression_analysis/2012_05_01_regression/
  • I used the files generated from previous analyses. Age, sex and status data with the calculated p-value and q-value were printed out in separated files.

PCA analysis, p-value <= 0.01

  • Print out the CpG sites, p-value <=0.01
awk '{if ($8<=0.01) print $0}' sorted_UCLA_regression_age_qval.txt > required_pval0.01/UCLA_regression_age_pval0.01
awk '{if ($8<=0.01) print $0}' sorted_UCLA_regression_sex_qval.txt > required_pval0.01/UCLA_regression_sex_pval0.01
awk '{if ($8<=0.01) print $0}' sorted_UCLA_regression_status.txt > required_pval0.01/UCLA_regression_status_pval0.01
  • Extract methylation value into the matrix
../extract_methyFreqMatrix.pl ../UCLA-GA_methyl_min70_minSTD0.05 UCLA_regression_age_pval0.01 > UCLA_regression_age_pval0.01_MM 
../extract_methyFreqMatrix.pl ../UCLA-GA_methyl_min70_minSTD0.05 UCLA_regression_sex_pval0.01 > UCLA_regression_sex_pval0.01_MM
../extract_methyFreqMatrix.pl ../UCLA-GA_methyl_min70_minSTD0.05 UCLA_regression_status_pval0.01 > UCLA_regression_status_pval0.01_MM
  • After I run PCA and found the separation of the sample based on sex and status was poor when compare to previous analysis I did with |t-stat| >2.5. One possible is that there were many missing values (NA), so the number of CpGs from regression and analyzed by PCA were very different.
  • I reduced the stringency by increasing p-value to 0.015 to get more sites as I got from |t-stat| >2.5 and enough to separate the samples into two groups based on the regression factors. However, this could introduce false positive signal as well.

PCA analysis, p-value <= 0.01

  • Print out the CpG sites, p-value <=0.015
awk '{if ($8<=0.015) print $0}' sorted_UCLA_regression_age_qval.txt > pval0.015/UCLA_regression_age_pval0.015  
awk '{if ($8<=0.015) print $0}' sorted_UCLA_regression_sex_qval.txt > pval0.015/UCLA_regression_sex_pval0.015
awk '{if ($8<=0.015) print $0}' sorted_UCLA_regression_status.txt > pval0.015/UCLA_regression_status_pval0.015
  • Extract methylation value into the matrix
../extract_methyFreqMatrix.pl ../UCLA-GA_methyl_min70_minSTD0.05 UCLA_regression_age_pval0.015 > UCLA_regression_age_pval0.015_MM 
../extract_methyFreqMatrix.pl ../UCLA-GA_methyl_min70_minSTD0.05 UCLA_regression_sex_pval0.015 > UCLA_regression_sex_pval0.015_MM
../extract_methyFreqMatrix.pl ../UCLA-GA_methyl_min70_minSTD0.05 UCLA_regression_status_pval0.015 > UCLA_regression_status_pval0.015_MM