Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ngs-docs/2015-may-nonmodel
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed May 5, 2015
2 parents 31702c7 + aad2099 commit 282ee61
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 60 deletions.
4 changes: 2 additions & 2 deletions files/diff_exp.R
@@ -1,7 +1,7 @@
library("edgeR")

files <- c("0Hour_repl1_counts.txt.merged", "0Hour_repl2_counts.txt.merged",
"6Hour_repl1_counts.txt.merged", "6Hour_repl2_counts.txt.merged")
files <- c("0Hour_repl1_counts.txt", "0Hour_repl2_counts.txt",
"6Hour_repl1_counts.txt", "6Hour_repl2_counts.txt")

data <- readDGE(files, header=FALSE)

Expand Down
16 changes: 0 additions & 16 deletions files/merge.py

This file was deleted.

Binary file modified files/nema-edgeR-MA-plot.pdf
Binary file not shown.
Binary file modified files/nema-edgeR-MDS.pdf
Binary file not shown.
98 changes: 70 additions & 28 deletions files/nema-edgeR.csv
@@ -1,29 +1,71 @@
"","logFC","logCPM","PValue","FDR"
"bundle_24",14.4729865179274,14.0299655757247,0.0302768626331507,0.847752153728219
"bundle_14",14.3464326761289,13.9039028346367,0.135488882562265,0.97264654246365
"bundle_27",-14.835869975884,14.3855931200707,0.144032683440994,0.97264654246365
"bundle_6",-14.234747239784,13.7835637435361,0.1581542204802,0.97264654246365
"bundle_5",11.0308618861615,14.018246336949,0.173686882582795,0.97264654246365
"bundle_8",13.2389265954586,16.2330381121375,0.306793870709584,1
"bundle_22",4.92287402954956,14.2393137971876,0.364458605983172,1
"bundle_1",-13.114990166072,12.6612296126701,0.369505991953791,1
"bundle_28",13.6254547854307,13.1868220173904,0.375615420683723,1
"bundle_13",-12.944675454604,12.4903544274141,0.378965316886638,1
"bundle_23",-6.2476786518982,15.20690780882,0.473710745753074,1
"bundle_11",12.9902791292564,12.5573126885887,0.476566503088613,1
"bundle_19",-7.34869563086617,9.01866160303159,0.585280610438655,1
"bundle_7",3.23348934067089,16.5425410560567,0.761629729699292,1
"bundle_18",-2.82430936476491,15.8390278005958,0.77942357032803,1
"bundle_26",-2.23613040685778,15.0839706203438,0.807619040809705,1
"bundle_16",-1.78336002747876,14.6421497843144,0.821892297433184,1
"bundle_2",-2.32973095820576,15.084597220235,0.831172050806527,1
"bundle_17",-1.87296979236501,16.8623784531514,0.879655950617142,1
"bundle_20",1.96685179915843,16.568435477304,0.890960240896915,1
"bundle_9",1.27424954712777,9.55864505509543,0.895901240884305,1
"bundle_4",-0.920290080437448,14.301978044377,0.8998044456292,1
"bundle_10",-0.503825146423093,14.6020477994112,0.931891623925841,1
"bundle_3",0.773290725766433,15.2953925724507,0.946094431703242,1
"bundle_21",-0.553540063999796,17.5421659859617,0.959892407057648,1
"bundle_25",-0.0395510538641514,13.5191171788508,0.99751132871367,1
"bundle_12",0,4.55115823757055,1,1
"bundle_15",0,4.55115823757055,1,1
"nema.id35.tr11",2.17065358331553,12.6343945540792,5.73878088585622e-83,4.01714662009935e-81
"nema.id39.tr11",2.06193946263163,12.5221851685426,4.46369004020794e-72,1.56229151407278e-70
"nema.id49.tr11",2.02595515468873,12.5844807970217,1.11593629238436e-70,2.60385134889684e-69
"nema.id48.tr11",1.91433618579292,12.5292216476828,2.86190827481553e-68,5.00833948092718e-67
"nema.id57.tr11",2.07234660725121,12.6855756473978,7.56279862061612e-67,1.05879180688626e-65
"nema.id56.tr11",1.94931924664717,12.6347114832548,9.6186284754623e-67,1.12217332213727e-65
"nema.id44.tr11",1.9236862053968,12.4759897832871,4.42766312538388e-61,4.21536498013204e-60
"nema.id42.tr11",1.8183890257116,12.4718178775233,4.81755997729376e-61,4.21536498013204e-60
"nema.id51.tr11",2.02542741067896,12.4317471824812,1.11221127414189e-59,8.65053213221468e-59
"nema.id50.tr11",1.77149829792612,12.4494934214167,1.5275544032419e-57,1.06928808226933e-56
"nema.id34.tr11",1.97839126262656,12.443965974565,2.53564379183171e-55,1.61359150389291e-54
"nema.id41.tr11",1.87461143605191,12.5026014911319,8.32474815297262e-51,4.85610308923403e-50
"nema.id55.tr11",1.79006441885286,12.4915633279499,1.18007797566732e-48,6.35426602282406e-48
"nema.id52.tr11",1.98267870251049,12.387962470896,2.60303699533363e-47,1.30151849766681e-46
"nema.id53.tr11",1.72405156663365,12.4374026562929,3.56334941482877e-45,1.66289639358676e-44
"nema.id33.tr11",1.71245928202242,12.3918026582204,2.77269779917344e-41,1.21305528713838e-40
"nema.id54.tr11",1.71268501801211,12.6886151521006,1.80589389368957e-39,7.43603367989823e-39
"nema.id46.tr11",2.06128633784812,12.7057945063978,4.21141106090386e-33,1.63777096812928e-32
"nema.id32.tr11",2.1882474572372,12.72667101935,5.22117603580447e-27,1.92359117108586e-26
"nema.id43.tr11",2.15417478406691,12.710174498169,6.3806360271007e-27,2.23322260948524e-26
"nema.id37.tr11",2.3310799597395,13.0046176144608,1.18202526187479e-26,3.9400842062493e-26
"nema.id15.tr6",-2.16912636765073,12.7310218136583,1.29214436694751e-26,4.11136844028753e-26
"nema.id38.tr11",2.10201059838352,12.8149426065469,3.58209432900227e-23,1.09020262187026e-22
"nema.id31.tr11",2.09833448124352,12.7721474285813,3.89939652353424e-23,1.13732398603082e-22
"nema.id58.tr11",2.06762883131983,12.7503756900071,1.20319384835852e-22,3.36894277540386e-22
"nema.id36.tr11",2.07154678555188,12.8077472648351,1.34199183301846e-22,3.6130549350497e-22
"nema.id25.tr9",-1.57796545788225,16.3271813331976,4.43190306737974e-22,1.14901190635771e-21
"nema.id45.tr11",2.40672963972053,13.4302077017147,9.06735609807068e-16,2.26683902451767e-15
"nema.id47.tr11",2.35811279959222,13.1524867560921,2.19244783354626e-15,5.29211546028409e-15
"nema.id40.tr11",1.5323615855382,14.27409522314,5.28472425079339e-12,1.23310232518512e-11
"nema.id22.tr8",-1.18606294444767,14.7400071147146,6.94182754880087e-09,1.56750944650342e-08
"nema.id12.tr6",1.13879068268708,9.43647576938144,1.09301189711248e-05,2.39096352493356e-05
"nema.id21.tr8",-0.832800352573229,13.97770762669,0.0001059411408598,0.000224723632126848
"nema.id19.tr7",-0.747307691275258,15.402030879921,0.000154651091230995,0.000318399305475578
"nema.id20.tr7",3.00636703516534,6.84408773119342,0.000270954406889969,0.000541908813779939
"nema.id64.tr14",0.69960015542644,14.883112287183,0.000425303241985453,0.000826978526082824
"nema.id4.tr1",1.06016051267097,9.1333418449722,0.00292802560716536,0.00553950790544799
"nema.id67.tr15",-0.275018377189713,18.3763345195094,0.00692568579365078,0.012757842251462
"nema.id23.tr8",-1.14024989102403,8.13351124710618,0.00969145152401799,0.0173949129918272
"nema.id62.tr13",-0.202738884478615,16.6879480446036,0.0409194593156398,0.0716090538023696
"nema.id2.tr1",-0.36872997026904,13.8162097855765,0.0466803440347817,0.0796981483520664
"nema.id1.tr1",-0.422561159524725,10.657387323705,0.0672287671765471,0.112047945294245
"nema.id3.tr1",0.375711099707284,12.8643068979624,0.082447158505571,0.134216304543953
"nema.id68.tr15",0.667722145518913,9.14045889010442,0.0961141231638655,0.15290883230615
"nema.id29.tr10",-0.311962805570661,16.1743836216787,0.115132993975519,0.179095768406362
"nema.id63.tr13",0.23860131875755,11.3221296257932,0.158694682650517,0.241491908381222
"nema.id26.tr10",-0.215357235508689,11.0611215729712,0.167740890392067,0.249826858030738
"nema.id13.tr6",-0.253020984558969,14.4385610366479,0.175690768518433,0.256215704089381
"nema.id14.tr6",0.33543357395435,9.46610074198554,0.243734173565045,0.348191676521492
"nema.id18.tr6",-0.182678471827889,14.6363734394884,0.337762040709001,0.472866856992602
"nema.id30.tr10",-0.198071431573184,9.59844722766697,0.387704143357529,0.532142941863275
"nema.id11.tr6",0.440072879190342,5.86839280618889,0.78555004630662,1
"nema.id24.tr8",-2.56289006796644,4.72459270396058,0.999999999999999,1
"nema.id6.tr3",0.390865314267717,5.00934662515906,1,1
"nema.id7.tr4",0,4.55115823757055,1,1
"nema.id61.tr13",0,4.55115823757055,1,1
"nema.id66.tr15",0,4.55115823757055,1,1
"nema.id5.tr2",0,4.55115823757055,1,1
"nema.id17.tr6",0,4.55115823757055,1,1
"nema.id16.tr6",0,4.55115823757055,1,1
"nema.id8.tr5",0,4.55115823757055,1,1
"nema.id65.tr15",0,4.55115823757055,1,1
"nema.id60.tr13",0,4.55115823757055,1,1
"nema.id59.tr12",0,4.55115823757055,1,1
"nema.id70.tr16",0,4.55115823757055,1,1
"nema.id9.tr6",0,4.55115823757055,1,1
"nema.id69.tr15",0,4.55115823757055,1,1
"nema.id27.tr10",0,4.55115823757055,1,1
"nema.id28.tr10",0,4.55115823757055,1,1
"nema.id10.tr6",0,4.55115823757055,1,1
19 changes: 5 additions & 14 deletions quantification.rst
Expand Up @@ -89,12 +89,12 @@ First, install R and edgeR::

sudo apt-get install -y r-base-core r-bioc-edger csvtool

Now, we extract the columns we need from the eXpress outputs::
Now, we extract the columns we need from the eXpress outputs and convert it to the appropriate format::

csvtool namedcol -t TAB bundle_id,est_counts 0Hour_ATCACG_L002_001.extract.sam-express/results.xprs > 0Hour_repl1_counts.txt
csvtool namedcol -t TAB bundle_id,est_counts 0Hour_ATCACG_L002_002.extract.sam-express/results.xprs > 0Hour_repl2_counts.txt
csvtool namedcol -t TAB bundle_id,est_counts 6Hour_CGATGT_L002_001.extract.sam-express/results.xprs > 6Hour_repl1_counts.txt
csvtool namedcol -t TAB bundle_id,est_counts 6Hour_CGATGT_L002_002.extract.sam-express/results.xprs > 6Hour_repl2_counts.txt
csvtool namedcol -t TAB target_id,est_counts 0Hour_ATCACG_L002_001.extract.sam-express/results.xprs | csvtool drop 1 -u TAB - > 0Hour_repl1_counts.txt
csvtool namedcol -t TAB target_id,est_counts 0Hour_ATCACG_L002_002.extract.sam-express/results.xprs | csvtool drop 1 -u TAB - > 0Hour_repl2_counts.txt
csvtool namedcol -t TAB target_id,est_counts 6Hour_CGATGT_L002_001.extract.sam-express/results.xprs | csvtool drop 1 -u TAB - > 6Hour_repl1_counts.txt
csvtool namedcol -t TAB target_id,est_counts 6Hour_CGATGT_L002_002.extract.sam-express/results.xprs | csvtool drop 1 -u TAB - > 6Hour_repl2_counts.txt

We'll be using `edgeR
<http://www.bioconductor.org/packages/release/bioc/html/edgeR.html>`__
Expand All @@ -117,15 +117,6 @@ So, download the script::
cd /mnt/work
curl -O http://2015-may-nonmodel.readthedocs.org/en/latest/_static/diff_exp.R

edgeR prefers its counts in a slightly different format than eXpress uses. I've provided a short python script to the conversion for you, which we'll run before we run the script we just downloaded::

cd /mnt/work
curl -O http://2015-may-nonmodel.readthedocs.org/en/latest/_static/merge.py
python merge.py 0Hour_repl1_counts.txt > 0Hour_repl1_counts.txt.merged
python merge.py 0Hour_repl2_counts.txt > 0Hour_repl2_counts.txt.merged
python merge.py 6Hour_repl1_counts.txt > 6Hour_repl1_counts.txt.merged
python merge.py 6Hour_repl2_counts.txt > 6Hour_repl2_counts.txt.merged

Now we run the differential expression script with::

Rscript diff_exp.R
Expand Down

0 comments on commit 282ee61

Please sign in to comment.