Matt:LabNotes/2015-4-14: Difference between revisions

From ZhangLabWiki
Jump to navigation Jump to search
>Mzcai
(Created page with "==Normalize DARTFISH Counts with in vitro cDNA Capture== * V4 and V7 in vitro capture reads mapped to reference probe...")
 
>Mzcai
mNo edit summary
Line 1: Line 1:
==Normalize DARTFISH Counts with in vitro cDNA Capture==
==Normalize DARTFISH Counts with in vitro cDNA Capture==
===Starting Files===
*[[Matt:LabNotes/2015-3-19 | V4]] and [[Matt:LabNotes/2015-4-8 | V7]] in vitro capture reads mapped to reference probelist
*[[Matt:LabNotes/2015-3-19 | V4]] and [[Matt:LabNotes/2015-4-8 | V7]] in vitro capture reads mapped to reference probelist
*[[Media:CountReadsPer_Gene_Probe.txt | CountReadsPer_Gene_Probe.pl]]
*[[Media:CountReadsPer_Gene_Probe.txt | CountReadsPer_Gene_Probe.pl]]
**CA12kNov2014_V4cDNA_R1_H1H2_sorted_filtered_Genecounts.txt
**CA12kNov2014_V4cDNA_R1_H1H2_sorted_filtered_Genecounts.txt
**CA12kNov2014_V4cDNA_R1_H1H2_sorted_filtered_Probecounts.txt
**CA12kNov2014_V4cDNA_R1_H1H2_sorted_filtered_Probecounts.txt
**CA12kNov2014_V7cDNA_R1_H1H2_sorted_filtered_Genecounts.txt
**CA12kNov2014_V7cDNA_R1_H1H2_sorted_filtered_Probecounts.txt
*Get FPKM from UHRR RNA-Seq: genome-miner2:/media/LTS_33T/RL_LTS33T/20140510_20Samples_UHRR_RefRNA_2014603Expt143HiSeqRapid/1-UHRR-10pg-rep1_S1_mapped/genes.fpkm_tracking
*Get FPKM from UHRR RNA-Seq: genome-miner2:/media/LTS_33T/RL_LTS33T/20140510_20Samples_UHRR_RefRNA_2014603Expt143HiSeqRapid/1-UHRR-10pg-rep1_S1_mapped/genes.fpkm_tracking


===Normalize DARTFISH Counts===
#Convert genes.fpkm_tracking Ensembl Gene IDs to HGNC Symbols
#Convert genes.fpkm_tracking Ensembl Gene IDs to HGNC Symbols
#Normalize in vitro cDNA counts by dividing each gene by RNA-Seq FPKM
#Normalize in vitro cDNA counts by dividing each gene by RNA-Seq FPKM
#Normalize DARTFISH V4 counts by normalized in vitro cDNA counts
#Normalize DARTFISH counts by normalized in vitro cDNA counts
#Correlate with RNA-Seq, BeadArray, and FISSEQ
#Correlate with RNA-Seq, BeadArray, and FISSEQ


===Normalize in vitro cDNA Counts===
====Get FPKM for V4 and V7 genes====
*Files in "Dropbox\GradZhangLab\CA12k_Nov2014\V4_CaptureAnalysis"
*Converted ENSG genes from genes.fpkm_tracking to HGNC with Biomart
**UHRRgenes.txt <- list of ENSG names
*Used excel to match FPKM values to 242 genes in V4 and V7 probe sets
**[[Media:V4V7genes_UHRRfpkm.txt | V4V7genes_UHRRfpkm.txt]] <- HGNC names and FPKM values from UHRR RNA-Seq
**PTPRK and LAMA2 were not in UHRR RNA-Seq data
 
====Divide in vitro cDNA Counts by FPKM====
*Workspace: Dropbox\GradZhangLab\DecodeData\ReferenceData\.RData
  setwd("C:/Users/Matt/Dropbox/GradZhangLab/CA12k_Nov2014/V4_CaptureAnalysis")
  invitro_cV4_GeneCounts <- read.table("CA12kNov2014_V4cDNA_R1_H1H2_sorted_filtered_Genecounts.txt", header = FALSE, sep = "", row.names = 1)
  colnames(invitro_cV4_GeneCounts) <- c("invitro_cV4")
  setwd("C:/Users/Matt/Dropbox/GradZhangLab/CA12k_Nov2014/V7_CaptureAnalysis")
  invitro_cV7_GeneCounts <- read.table("CA12kNov2014_V7cDNA_R1_H1H2_sorted_filtered_Genecounts.txt", header = FALSE, sep = "", row.names = 1)
  colnames(invitro_cV7_GeneCounts) <- c("invitro_cV7")
  setwd("C:/Users/Matt/Dropbox/GradZhangLab/CA12k_Nov2014/V4_CaptureAnalysis")
  UHRR_FPKM <- read.table("V4V7genes_UHRRfpkm.txt", header = FALSE, sep = "", row.names = 1)
  colnames(UHRR_FPKM) <- c("UHRR_FPKM")
  setwd("C:/Users/Matt/Dropbox/GradZhangLab/DecodeData/ReferenceData")
  V4V7_GeneCounts <- transform(merge(V4V7_GeneCounts,invitro_cV4_GeneCounts,by=0,all.x=TRUE,all.y=FALSE),row.names=Row.names,Row.names=NULL)
  V4V7_GeneCounts <- transform(merge(V4V7_GeneCounts,invitro_cV7_GeneCounts,by=0,all.x=TRUE,all.y=FALSE),row.names=Row.names,Row.names=NULL)
  V4V7_GeneCounts <- transform(merge(V4V7_GeneCounts,UHRR_FPKM,by=0,all.x=TRUE,all.y=FALSE),row.names=Row.names,Row.names=NULL)
  V4V7_GeneCounts$invitro_cV4_Norm <- V4V7_GeneCounts$invitro_cV4 / V4V7_GeneCounts$UHRR_FPKM
  V4V7_GeneCounts$invitro_cV7_Norm <- V4V7_GeneCounts$invitro_cV7 / V4V7_GeneCounts$UHRR_FPKM
  V4V7_GeneCounts$loginvitro_cV4_Norm <- log(V4V7_GeneCounts$invitro_cV4_Norm)
  V4V7_GeneCounts$loginvitro_cV7_Norm <- log(V4V7_GeneCounts$invitro_cV7_Norm)
  V4V7_GeneCounts$loginvitro_cV4_Norm[which(!is.finite(V4V7_GeneCounts$loginvitro_cV4_Norm))] <- NA
  V4V7_GeneCounts$loginvitro_cV7_Norm[which(!is.finite(V4V7_GeneCounts$loginvitro_cV7_Norm))] <- NA
====Divide DARTFISH Counts by Normalized in vitro cDNA Counts====
*DARTFISH and data from other methods same as from: [[Matt:LabNotes/2015-4-8]] 
  V4V7_GeneCounts$FibV4_Normv2 <- V4V7_GeneCounts$FibV4_Sum / V4V7_GeneCounts$invitro_cV4_Norm
  V4V7_GeneCounts$BA8V4_Normv2 <- V4V7_GeneCounts$BA8V4_Sum / V4V7_GeneCounts$invitro_cV4_Norm
  V4V7_GeneCounts$FibV7_Normv2 <- V4V7_GeneCounts$FibV7_Sum / V4V7_GeneCounts$invitro_cV7_Norm
  V4V7_GeneCounts$logFibV4_Normv2 <- log(V4V7_GeneCounts$FibV4_Normv2)
  V4V7_GeneCounts$logBA8V4_Normv2 <- log(V4V7_GeneCounts$BA8V4_Normv2)
  V4V7_GeneCounts$logFibV7_Normv2 <- log(V4V7_GeneCounts$FibV7_Normv2)
  V4V7_GeneCounts$logFibV4_Normv2[which(!is.finite(V4V7_GeneCounts$logFibV4_Normv2))] <- NA
  V4V7_GeneCounts$logBA8V4_Normv2[which(!is.finite(V4V7_GeneCounts$logBA8V4_Normv2))] <- NA
  V4V7_GeneCounts$logFibV7_Normv2[which(!is.finite(V4V7_GeneCounts$logFibV7_Normv2))] <- NA
 
===Linear Regressions===
*Compare to regressions with gDNA in vitro normalized DARTFISH counts: [[Matt:LabNotes/2015-4-8]]
====Gene Counts: V4 vs V7 in vitro Capture====
*Previously (left/top fig.) very different gene count distributions between V4 and V7 caused the correlation between V4 and V7 DARTFISH gene counts in PGP1f to have no correlation
*Now (right/bottom fig.) gene count between V4 and V7 in vitro capture is much better, but maybe only because both were divided by same FPKM values
  lm(loginvitro_cV7_Norm~loginvitro_cV4_Norm, data = V4V7_GeneCounts, na.action=na.omit)
[[File:Regression_invitrocounts_V4_vs_V7.jpeg]] [[File:Regression_NormalizedcDNA_invitrocounts_V4_vs_V7.png |550px]]
 
====PGP1f: V4 vs V7 (cDNA invitro normalized)====
[[File:PGP1f_log_cDNAnorm_V4_vs_V7.png |550px]]
 
*Much better correlation than when DARTFISH counts normalized by gDNA in vitro counts
[[File:PGP1f_log_norm_V4_vs_V7.jpeg |350px]]
 
====PGP1f vs BA8 (V4, cDNA invitro normalized)====
[[File:V4_log_cDNAnorm_PGP1f_vs_BA8.png |550px]]
*Such high correlation between different samples is not a positive result...
 
====PGP1f: DARTFISH (V4, cDNA invitro normalized) vs RNA-Seq====
[[File:PGP1fV4_logDARTFISH_cDNAnorm_vs_logRNASeq_regression.png |550px]]
====PGP1f: DARTFISH (V7, cDNA invitro normalized) vs RNA-Seq====
[[File:PGP1fV7_logDARTFISH_cDNAnorm_vs_logRNASeq_regression.png |550px]]
*V7 is improved over gDNA invitro normalization (used to be negatively correlated) but still worse than V4
====PGP1f: DARTFISH (V4, cDNA invitro normalized) vs RNA-Seqv2====
[[File:PGP1fV4_logDARTFISH_cDNAnorm_vs_logRNASeqv2_regression.png |550px]]
====PGP1f: DARTFISH (V4, cDNA invitro normalized) vs BeadArray====
*Using: FPKM for gene = max FPKM of gene's isoforms
[[File:PGP1fV4_logDARTFISH_cDNAnorm_vs_logBeadArrayMax_regression.png |550px]]
====PGP1f: DARTFISH (V4, cDNA invitro normalized) vs FISSEQ====
[[File:PGP1fV4_logDARTFISH_cDNAnorm_vs_logFISSEQv1_regression.png |550px]]
====PGP1f: DARTFISH (V4, cDNA invitro normalized) vs FISSEQv2====
[[File:PGP1fV4_logDARTFISH_cDNAnorm_vs_logFISSEQv2_regression.png |550px]]
====BA8: DARTFISH vs RNA-Seq====
[[File:BA8_logDARTFISH_cDNAnorm_vs_logRNASeqBulkT_regression.png |550px]]

Revision as of 02:46, 17 April 2015

Normalize DARTFISH Counts with in vitro cDNA Capture

Starting Files

  • V4 and V7 in vitro capture reads mapped to reference probelist
  • CountReadsPer_Gene_Probe.pl
    • CA12kNov2014_V4cDNA_R1_H1H2_sorted_filtered_Genecounts.txt
    • CA12kNov2014_V4cDNA_R1_H1H2_sorted_filtered_Probecounts.txt
    • CA12kNov2014_V7cDNA_R1_H1H2_sorted_filtered_Genecounts.txt
    • CA12kNov2014_V7cDNA_R1_H1H2_sorted_filtered_Probecounts.txt
  • Get FPKM from UHRR RNA-Seq: genome-miner2:/media/LTS_33T/RL_LTS33T/20140510_20Samples_UHRR_RefRNA_2014603Expt143HiSeqRapid/1-UHRR-10pg-rep1_S1_mapped/genes.fpkm_tracking

Normalize DARTFISH Counts

  1. Convert genes.fpkm_tracking Ensembl Gene IDs to HGNC Symbols
  2. Normalize in vitro cDNA counts by dividing each gene by RNA-Seq FPKM
  3. Normalize DARTFISH counts by normalized in vitro cDNA counts
  4. Correlate with RNA-Seq, BeadArray, and FISSEQ

Get FPKM for V4 and V7 genes

  • Files in "Dropbox\GradZhangLab\CA12k_Nov2014\V4_CaptureAnalysis"
  • Converted ENSG genes from genes.fpkm_tracking to HGNC with Biomart
    • UHRRgenes.txt <- list of ENSG names
  • Used excel to match FPKM values to 242 genes in V4 and V7 probe sets
    • V4V7genes_UHRRfpkm.txt <- HGNC names and FPKM values from UHRR RNA-Seq
    • PTPRK and LAMA2 were not in UHRR RNA-Seq data

Divide in vitro cDNA Counts by FPKM

  • Workspace: Dropbox\GradZhangLab\DecodeData\ReferenceData\.RData
 setwd("C:/Users/Matt/Dropbox/GradZhangLab/CA12k_Nov2014/V4_CaptureAnalysis")
 invitro_cV4_GeneCounts <- read.table("CA12kNov2014_V4cDNA_R1_H1H2_sorted_filtered_Genecounts.txt", header = FALSE, sep = "", row.names = 1)
 colnames(invitro_cV4_GeneCounts) <- c("invitro_cV4")
 setwd("C:/Users/Matt/Dropbox/GradZhangLab/CA12k_Nov2014/V7_CaptureAnalysis")
 invitro_cV7_GeneCounts <- read.table("CA12kNov2014_V7cDNA_R1_H1H2_sorted_filtered_Genecounts.txt", header = FALSE, sep = "", row.names = 1)
 colnames(invitro_cV7_GeneCounts) <- c("invitro_cV7")
 setwd("C:/Users/Matt/Dropbox/GradZhangLab/CA12k_Nov2014/V4_CaptureAnalysis")
 UHRR_FPKM <- read.table("V4V7genes_UHRRfpkm.txt", header = FALSE, sep = "", row.names = 1)
 colnames(UHRR_FPKM) <- c("UHRR_FPKM")
 setwd("C:/Users/Matt/Dropbox/GradZhangLab/DecodeData/ReferenceData")
 V4V7_GeneCounts <- transform(merge(V4V7_GeneCounts,invitro_cV4_GeneCounts,by=0,all.x=TRUE,all.y=FALSE),row.names=Row.names,Row.names=NULL)
 V4V7_GeneCounts <- transform(merge(V4V7_GeneCounts,invitro_cV7_GeneCounts,by=0,all.x=TRUE,all.y=FALSE),row.names=Row.names,Row.names=NULL)
 V4V7_GeneCounts <- transform(merge(V4V7_GeneCounts,UHRR_FPKM,by=0,all.x=TRUE,all.y=FALSE),row.names=Row.names,Row.names=NULL)
 V4V7_GeneCounts$invitro_cV4_Norm <- V4V7_GeneCounts$invitro_cV4 / V4V7_GeneCounts$UHRR_FPKM
 V4V7_GeneCounts$invitro_cV7_Norm <- V4V7_GeneCounts$invitro_cV7 / V4V7_GeneCounts$UHRR_FPKM
 V4V7_GeneCounts$loginvitro_cV4_Norm <- log(V4V7_GeneCounts$invitro_cV4_Norm)
 V4V7_GeneCounts$loginvitro_cV7_Norm <- log(V4V7_GeneCounts$invitro_cV7_Norm)
 V4V7_GeneCounts$loginvitro_cV4_Norm[which(!is.finite(V4V7_GeneCounts$loginvitro_cV4_Norm))] <- NA
 V4V7_GeneCounts$loginvitro_cV7_Norm[which(!is.finite(V4V7_GeneCounts$loginvitro_cV7_Norm))] <- NA

Divide DARTFISH Counts by Normalized in vitro cDNA Counts

 V4V7_GeneCounts$FibV4_Normv2 <- V4V7_GeneCounts$FibV4_Sum / V4V7_GeneCounts$invitro_cV4_Norm
 V4V7_GeneCounts$BA8V4_Normv2 <- V4V7_GeneCounts$BA8V4_Sum / V4V7_GeneCounts$invitro_cV4_Norm
 V4V7_GeneCounts$FibV7_Normv2 <- V4V7_GeneCounts$FibV7_Sum / V4V7_GeneCounts$invitro_cV7_Norm
 V4V7_GeneCounts$logFibV4_Normv2 <- log(V4V7_GeneCounts$FibV4_Normv2)
 V4V7_GeneCounts$logBA8V4_Normv2 <- log(V4V7_GeneCounts$BA8V4_Normv2)
 V4V7_GeneCounts$logFibV7_Normv2 <- log(V4V7_GeneCounts$FibV7_Normv2)
 V4V7_GeneCounts$logFibV4_Normv2[which(!is.finite(V4V7_GeneCounts$logFibV4_Normv2))] <- NA
 V4V7_GeneCounts$logBA8V4_Normv2[which(!is.finite(V4V7_GeneCounts$logBA8V4_Normv2))] <- NA
 V4V7_GeneCounts$logFibV7_Normv2[which(!is.finite(V4V7_GeneCounts$logFibV7_Normv2))] <- NA

Linear Regressions

Gene Counts: V4 vs V7 in vitro Capture

  • Previously (left/top fig.) very different gene count distributions between V4 and V7 caused the correlation between V4 and V7 DARTFISH gene counts in PGP1f to have no correlation
  • Now (right/bottom fig.) gene count between V4 and V7 in vitro capture is much better, but maybe only because both were divided by same FPKM values
 lm(loginvitro_cV7_Norm~loginvitro_cV4_Norm, data = V4V7_GeneCounts, na.action=na.omit)

File:Regression invitrocounts V4 vs V7.jpeg File:Regression NormalizedcDNA invitrocounts V4 vs V7.png

PGP1f: V4 vs V7 (cDNA invitro normalized)

File:PGP1f log cDNAnorm V4 vs V7.png

  • Much better correlation than when DARTFISH counts normalized by gDNA in vitro counts

File:PGP1f log norm V4 vs V7.jpeg

PGP1f vs BA8 (V4, cDNA invitro normalized)

File:V4 log cDNAnorm PGP1f vs BA8.png

  • Such high correlation between different samples is not a positive result...

PGP1f: DARTFISH (V4, cDNA invitro normalized) vs RNA-Seq

File:PGP1fV4 logDARTFISH cDNAnorm vs logRNASeq regression.png

PGP1f: DARTFISH (V7, cDNA invitro normalized) vs RNA-Seq

File:PGP1fV7 logDARTFISH cDNAnorm vs logRNASeq regression.png

  • V7 is improved over gDNA invitro normalization (used to be negatively correlated) but still worse than V4

PGP1f: DARTFISH (V4, cDNA invitro normalized) vs RNA-Seqv2

File:PGP1fV4 logDARTFISH cDNAnorm vs logRNASeqv2 regression.png

PGP1f: DARTFISH (V4, cDNA invitro normalized) vs BeadArray

  • Using: FPKM for gene = max FPKM of gene's isoforms

File:PGP1fV4 logDARTFISH cDNAnorm vs logBeadArrayMax regression.png

PGP1f: DARTFISH (V4, cDNA invitro normalized) vs FISSEQ

File:PGP1fV4 logDARTFISH cDNAnorm vs logFISSEQv1 regression.png

PGP1f: DARTFISH (V4, cDNA invitro normalized) vs FISSEQv2

File:PGP1fV4 logDARTFISH cDNAnorm vs logFISSEQv2 regression.png

BA8: DARTFISH vs RNA-Seq

File:BA8 logDARTFISH cDNAnorm vs logRNASeqBulkT regression.png